186 lines
5.2 KiB
JavaScript
186 lines
5.2 KiB
JavaScript
///////////////////////////////////////////
|
|
////////T O O L B A R /////////////////////
|
|
///////////////////////////////////////////
|
|
|
|
|
|
/************************************/
|
|
/************************************/
|
|
/* chiama scanner barcode da webview android */
|
|
/************************************/
|
|
/************************************/
|
|
function scan(field) {
|
|
|
|
Android.scanBarcode(field);
|
|
}
|
|
|
|
|
|
/*****************************************/
|
|
/*****************************************/
|
|
/* su servizioDPCR */
|
|
/*****************************************/
|
|
/*****************************************/
|
|
function selezionaTutto() {
|
|
//var valore = $("#ckflgSelezionaTutto").attr("checked")=="checked"?true:false;
|
|
var valore = $("#flgSelezionaTutto").val();
|
|
$("input[id^='ckflgSel_']").each(function (index, element) {
|
|
//element.checked = valore;
|
|
var id = $(element).attr("name").replace("ckflgSel_", "");
|
|
element.checked = valore == 0 ? false : true;
|
|
$("#flgSel_" + id).val(valore);
|
|
});
|
|
}
|
|
|
|
/*****************************************/
|
|
/*****************************************/
|
|
/* popup scelta tipo documento*/
|
|
/*****************************************/
|
|
/*****************************************/
|
|
function pregeneraDocumento() {
|
|
// check dei servizi selezionati
|
|
var id_sel = 0;
|
|
//Ab.setChekBoxValue("main", "flgIgnoraRiferimentiDiversi", "1", "0");
|
|
$("input[name^='ckflgSel_']").each(function () {
|
|
// faccio la lista dei servizi selezionati da passare alla servlet
|
|
if (this.checked) {
|
|
id_sel += 1;
|
|
}
|
|
});
|
|
// apro la dialog oppure mando un messaggio di errore
|
|
if (id_sel > 0) {
|
|
$("#tipoFatturaBP").modal("show");
|
|
|
|
} else {
|
|
alert("Selezionare almeno una pezza.");
|
|
}
|
|
}
|
|
|
|
/*****************************************/
|
|
/*****************************************/
|
|
/*genera il documento dal popup*/
|
|
/*****************************************/
|
|
/*****************************************/
|
|
function generaDocumento() {
|
|
var f = document.main;
|
|
|
|
if ($("#id_tipoDocumentoD").val() != 0 && $("#flgStatoD").val()) {
|
|
if (confirm("Verranno generate le fatture secondo i criteri di ricerca selezionati. Sei Sicuro?")) {
|
|
$("#tipoFatturaBP").modal("hide");
|
|
f.cmd.value = "generaDocumento";
|
|
|
|
$("#flgStato").val($("#flgStatoD").val());
|
|
$("#id_tipoDocumento").val($("#id_tipoDocumentoD").val());
|
|
|
|
var id_lavPezze = "";
|
|
$("input[name^='ckflgSel_']").each(function () {
|
|
// faccio la lista dei servizi selezionati da passare alla servlet
|
|
if (this.checked) {
|
|
var id = this.name.replace("ckflgSel_", "");
|
|
|
|
id_lavPezze += id + ",";
|
|
}
|
|
});
|
|
|
|
f.id_lavPezze.value = id_lavPezze;
|
|
|
|
f.action = f.actionPage.value;
|
|
//data emissione
|
|
$("#dataEmissioneDocumento").val($("#dataED").val())
|
|
//Ab.popUp('ELAB')
|
|
//alert('pioxxx');
|
|
Ab.submitAj("main", null, "listaDocumenti()");
|
|
}
|
|
} else {
|
|
alert("Dati mancanti!");
|
|
}
|
|
}
|
|
/***********************************************/
|
|
/***********************************************/
|
|
// callback dopo la generazione delle fatture
|
|
/***********************************************/
|
|
/***********************************************/
|
|
function listaDocumenti() {
|
|
//alert('pioaaaa');
|
|
//numero fatture....
|
|
if ($("#numDocumentiGenerati").val() != 1 || true) {
|
|
$("#listaDocumenti").modal("show");
|
|
} else {
|
|
|
|
mostraDocumentoDaModal($("#idDocumentoGenerato").val());
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/***********************************************/
|
|
/***********************************************/
|
|
// mostra documento che nasconde la modal
|
|
/***********************************************/
|
|
/***********************************************/
|
|
function mostraDocumentoDaModal(id) {
|
|
|
|
$("#listaDocumenti").modal("hide");
|
|
setTimeout(function () {
|
|
{
|
|
mostraDocumento(id);
|
|
|
|
}
|
|
|
|
}, 500);
|
|
|
|
|
|
}
|
|
|
|
/***********************************************/
|
|
/***********************************************/
|
|
/* dettaglio documento se unico....*/
|
|
/***********************************************/
|
|
/***********************************************/
|
|
function mostraDocumento(id) {
|
|
//FACCIO IL SUBMIT
|
|
var f = document.main;
|
|
f.action = "../contab/Documento.abl";
|
|
f.cmd.value = "md";
|
|
f.id_documento.value = id;
|
|
Ab.submitAj('main');
|
|
}
|
|
|
|
|
|
/***********************************************/
|
|
/***********************************************/
|
|
/* MOSTRA DETTAGLIO PEZZE su popup */
|
|
/***********************************************/
|
|
/***********************************************/
|
|
function mostraPezzaPopup(l_id) {
|
|
|
|
|
|
$(".pezza-body").load("../lav/BollaPezza.abl?cmd=mostraPezza&id_lavPezza=" + l_id);
|
|
|
|
$("#modalPezza").modal("show");
|
|
|
|
|
|
}
|
|
/***********************************************/
|
|
/***********************************************/
|
|
/* aggiungi pezza */
|
|
/***********************************************/
|
|
/***********************************************/
|
|
function salvaPezza() {
|
|
l_codicePezza = $("#codicePezza").val();
|
|
l_mt = $("#mtPezza").val();
|
|
//alert($("#codicePancaleE").val());
|
|
if (Ab.validateForm('codicePancaleE', 'Pancale ', 'R', 'codicePezzaE', 'Codice Pezza', 'R', 'mtPezzaE', 'Mt. Pezza', 'RisNum>0')) {
|
|
$("#modalPezza").modal("hide");
|
|
setTimeout(function () {
|
|
{
|
|
var f = document.main;
|
|
f.action = f.actionPage.value;
|
|
$("#cmd").val("aggiungiPezza");
|
|
//Ab.submitAj("main", null, "listaDocumenti()");
|
|
Ab.submitAj("main");
|
|
|
|
|
|
}
|
|
|
|
}, 500);
|
|
}
|
|
}
|