first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
21
rus/admin/contab/_js/_inc_documento_testa.js
Normal file
21
rus/admin/contab/_js/_inc_documento_testa.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
/*************************************/
|
||||
/*************************************/
|
||||
/* apre popup ricerca banca
|
||||
/*************************************/
|
||||
/*************************************/
|
||||
function cercaBanca()
|
||||
{
|
||||
console.log("cercabanca...");
|
||||
|
||||
$("#modalBanca").modal("show");
|
||||
}
|
||||
|
||||
function selezionaBanca(descrizione, iban,bic)
|
||||
{
|
||||
$("#bancaDesc").val(descrizione);
|
||||
$("#iban").val(iban);
|
||||
$("#bic").val(bic);
|
||||
|
||||
$("#modalBanca").modal("hide");
|
||||
}
|
||||
82
rus/admin/contab/_js/ab-distintaRiba.js
Normal file
82
rus/admin/contab/_js/ab-distintaRiba.js
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
function checkFields()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("dettaglio","flgSommaCRL","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
|
||||
$(":checkbox").on("ifChecked", null, null, function () {
|
||||
checkUncheck(this);
|
||||
});
|
||||
|
||||
$(":checkbox").on("ifUnchecked", null, null, function () {
|
||||
checkUncheck(this);
|
||||
});
|
||||
|
||||
function checkUncheck(that)
|
||||
{
|
||||
// trovo l'input collegato alla checkbox
|
||||
var name = $(that).attr("name").replace("ck", "");
|
||||
|
||||
// controllo lo stato della checkbox e valorizzo la input
|
||||
if ($(that).is(":checked"))
|
||||
{
|
||||
$("#" + name).val(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#" + name).val(0);
|
||||
}
|
||||
|
||||
|
||||
saveCommand();
|
||||
}
|
||||
|
||||
function creaFile()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="creaFile";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
var f = document.main,
|
||||
debug=false,
|
||||
wwD="700",
|
||||
whD="500",
|
||||
theAction=f.actionPage.value+".pdf?cmd=print"+"&id_distintaRiba="+f.id_distintaRiba.value;
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
203
rus/admin/contab/_js/ab-documentiFigli.js
Normal file
203
rus/admin/contab/_js/ab-documentiFigli.js
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/////////////////////////////////////////////
|
||||
// APRE POPUP PER CREA DOCUMENTO FIGLI
|
||||
// DA MASCHERA DI RICERCA IN ALTO SE SCELTO IL TIPO DI DOCUMENTOD
|
||||
/////////////////////////////////////////////
|
||||
function preCreaDocFigliCR() {
|
||||
var f = document.main;
|
||||
l_id_tipoDocumento=$("#id_tipoDocumento").val();
|
||||
//alert(f.actionPage.value + "?cmd=creaDocFigliS&id_tipoDocumento=" + l_id_tipoDocumento);
|
||||
$('#modalDocFiglio').modal('show');
|
||||
$("#modalDocFiglio").load(f.actionPage.value + "?cmd=creaDocFigliS&id_tipoDocumento=" + l_id_tipoDocumento);
|
||||
|
||||
|
||||
//$('#modalDocFiglio .modal-title').html("Crea documento figlio");
|
||||
//$('#modalDocFiglio').modal('show');
|
||||
//$('#modalDocFiglio .modal-body').load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
/*$(".dummyCreaDoc").load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, function () {
|
||||
$('#modalDocFiglio .modal-body').html($(".dummyCreaDoc").html());
|
||||
|
||||
$(".dummyCreaDoc").html();
|
||||
});*/
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// APRE POPUP PER CREA DOCUMENTO FIGLI
|
||||
// DA MASCHERA DI RICERCA SU SINGOLO DOCUMENTO
|
||||
/////////////////////////////////////////////
|
||||
function preCreaDocFiglioCR(l_id_documento) {
|
||||
var f = document.main;
|
||||
$('#modalDocFiglio').modal('show');
|
||||
$("#modalDocFiglio").load(f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
|
||||
|
||||
//$('#modalDocFiglio .modal-title').html("Crea documento figlio");
|
||||
//$('#modalDocFiglio').modal('show');
|
||||
//$('#modalDocFiglio .modal-body').load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
/*$(".dummyCreaDoc").load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, function () {
|
||||
$('#modalDocFiglio .modal-body').html($(".dummyCreaDoc").html());
|
||||
|
||||
$(".dummyCreaDoc").html();
|
||||
});*/
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
//COMANDO VERO E PROPRIO DI CREAZIONE DOC FIGLI
|
||||
// DALLA MASCHERA DI RICERCA
|
||||
/////////////////////////////////////////////
|
||||
function creaDocFiglioCR(l_id_documento) {
|
||||
var f = document.main;
|
||||
if (l_id_documento == 0) {
|
||||
alert("ERRORE! documento non valido!");
|
||||
return;
|
||||
}
|
||||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||||
//eventualmente la variante
|
||||
var ap = f.actionPage.value;
|
||||
$('#modalDocFiglio').modal('show');
|
||||
$("#modalDocFiglio").load(f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
//modalW=dhtmlwindow.open('modalW', 'ajax', 'Articolo.abl?cmd=riordinoS', 'Riordino articolo', 'width=650px,height=300px,left=300px,top=100px,resize=1,scrolling=1');
|
||||
modalW("Crea Doc. Figli", f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, 650, 300);
|
||||
refreshDocFigli();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// APRI IL POPUP PER LA CREAZIONE DEL DOCUMENTO
|
||||
// FIGLIO DAL DETTAGLIO DOCUMENTO
|
||||
/////////////////////////////////////////////
|
||||
function creaDocFiglioD() {
|
||||
var f = document.main;
|
||||
var l_id_documento = f.id_documento.value;
|
||||
if (l_id_documento == 0) {
|
||||
alert("ERRORE! documento non valido!");
|
||||
return;
|
||||
}
|
||||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||||
//eventualmente la variante
|
||||
$('#modalDocFiglio').modal('show');
|
||||
$("#modalDocFiglio").load(f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// INVIO COMANDO DI CREAZIONE DOCUMENTO FIGLIO
|
||||
/////////////////////////////////////////////
|
||||
function creaDocFiglio(l_id_documento) {
|
||||
//alert('xx');
|
||||
var f = document.main;
|
||||
|
||||
console.log(f.actionPage.value);
|
||||
var l_flgClienteFornitore = $("#docGenType_" + $("#id_tipoDocumentoScelta").val()).val();
|
||||
//alert(l_flgClienteFornitore);
|
||||
/*var l_flgClienteFornitore = document.getElementById('docGenType_' + $("#id_tipoDocumentoScelta").val()).value;*/
|
||||
|
||||
var clifor = "";
|
||||
if (l_flgClienteFornitore == "F")
|
||||
clifor = document.getElementById('id_cliforSceltaF');
|
||||
else if (l_flgClienteFornitore == "C")
|
||||
clifor = document.getElementById('id_cliforSceltaC');
|
||||
var id_tipoDocumentoFiglio = document.getElementById('id_tipoDocumentoScelta');
|
||||
var l_flgTipoGenerazione = $("#flgTipoGenerazionePop").val();
|
||||
//var qta=document.getElementById('qtaDaRiordinare');
|
||||
/*
|
||||
if (clifor.value == "0" || clifor.value == "") {
|
||||
alert("ERRORE! Intestazione documento figlio non valida!");
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (id_tipoDocumentoFiglio.value == 0) {
|
||||
alert("Attenzione! Scegliere documento figlio!");
|
||||
} else
|
||||
if (confirm("Verrà creato un Documento figlio. Sei Sicuro")) {
|
||||
$('#modalDocFiglio').modal('hide');
|
||||
setTimeout(function () {
|
||||
{
|
||||
f.id_cliforR.value = clifor.value;
|
||||
f.qtaR.value = 1;
|
||||
f.id_documentoR.value = l_id_documento;
|
||||
f.id_tipoDocumentoF.value = id_tipoDocumentoFiglio.value;
|
||||
f.flgTipoGenerazione.value = l_flgTipoGenerazione;
|
||||
//alert(f.flgTipoGenerazione.value);
|
||||
f.cmd.value = "creaDocFigli";
|
||||
f.act.value = "";
|
||||
//alert('pio'+f.cmd.value+" xx");
|
||||
//f.cmd.value="md";
|
||||
//f.act.value="refreshRivalutazione";
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
//f.submit();
|
||||
|
||||
}
|
||||
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
// chiamata dalla combo di creaDocFiglio da dettaglio
|
||||
/////////////////////////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
function refreshDocFigli() {
|
||||
var f = document.modalForm;
|
||||
var fornitoreDiv = document.getElementById('fornitore');
|
||||
var clienteDiv = document.getElementById('cliente');
|
||||
if ($("#id_tipoDocumentoScelta").val() == "") {
|
||||
clienteDiv.style.display = "none";
|
||||
fornitoreDiv.style.display = "none";
|
||||
} else {
|
||||
var l_flgClienteFornitore = $("#docGenType_" + $("#id_tipoDocumentoScelta").val()).val();
|
||||
//alert("refresh"+l_flgClienteFornitore);
|
||||
if (l_flgClienteFornitore == "F") {
|
||||
clienteDiv.style.display = "none";
|
||||
fornitoreDiv.style.display = "block";
|
||||
} else
|
||||
if (l_flgClienteFornitore == "C") {
|
||||
clienteDiv.style.display = "block";
|
||||
fornitoreDiv.style.display = "none";
|
||||
} else {
|
||||
clienteDiv.style.display = "none";
|
||||
fornitoreDiv.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// EFFETTUA IL SALVATAGGIO IN EMESSO E QUINDI
|
||||
// LA STAMPA DEL DOCUMENTO ????
|
||||
/////////////////////////////////////////////
|
||||
function salvaEstampaEmesso() {
|
||||
var f = document.main;
|
||||
if (f.flgStato.value == "1" || (f.flgStato.value == "0" && confirm("Il documento verrà messo in stato EMESSO e stampato. Vuoi Continuare?"))) {
|
||||
if (checkFields()) {
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
f.action = f.actionPage.value;
|
||||
f.act.value = "save";
|
||||
f.cmd.value = "asq";
|
||||
f.flgStato.value = "1";
|
||||
f.prtCommand.value = "1";
|
||||
f.submit();
|
||||
//Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// COMANDO LANCIATO DOPO IL SALVA E STAMPA EMESSO
|
||||
// AL RITORNO SULLA PAGINA...
|
||||
/////////////////////////////////////////////
|
||||
function printCommandAS() {
|
||||
//stampa solo se lanciato dopo il salvataggio (after save)
|
||||
//tramite il campo prtCommand
|
||||
var f = document.main;
|
||||
//alert( f.prtCommand.value);
|
||||
if (f.prtCommand.value != 0) {
|
||||
f.prtCommand.value = 0;
|
||||
printCommand();
|
||||
}
|
||||
}
|
||||
2757
rus/admin/contab/_js/ab-documento.js
Normal file
2757
rus/admin/contab/_js/ab-documento.js
Normal file
File diff suppressed because it is too large
Load diff
1420
rus/admin/contab/_js/ab-documento23072013.js
Normal file
1420
rus/admin/contab/_js/ab-documento23072013.js
Normal file
File diff suppressed because it is too large
Load diff
21
rus/admin/contab/_js/ab-documentoCash.js
Normal file
21
rus/admin/contab/_js/ab-documentoCash.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//funzione per aprire div con id operatore
|
||||
$(function() {
|
||||
|
||||
/////////////////////
|
||||
$( "#creaDocumento" ).dialog({
|
||||
autoOpen: false,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100
|
||||
},
|
||||
width: 500
|
||||
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#creaDocumento" ).dialog("option", "title", "Crea Documento");
|
||||
/////////////////////////////////////////////
|
||||
|
||||
});
|
||||
149
rus/admin/contab/_js/ab-documentoCoave.js
Normal file
149
rus/admin/contab/_js/ab-documentoCoave.js
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
/************************************************/
|
||||
/************************************************/
|
||||
/* salva documento con popup data */
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function saveCommandDoc() {
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
if (checkFields()) {
|
||||
if (f.flgStatoPrec.value == 2 && f.flgStato.value == 1) {
|
||||
$("#dataDocumentoDialog").modal("show");
|
||||
|
||||
} else {
|
||||
formSaveCommand();
|
||||
//f.submit();
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function salvaDataEdEmetti() {
|
||||
$("#dataDocumentoDialog").modal("hide");
|
||||
setTimeout(function () {
|
||||
$("#dataDocumento").val($("#dataDocumentoD").val());
|
||||
formSaveCommand();
|
||||
//f.submit();
|
||||
Ab.submitAj('main');
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
//stacca servizio e lo rende fatturabile nuovament
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function staccaServizio(id_rigaDocumento) {
|
||||
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
|
||||
if (confirm("Verra' dissociato il servizio alla fattura. Il servizio sara' poi nuovamente fatturabile. Vuoi continuare?")) {
|
||||
//Ab.popUp("ELAB_SC");
|
||||
f.cmd.value = "dissociaServizio";
|
||||
f.id_rigaDocumento.value = id_rigaDocumento;
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
//salva il solo dato della banca in cui anticipo
|
||||
//perché devo salvare anche quando la fattura è stampata
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function salvaAnticipo() {
|
||||
|
||||
Ab.fetch("../contab/Documento.abl", "cmd=aggiornaBancaAnticipo&id_documento=" + $("#id_documento").val() + "&id_bancaAnticipo=" + $("#id_bancaAnticipo").val(), "messaggi");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
//allinea da fattura a servizi
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function allineaServiziDaProforma() {
|
||||
var f = document.main;
|
||||
|
||||
if (confirm('Vuoi aggiornare i servizi dal dettaglio della fattura?')) {
|
||||
f.cmd.value = "allineaServiziDaProforma";
|
||||
f.act.value = "";
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
//allinea da fattura a servizi
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function allineaProformaConPrezziServizi() {
|
||||
var f = document.main;
|
||||
|
||||
if (confirm('Vuoi aggiornare i servizi dal dettaglio della fattura?')) {
|
||||
f.cmd.value = "allineaProformaConPrezziServizi";
|
||||
f.act.value = "";
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
//sul campio da bozza a proforma a fattura
|
||||
//azzero numero
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function onChangeFlgStato() {
|
||||
$("#progDocumento").val("");
|
||||
$("#progDocumentoAgg").val("");
|
||||
$("#id_esercizio").val("");
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//allinea da servizi a fattura
|
||||
//
|
||||
|
||||
function refreshDocumento() {
|
||||
|
||||
var l_flgPagamentoDataFissa = prendiElementoDaId("flgPagamentoDataFissa");
|
||||
var l_tipoPagamento = prendiElementoDaId("id_tipoPagamento");
|
||||
var l_dataScadenzaPagamento = prendiElementoDaId("dataScadenzaPagamento");
|
||||
var l_dataScadenzaPagamentoDP = prendiElementoDaId("dataScadenzaPagamentoDP");
|
||||
|
||||
var f = document.main;
|
||||
if (l_flgPagamentoDataFissa.value > 0) {
|
||||
l_tipoPagamento.disabled = "disabled";
|
||||
l_tipoPagamento.value = "";
|
||||
l_dataScadenzaPagamento.disabled = "";
|
||||
l_dataScadenzaPagamentoDP.style.display = "inline";
|
||||
|
||||
} else {
|
||||
l_tipoPagamento.disabled = "";
|
||||
l_dataScadenzaPagamento.value = "";
|
||||
l_dataScadenzaPagamento.disabled = "disabled";
|
||||
l_dataScadenzaPagamentoDP.style.display = "none";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
// vai al servizio corrispondente della riga
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function apriServizio(id) {
|
||||
//fetch(servlet, command, divList, postProcess, async, type)
|
||||
Ab.fetch("../serv/ServizioStd.abl", "cmd=md", "", "id_servizio=" + id);
|
||||
|
||||
}
|
||||
167
rus/admin/contab/_js/ab-documentoFilato.js
Normal file
167
rus/admin/contab/_js/ab-documentoFilato.js
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaFilato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//prima cosa salvo le quantità sui campi hidden
|
||||
//alert('pio');
|
||||
//1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
//checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
Ab.aggiustaInputText(f.descrizioneRiga);
|
||||
Ab.aggiustaInputText(f.notaRigaDocumento);
|
||||
if (document.getElementById('notaBarcode') )
|
||||
Ab.aggiustaInputText(f.notaBarcode);
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//FILATO SOLO KG!!!!!!!
|
||||
|
||||
|
||||
$("#quantita").val($("#kgF").val());
|
||||
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if(f.flgClienteFornitore.value=="F")
|
||||
cf= checkFilatoF();
|
||||
else if(f.flgClienteFornitore.value=="C")
|
||||
cf=checkFilatoC();
|
||||
else if(f.flgClienteFornitore.value=="A")
|
||||
cf=checkFilatoA();
|
||||
else {
|
||||
cf=false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf)
|
||||
{
|
||||
f.cmd.value="addRigaFilato";
|
||||
//f.act.value="addRigaFilato";
|
||||
$("#currentFocus").val("searchArticolo");
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
//Ab.popUp("ELAB");
|
||||
// Ab.submitAj('main');
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a fornitori*/
|
||||
function checkFilatoF()
|
||||
{
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Lotto','R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if(f.imponibile.value=="0,00" || f.imponibile.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('imponibile').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
|
||||
var checkMag=true;
|
||||
if($("#magPartenzaDaScegliere").val()=="true")
|
||||
{
|
||||
checkMag=Ab.validateForm('id_magFisicoPartenza','Magazzino Partenza','RisNumKey');
|
||||
}
|
||||
|
||||
if(checkMag){
|
||||
if($("#magArrivoDaScegliere").val()=="true")
|
||||
{
|
||||
checkMag=Ab.validateForm('id_magFisicoArrivo','Magazzino Arrivo','RisNumKey');
|
||||
}
|
||||
}
|
||||
if(checkMag){
|
||||
|
||||
return Ab.validateForm('id_clifor','Fornitore','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkFilatoC()
|
||||
{
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 obbligatorio flgEmettiFatturaScontrino
|
||||
//s09-02-2010 viene chamato da add riga... non controllo id_clilfor2
|
||||
// if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && //Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','R','descrizioneRiga','Articolo','R','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???*/
|
||||
function checkFilatoA()
|
||||
{
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','id_articolo','Articolo','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// onFocusDescRiga
|
||||
// determina che succede quando arriva il focus su descriga
|
||||
// deve andare sulla qta giusta. Si attiva dopo il CR
|
||||
////////////////////////////////////
|
||||
function onFocusDescRigaFilato()
|
||||
{
|
||||
//checkBoxes();
|
||||
/* if(Ab.prendiElementoDaId("id_articoloFilatoColore").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
//se non bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
//dovrei verificare getTipoCaricoScarico=0-- anagrafiche chiedo seriale tipoCaricoScarico==0
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
$("#descrizioneRiga").select();
|
||||
//Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
//beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
50
rus/admin/contab/_js/ab-documentoListaPre.js
Normal file
50
rus/admin/contab/_js/ab-documentoListaPre.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//caso maschere di ricerca
|
||||
function prevPagePreno()
|
||||
{
|
||||
|
||||
var f = document.ricerca;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="listaPrenotazioni";
|
||||
f.pageNumber.value=parseInt(f.pageNumber.value)-1;
|
||||
Ab.submitAj('ricerca', f.cmd.value, 'jQueryWIN');
|
||||
}
|
||||
|
||||
function nextPagePreno()
|
||||
{
|
||||
var f = document.ricerca;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="listaPrenotazioni";
|
||||
f.pageNumber.value=parseInt(f.pageNumber.value)+1;
|
||||
Ab.submitAj('ricerca', f.cmd.value, 'jQueryWIN');
|
||||
}
|
||||
|
||||
function goPagePreno(l_pageNumber)
|
||||
{
|
||||
var f = document.ricerca;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="listaPrenotazioni";
|
||||
f.pageNumber.value=l_pageNumber;
|
||||
Ab.submitAj('ricerca', f.cmd.value, 'jQueryWIN');
|
||||
}
|
||||
|
||||
function loadAsyncMag(id)
|
||||
{
|
||||
var f = document.ricerca;
|
||||
Ab.fetch("Documento.abl", "cmd=loadPrenotazioniMagazzino&id_rigaDocumento="+id, "mag-"+id, null, true);
|
||||
}
|
||||
|
||||
function formSearchingPrenotazione()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.ricerca;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="listaPrenotazioni";
|
||||
f.pageNumber.value=1;
|
||||
}
|
||||
function searchingPrenotazione()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.ricerca;
|
||||
formSearchingPrenotazione();
|
||||
Ab.submitAj('ricerca', 'listaPrenotazioni', 'jQueryWIN');
|
||||
}
|
||||
445
rus/admin/contab/_js/ab-documentoPagamento.js
Normal file
445
rus/admin/contab/_js/ab-documentoPagamento.js
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
/*** ab-documentoPagmaneto lte *
|
||||
/* 4.0 */
|
||||
|
||||
$(function() {
|
||||
$( "#dettaglioWin" ).dialog({
|
||||
autoOpen: false,
|
||||
width: 800,
|
||||
height: 300,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#dettaglioWin" ).dialog("option", "title", "Dettaglio Articolo Varianti");
|
||||
});
|
||||
|
||||
/*********************************************/
|
||||
/*********************************************/
|
||||
/*********************************************/
|
||||
function reportx()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFieldsIns()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
return Ab.validateForm('importo', 'Importo', 'RisNum>0', 'data', 'Data', 'R', 'id_tipoPagamento', 'Tipo Pagamento', 'RisNum>0');
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
var saldo = parseFloat($("#saldo").val()),
|
||||
importo = parseFloat($("#importo").val());
|
||||
|
||||
if (saldo < importo) {
|
||||
alert("Importo superiore al totale fattura!");
|
||||
|
||||
$("#importo").focus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return checkFieldsIns();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("dettaglio","flgSommaCRL","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRow()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('id_rowBean','RowBean','R'))
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRow";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function creaCMByFile()
|
||||
{
|
||||
var f = document.main;
|
||||
if(f.id_templateMsg.value!="" && f.nomeFile.value!="")
|
||||
{
|
||||
if (confirm("Verrà creata una nuova coda di messaggi in base al template e al file di indirizzi email selezionato. Sei Sicuro?"))
|
||||
{
|
||||
//Ab.popUp("ELAB");
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="creaCodaMsg";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
else
|
||||
alert('Template non valido o file non selezionato!');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoTemplateMsg.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
// funzione richiamata sul document ready
|
||||
// in modo da averne uno solo
|
||||
///////////////////////////////
|
||||
function documentReadyScript()
|
||||
{
|
||||
loadListInit();
|
||||
}
|
||||
|
||||
|
||||
function loadListInit()
|
||||
{
|
||||
var id_clifor = $("#id_clifor").val();
|
||||
|
||||
if (id_clifor != 0)
|
||||
{
|
||||
var url = $("#actionPage").val(),
|
||||
cmd = "cmd=loadLista&id_clifor="+id_clifor;
|
||||
|
||||
fetch(url, cmd, "lista");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function loadList()
|
||||
{
|
||||
loadListInit();
|
||||
$("#data").focus();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* su documentoPagmentoList */
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function selezionaTutto() {
|
||||
//var valore = $("#ckflgSelezionaTutto").attr("checked")=="checked"?true:false;
|
||||
var valore=$("#flgSelezionaTutto").val();
|
||||
//alert(valore);
|
||||
//alert($("#ckflgServizio_6111").val());
|
||||
$("input[id^='ckflgServizio_']").each(function(index, element) {
|
||||
var id = $(element).attr("name").replace("ckflgServizio_", "");
|
||||
element.checked = valore==0?false:true;
|
||||
$("#flgServizio_"+id).val(valore);
|
||||
selezionaCheck($(element));
|
||||
});
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
//documentoPagamentoList
|
||||
//cosa accade se premo ul check alla sx del servizio
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function selezionaCheck(that) {
|
||||
var id = $(that).attr("name").replace("ckflgServizio_", "");
|
||||
//alert("id:"+id+" "+$("#flgServizio_"+id).val());
|
||||
//il flg è inverso su click perché viene settato dopo...., diretto su onchange
|
||||
//da verificare su tutti i browser
|
||||
if ($(that).attr("checked")|| $("#flgServizio_"+id).val()==1)
|
||||
{
|
||||
var saldo = parseFloat($("#saldo_"+id).val().replace(".", "").replace(",", ".")),
|
||||
residuo = parseFloat($("#importoResiduo").val().replace(".", "").replace(",", ".")),
|
||||
importo = 0;
|
||||
|
||||
|
||||
if (saldo > residuo)
|
||||
importo = residuo;
|
||||
else
|
||||
importo = saldo;
|
||||
|
||||
|
||||
$("#importo_"+id).val(importo.toString().replace(".",","));
|
||||
$("#importo_"+id).show();
|
||||
$("#ckflgTipoIncasso_"+id).show();
|
||||
$("#importo_"+id).focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$("#importo_"+id).hide();
|
||||
$("#ckflgTipoIncasso_"+id).hide();
|
||||
$("#importo_"+id).val("0");
|
||||
}
|
||||
calcolaResidui($("#importo_"+id));
|
||||
}
|
||||
|
||||
function impostaResiduo()
|
||||
{
|
||||
temp=$("#importo").val();
|
||||
$("#importoResiduo").val(temp.replace(/[.]/,''));
|
||||
}
|
||||
|
||||
function calcolaResidui(that)
|
||||
{
|
||||
var importoTot = parseFloat($("#importo").val().replace(",", ".")),
|
||||
importoResiduo = parseFloat($("#importoResiduo").val().replace(",", ".")),
|
||||
importoLista = 0,
|
||||
importoRigo = parseFloat($(that).val().replace(".", "").replace(",", "."));
|
||||
saldoRigo = parseFloat($(that).siblings("input[name^='saldo_']").val().replace(".", "").replace(",", "."));
|
||||
|
||||
if (importoRigo > (importoResiduo + importoRigo))
|
||||
{
|
||||
alert("Importo maggiore dell'importo residuo! Importo immesso: " + importoRigo + " Importo residuo: " + importoResiduo);
|
||||
$(that).val(0);
|
||||
//$(that).focus();
|
||||
}
|
||||
else if (importoRigo > saldoRigo)
|
||||
{
|
||||
alert("Importo maggiore dell'importo del documento! Importo immesso: " + importoRigo + " Importo documento: " + saldoRigo);
|
||||
$(that).val(0);
|
||||
//$(that).focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("input[id^='importo_']").each(function(index, element) {
|
||||
var importoEach = $(element).val().replace(".", ""). replace(",", ".");
|
||||
if (importoEach.trim() == "")
|
||||
importoEach = 0;
|
||||
|
||||
importoLista += parseFloat(importoEach);
|
||||
});
|
||||
|
||||
|
||||
var importoResiduoCalcolato = parseFloat(importoTot-importoLista).toFixed(2);
|
||||
|
||||
$("#importoResiduo").val(importoResiduoCalcolato.toString().replace(".",","));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// sottometto la lista delle fatture con l'importo e lo stato saldo o acconto
|
||||
////////////////////////////////////////////////
|
||||
function savePagamenti()
|
||||
{
|
||||
if (checkFieldsIns())
|
||||
{
|
||||
var importoResiduo = $("#importoResiduo").val()
|
||||
|
||||
if (parseFloat(importoResiduo) > 0) {
|
||||
alert("Distribuire tutti gli importi nei documenti!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (confirm("Vuoi salvare i pagamenti?"))
|
||||
{
|
||||
var listaDocumenti = "";
|
||||
$("input[id^='ckflgServizio_']:checked").each(function(index, element) {
|
||||
var id = $(element).attr("name").replace("ckflgServizio_", ""),
|
||||
importo = $("#importo_" + id).val().replace(",","."),
|
||||
stato = $("#ckflgTipoIncasso_" + id).prop("checked")==true?1:0;
|
||||
|
||||
listaDocumenti += id + "," + importo+ "," + stato + "|";
|
||||
});
|
||||
$("#listaDocumenti").val(listaDocumenti);
|
||||
//alert(listaDocumenti);
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="savePagamenti";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* NUOVO PAGAMENTO DA PAGAMENTOCR*/
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function nuovoPagamento()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="ni";
|
||||
f.act.value="Ins";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
// navigazione verso documento (estratto conto)
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
|
||||
function loadDocument(id)
|
||||
{
|
||||
|
||||
//Ab.callAbl('/admin/contab/DocumentoPagamento','body','search&id_clifor='+$('#id_clifor').val());
|
||||
Ab.callAbl('../contab/Documento','','','cmd=md&id_documento='+id+'¤tTab=%23PAG')
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
//navigazione verso cliente (pagamento)
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function loadCliente()
|
||||
{
|
||||
Ab.callAbl('../anag/Cliente','','','cmd=md&id_clifor='+$("#id_clifor").val()+'¤tTab=%23EST')
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
//navicazione verso cliente
|
||||
//////////////////////////////////
|
||||
function loadCliente2(id)
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action="../anag/Cliente.abl";
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="md";
|
||||
f.act.value="";
|
||||
f.id_clifor.value=id;
|
||||
f.currentTab.value="#EST";
|
||||
Ab.submitAj('main');
|
||||
|
||||
//Ab.callAbl('/admin/anag/Cliente','md&id_clifor='+id+"¤tTab=%23FATTURE")
|
||||
}
|
||||
|
||||
function printReport()
|
||||
{
|
||||
var f = document.main;
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
theAction=f.actionPage.value+"?cmd=printReport";
|
||||
|
||||
//&id_clifor="+f.id_clifor.value+"&dataDa="+f.dataDa.value+"&dataA="+f.dataA.value+"&flgTipoSaldo="+f.flgTipoSaldo.value+"&id_tipoPagamento="+f.id_tipoPagamento.value+"&riferimento="+f.riferimento.value+"&id_tipoDocumento="+f.id_tipoDocumento.value+"&numeroFattura="+f.numeroFattura.value+"&annoFattura="+f.annoFattura.value+"&dataFatturaDa="+f.dataFatturaDa.value+"&dataFatturaA="+f.dataFatturaA.value+"&flgClienteFornitore="+f.flgClienteFornitore.value;
|
||||
|
||||
//
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
913
rus/admin/contab/_js/ab-documentoPre.js
Normal file
913
rus/admin/contab/_js/ab-documentoPre.js
Normal file
|
|
@ -0,0 +1,913 @@
|
|||
//
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function reportPdf()
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
var f = document.main;
|
||||
checkBoxesCR();
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=report&flgTipoReport="+f.flgTipoReport.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
//alert(theAction.length);
|
||||
//alert(theAction);
|
||||
if(f.flgTipoReport.value==8){
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;
|
||||
|
||||
}
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report_","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
//if(f.nominativoDocumento.value!="")
|
||||
//f.id_clifor.value=1;
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','id_users','Operatore','RisNumKey','cellDocumento','Cellulare avviso','R');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
var l_id_tipoDocumento=Ab.prendiElementoDaId('id_tipoDocumento').value;
|
||||
//
|
||||
if(l_id_tipoDocumento!=1)
|
||||
Ab.setChekBoxValue("dettaglio","flgMantieniArticoloRiga","1","0");
|
||||
Ab.setChekBoxValue("dettaglio","flgAutoAdd","1","0");
|
||||
Ab.setChekBoxValue("dettaglio","flgSingleLineArt","1","0");
|
||||
//if(l_id_tipoDocumento==1)
|
||||
// Ab.setChekBoxValue("dettaglio","flgEmettiFatturaScontrino","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaArticolo()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
// 1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
var l_descrizioneRiga=Ab.prendiElementoDaId("descrizioneRiga");
|
||||
l_descrizioneRiga.value=l_descrizioneRiga.value.replace(/€/ig,"€");
|
||||
|
||||
//alert(f.currentTab.value);
|
||||
if(f.flgTipologia.value==4)
|
||||
{
|
||||
|
||||
cf= checkCPrenotazione();
|
||||
}
|
||||
else{
|
||||
if(f.flgClienteFornitore.value=="F")
|
||||
cf= checkF();
|
||||
else if(f.flgClienteFornitore.value=="C")
|
||||
cf=checkC();
|
||||
else if(f.flgClienteFornitore.value=="A")
|
||||
cf=checkA();
|
||||
else {
|
||||
cf=false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
}
|
||||
|
||||
if (cf)
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRigaArticolo";
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.popUp("ELAB");
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkF()
|
||||
{//alert('f');
|
||||
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if(f.imponibile.value=="0,00" || f.imponibile.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('imponibile').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
return Ab.validateForm('id_clifor','Fornitore','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
}
|
||||
|
||||
function checkC()
|
||||
{//alert('C');
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 è obbligatorio flgEmettiFatturaScontrino
|
||||
if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','descrizioneRiga','Articolo','R','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
else
|
||||
return false;
|
||||
}
|
||||
function checkCPrenotazione()
|
||||
{//alert('C');
|
||||
|
||||
var f = document.main;
|
||||
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','quantita','quantita','RisNum>0','id_users','Operatore','RisNumKey','cellDocumento','Cellulare avviso','R');
|
||||
|
||||
}
|
||||
function checkA()
|
||||
{
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','id_articolo','Articolo','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
function delRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
function cambiaFocus()
|
||||
{
|
||||
var f = document.main;
|
||||
var l_id_tipoDocumento=Ab.prendiElementoDaId('id_tipoDocumento').value;
|
||||
var l_id_clifor=Ab.prendiElementoDaId('id_clifor').value;
|
||||
checkBoxes();
|
||||
if(l_id_tipoDocumento==1 ||l_id_clifor>0 )
|
||||
{
|
||||
if(f.flgMantieniArticoloRiga.value==1 && f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
}
|
||||
else
|
||||
{
|
||||
if(f.currentTab.value=="RIGHE")
|
||||
{
|
||||
if(f.flgMantieniArticoloRiga.value==1 && f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Ab.setFocus('nominativoDocumento')
|
||||
|
||||
}
|
||||
}
|
||||
//alert('pio');
|
||||
}
|
||||
function beep()
|
||||
{
|
||||
var theBeep;
|
||||
if (ns4 || mz7){
|
||||
|
||||
var theIdStyle = document.getElementById('seriale').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
theBeep=Ab.prendiElementoDaId('beep');
|
||||
theBeep.src='../../_sounds/left.wav';
|
||||
}
|
||||
|
||||
//document.all.beep.src='../../_sounds/left.wav';
|
||||
|
||||
}
|
||||
|
||||
function descRigaKeyUp(theEvent)
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
focusNextOnCr(theEvent,'seriale');
|
||||
beep();
|
||||
}
|
||||
else
|
||||
focusNextOnCr(theEvent,'quantita') ;
|
||||
}
|
||||
|
||||
function saveConferma()
|
||||
{
|
||||
|
||||
var f= document.main;
|
||||
f.flgStato.value=1;
|
||||
saveCommand();
|
||||
}
|
||||
|
||||
function ricalcolaMag()
|
||||
{
|
||||
if(confirm("Verrà ricalcolato tutto il magazzino. Sei Sicuro?"))
|
||||
{
|
||||
var f= document.main;
|
||||
f.cmd.value="ricalcolaMag";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onFocusSeriale()
|
||||
{//alert('ofs');
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('seriale').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
checkBoxes();
|
||||
if(Ab.prendiElementoDaId('seriale').value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onFocusDescRiga()
|
||||
{//alert('ofds');
|
||||
checkBoxes();
|
||||
if(Ab.prendiElementoDaId("id_articolo").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyUpSeriale(theEvent)
|
||||
{
|
||||
var keyCode = theEvent.keyCode;
|
||||
if(keyCode==13)
|
||||
{
|
||||
checkBoxes();
|
||||
if(Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function labelD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Documento_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function labelCR()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verranno stampate le etichette di tutti i documenti relativi al criteri di ricerca selezionato. Sei sicuro?"))
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt&progDocumento="+f.progDocumento.value+"&id_esercizio="+f.id_esercizio.value+"&id_tipoDocumento="+f.id_tipoDocumento.value+"&id_clifor="+f.id_clifor.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare per articolo","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function emettiFatturaClick()
|
||||
{alert('old');
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino==1)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function emettiDocumentoChange()
|
||||
{
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino>0)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ristampaScontrino()
|
||||
{ checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else
|
||||
if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="ristampaScontrino";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="stampaScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
function chiudiScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
//if(f.totDocumento.value=="0,00")
|
||||
// alert("ATTENZIONE! Scontrino a valore zero");
|
||||
//else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi chiudere lo scontrino');
|
||||
else if(confirm("Lo scontrino verrà chiuso. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="chiudiScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function generaDocumento()
|
||||
{
|
||||
if(confirm("Verrà generato il documento relativo. Sei sicuro?"))
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
f.cmd.value="generaDocumento";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_documento.value);
|
||||
}
|
||||
|
||||
function stampaDocumento(id)
|
||||
{
|
||||
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
if(f.flgTipoStampa.value==10)
|
||||
{
|
||||
f.cmd.value="print";
|
||||
f.act.value="doc";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
else
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=doc"+"&id_documento="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Fattura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function prelevaArticolo(id)
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="prelevaArticolo";
|
||||
f.id_rigaDocumentoDaPrelevare.value=id;
|
||||
var qdp=document.getElementById('qtaDaPrelevare_'+id);
|
||||
var qdpMax=document.getElementById('qtaDaPrelevareMax_'+id);
|
||||
if(qdp.value>qdpMax.value)
|
||||
alert("ERRORE! Non puoi prelevare piu' di quanto hai caricato");
|
||||
else if (qdp.value<=0)
|
||||
alert("ERRORE! Quantita' non valida!")
|
||||
else
|
||||
{
|
||||
f.qtaDaPrelevare.value=qdp.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delArticoloPrelevato(id_rd, id_rdP)
|
||||
{
|
||||
if(confirm("Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delPrelevaArticolo";
|
||||
f.id_rigaDocumento.value=id_rd;
|
||||
f.id_rigaDocumentoPrelevata.value=id_rdP;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function impostaRigaChiusa(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà chiusa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="chiudiRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
function impostaRigaAperta(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà aperta nuovamente. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="apriRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function filtraRighe()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.pageNumber_righe.value=1;
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
function mailCommand()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare il documento via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mailCommandCR()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare i documenti selezionati via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function documentoPagato(id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
// if( Ab.validateForm2('main','dataFatturazione','Data Fatturazione','R'))
|
||||
{
|
||||
if(confirm("Vuoi rendere il documento pagato?"))
|
||||
|
||||
{ checkRadioCR();
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="docPagato";
|
||||
//f.act.value="view";
|
||||
f.id_documento.value=id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function refreshIvaByreparto()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
var l_id_iva=Ab.prendiElementoDaId('id_reparto_'+f.id_reparto.value).value;
|
||||
f.id_iva.value=l_id_iva;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function labelAccD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArtAcc"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Accessori_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function refreshStatoPrenotazione(id)
|
||||
{
|
||||
if(confirm("Attenzione! Stai cambiando lo stato della prenotazione. Sei Sicuro?"))
|
||||
{
|
||||
var nuovoStato=Ab.prendiElementoDaId("flgStatoPrenotazione_"+id).value;
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.flgStatoPrenotazioneS.value=nuovoStato;
|
||||
f.id_documento.value=id;
|
||||
f.cmd.value="aggionraSPCR";
|
||||
f.flgReport.value="";
|
||||
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
function refreshStatoRiparazione(id)
|
||||
{
|
||||
if(confirm("Attenzione! Stai cambiando lo stato della riparazione. Sei Sicuro?"))
|
||||
{
|
||||
var nuovoStato=Ab.prendiElementoDaId("flgStatoRiparazione_"+id).value;
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.flgStatoRiparazioneS.value=nuovoStato;
|
||||
f.id_documento.value=id;
|
||||
f.cmd.value="aggionraSRCR";
|
||||
f.flgReport.value="";
|
||||
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function inviaAvviso(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
if(confirm("Verrà inviato un avviso e impostato lo stato ad INVIATO. Vuoi continuare?"))
|
||||
{
|
||||
|
||||
f.id_documento.value=l_id;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="inviaAvviso";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function stampaSlip()
|
||||
{
|
||||
var f = document.main;
|
||||
Ab.setChekBoxValue("ricerca","flgSimulazione","1","0");
|
||||
|
||||
if(f.flgSimulazione.value=="1" ||(f.flgSimulazione.value=="0" && confirm("Simulazione non attivata. Vuoi Continuare?")))
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=slip&flgSimulazione="+f.flgSimulazione.value+"&progDocumento="+f.progDocumento.value+"&id_esercizio="+f.id_esercizio.value+"&id_tipoDocumento="+f.id_tipoDocumento.value+"&id_clifor="+f.id_clifor.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value+"&id_articolo="+f.id_articolo.value+"&id_articoloVariante="+f.id_articoloVariante.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Slip","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function annullaAssegnazionePrenotazione(id)
|
||||
{
|
||||
if(confirm("La prenotazione risulterà nuovamente ancora in arrivo. Vuoi Continuare?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
//alert(f.action);
|
||||
f.cmd.value="annAssPren";
|
||||
f.act.value="";
|
||||
f.id_rigaDocumento.value=id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function annullaSlip(id)
|
||||
{
|
||||
if(confirm("La slip potrà essere stampata nuovamente. Vuoi continuare?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
//alert(f.action);
|
||||
f.cmd.value="annullaSlip";
|
||||
f.act.value="";
|
||||
f.id_rigaDocumento.value=id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoDocumento.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
1943
rus/admin/contab/_js/ab-documentoRic.js
Normal file
1943
rus/admin/contab/_js/ab-documentoRic.js
Normal file
File diff suppressed because it is too large
Load diff
988
rus/admin/contab/_js/ab-documentoRip - Copia.js
Normal file
988
rus/admin/contab/_js/ab-documentoRip - Copia.js
Normal file
|
|
@ -0,0 +1,988 @@
|
|||
|
||||
function formSearching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="";
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="search";
|
||||
f.pageNumber.value=1;
|
||||
//f.submit();
|
||||
}
|
||||
function searching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
formSearching();
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function reportPdf()
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
var f = document.main;
|
||||
checkBoxesCR();
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=report&flgTipoReport="+f.flgTipoReport.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
//alert(theAction.length);
|
||||
//alert(theAction);
|
||||
if(f.flgTipoReport.value==8){
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;
|
||||
|
||||
}
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report_","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function modifyCommand(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
//f.act.value="view";
|
||||
f.id_documento.value=id;
|
||||
|
||||
f.submit();
|
||||
}
|
||||
|
||||
|
||||
function deleteCommandCR(id,l_tmst)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="delCR";
|
||||
f.cmd.value="asq";
|
||||
f.lastUpdTmst.value=l_tmst;
|
||||
f.id_documento.value=id;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function deleteCommandCR(id)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
f.id_documento.value=id;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
function deleteCommand()
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
function refresh()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.act.value="refresh";
|
||||
//f.currentTab.value="";
|
||||
f.submit();
|
||||
}
|
||||
function saveCommand()
|
||||
{
|
||||
//alert('pio');
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
|
||||
formSaveCommand();
|
||||
Ab.submitAj('main');
|
||||
//f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formSaveCommand()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="save";
|
||||
f.cmd.value="asq";
|
||||
f.prtCommand.value="0";
|
||||
|
||||
//f.flgCaricaArticoli.value=0;
|
||||
//updateRTEs();
|
||||
//WYSIWYG.updateTextAreaAll();
|
||||
}
|
||||
}
|
||||
function newCommand()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="ni";
|
||||
// f.id_userProfile.value=tipoUser;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function newCommandPD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if((f.id_tipoDocumento.value!=1 || f.totDocumento.value!="0,00") && confirm("Nuovo Record. Vuoi salvare il record corrente?"))
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="asq";
|
||||
f.act.value="ni";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="ni";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
//if(f.nominativoDocumento.value!="")
|
||||
//f.id_clifor.value=1;
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','id_users','Operatore','RisNumKey',
|
||||
'descrizioneRiga', 'Articolo', 'R');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaArticolo()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
// 1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
var l_descrizioneRiga=Ab.prendiElementoDaId("descrizioneRiga");
|
||||
l_descrizioneRiga.value=l_descrizioneRiga.value.replace(/€/ig,"€");
|
||||
|
||||
//alert(f.currentTab.value);
|
||||
if(f.flgTipologia.value==4)
|
||||
{
|
||||
|
||||
cf= checkCPrenotazione();
|
||||
}
|
||||
else{
|
||||
if(f.flgClienteFornitore.value=="F")
|
||||
cf= checkF();
|
||||
else if(f.flgClienteFornitore.value=="C")
|
||||
cf=checkC();
|
||||
else if(f.flgClienteFornitore.value=="A")
|
||||
cf=checkA();
|
||||
else {
|
||||
cf=false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
}
|
||||
|
||||
if (cf)
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRigaArticolo";
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.popUp("ELAB");
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkF()
|
||||
{//alert('f');
|
||||
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if(f.imponibile.value=="0,00" || f.imponibile.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('imponibile').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
return Ab.validateForm('id_clifor','Fornitore','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
}
|
||||
|
||||
function checkC()
|
||||
{//alert('C');
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 è obbligatorio flgEmettiFatturaScontrino
|
||||
if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','descrizioneRiga','Articolo','R','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
else
|
||||
return false;
|
||||
}
|
||||
function checkCPrenotazione()
|
||||
{//alert('C');
|
||||
|
||||
var f = document.main;
|
||||
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','quantita','quantita','RisNum>0','id_users','Operatore','RisNumKey');
|
||||
|
||||
}
|
||||
function checkA()
|
||||
{
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','id_articolo','Articolo','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
function delRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
|
||||
}
|
||||
|
||||
function cambiaFocus()
|
||||
{
|
||||
var f = document.main;
|
||||
var l_id_tipoDocumento=Ab.prendiElementoDaId('id_tipoDocumento').value;
|
||||
var l_id_clifor=Ab.prendiElementoDaId('id_clifor').value;
|
||||
checkBoxes();
|
||||
if(l_id_tipoDocumento==1 ||l_id_clifor>0 )
|
||||
{
|
||||
if( f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
}
|
||||
else
|
||||
{
|
||||
if(f.currentTab.value=="RIGHE")
|
||||
{
|
||||
if(f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Ab.setFocus('nominativoDocumento')
|
||||
|
||||
}
|
||||
}
|
||||
//alert('pio');
|
||||
}
|
||||
function beep()
|
||||
{
|
||||
var theBeep;
|
||||
if (ns4 || mz7){
|
||||
|
||||
var theIdStyle = document.getElementById('seriale').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
theBeep=Ab.prendiElementoDaId('beep');
|
||||
theBeep.src='../../_sounds/left.wav';
|
||||
}
|
||||
|
||||
//document.all.beep.src='../../_sounds/left.wav';
|
||||
|
||||
}
|
||||
|
||||
function descRigaKeyUp(theEvent)
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
focusNextOnCr(theEvent,'seriale');
|
||||
beep();
|
||||
}
|
||||
else
|
||||
focusNextOnCr(theEvent,'quantita') ;
|
||||
}
|
||||
|
||||
function saveConferma()
|
||||
{
|
||||
|
||||
var f= document.main;
|
||||
f.flgStato.value=1;
|
||||
saveCommand();
|
||||
}
|
||||
|
||||
function ricalcolaMag()
|
||||
{
|
||||
if(confirm("Verrà ricalcolato tutto il magazzino. Sei Sicuro?"))
|
||||
{
|
||||
var f= document.main;
|
||||
f.cmd.value="ricalcolaMag";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onFocusSeriale()
|
||||
{//alert('ofs');
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('seriale').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
// checkBoxes();
|
||||
// Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onFocusDescRiga()
|
||||
{//alert('ofds');
|
||||
checkBoxes();
|
||||
if(Ab.prendiElementoDaId("id_articolo").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyUpSeriale(theEvent)
|
||||
{
|
||||
var keyCode = theEvent.keyCode;
|
||||
if(keyCode==13)
|
||||
{
|
||||
Ab.prendiElementoDaId('notaRigaDocumento').focus() ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function labelD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Documento_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function labelCR()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verranno stampate le etichette di tutti i documenti relativi al criteri di ricerca selezionato. Sei sicuro?"))
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt"+"&progDocumento="+f.progDocumento.value+"&id_esercizio="+f.id_esercizio.value+"&id_tipoDocumento="+f.id_tipoDocumento.value+"&id_clifor="+f.id_clifor.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare per articolo","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function emettiFatturaClick()
|
||||
{alert('old');
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino==1)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function emettiDocumentoChange()
|
||||
{
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino>0)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ristampaScontrino()
|
||||
{ checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else
|
||||
if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="ristampaScontrino";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="stampaScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
function chiudiScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
//if(f.totDocumento.value=="0,00")
|
||||
// alert("ATTENZIONE! Scontrino a valore zero");
|
||||
//else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi chiudere lo scontrino');
|
||||
else if(confirm("Lo scontrino verrà chiuso. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="chiudiScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function generaDocumento()
|
||||
{
|
||||
if(confirm("Verrà generato il documento relativo. Sei sicuro?"))
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
f.cmd.value="generaDocumento";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_documento.value);
|
||||
}
|
||||
|
||||
function stampaDocumento(id)
|
||||
{
|
||||
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
if(f.flgTipoStampa.value==10)
|
||||
{
|
||||
f.cmd.value="print";
|
||||
f.act.value="doc";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=doc"+"&id_documento="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Fattura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function prelevaArticolo(id)
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="prelevaArticolo";
|
||||
f.id_rigaDocumentoDaPrelevare.value=id;
|
||||
var qdp=document.getElementById('qtaDaPrelevare_'+id);
|
||||
var qdpMax=document.getElementById('qtaDaPrelevareMax_'+id);
|
||||
if(qdp.value>qdpMax.value)
|
||||
alert("ERRORE! Non puoi prelevare piu' di quanto hai caricato");
|
||||
else if (qdp.value<=0)
|
||||
alert("ERRORE! Quantita' non valida!")
|
||||
else
|
||||
{
|
||||
f.qtaDaPrelevare.value=qdp.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delArticoloPrelevato(id_rd, id_rdP)
|
||||
{
|
||||
if(confirm("Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delPrelevaArticolo";
|
||||
f.id_rigaDocumento.value=id_rd;
|
||||
f.id_rigaDocumentoPrelevata.value=id_rdP;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function impostaRigaChiusa(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà chiusa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="chiudiRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
function impostaRigaAperta(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà aperta nuovamente. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="apriRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function filtraRighe()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.pageNumber_righe.value=1;
|
||||
f.submit();
|
||||
|
||||
}
|
||||
|
||||
function mailCommand()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare il documento via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mailCommandCR()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare i documenti selezionati via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function documentoPagato(id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
// if( Ab.validateForm2('main','dataFatturazione','Data Fatturazione','R'))
|
||||
{
|
||||
if(confirm("Vuoi rendere il documento pagato?"))
|
||||
|
||||
{ checkRadioCR();
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="docPagato";
|
||||
//f.act.value="view";
|
||||
f.id_documento.value=id;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function refreshIvaByreparto()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
var l_id_iva=Ab.prendiElementoDaId('id_reparto_'+f.id_reparto.value).value;
|
||||
f.id_iva.value=l_id_iva;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function labelAccD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArtAcc"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Accessori_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function refreshStatoRiparazione(id)
|
||||
{
|
||||
if(confirm("Attenzione! Stai cambiando lo stato della riparazione. Sei Sicuro?"))
|
||||
{
|
||||
var nuovoStato=Ab.prendiElementoDaId("flgStatoRiparazione_"+id).value;
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.flgStatoRiparazioneS.value=nuovoStato;
|
||||
f.id_documento.value=id;
|
||||
f.cmd.value="aggionraSRCR";
|
||||
f.flgReport.value="";
|
||||
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function inviaAvviso(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
if(confirm("Verrà inviato un avviso. Vuoi continuare?"))
|
||||
{
|
||||
|
||||
f.id_documento.value=l_id;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="inviaAvviso";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function vediRientri(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
modalW("Elenco rientri", "DocumentoRip.abl?cmd=vediRientri&id_rigaDocumento="+l_id, 510, 300 );
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoDocumento.value=l_id;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modifyClifor()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action="../anag/Cliente.abl";
|
||||
f.cmd.value="md";
|
||||
//f.id_clifor.value=f.id_cliforListino.value;
|
||||
f.submit();
|
||||
}
|
||||
829
rus/admin/contab/_js/ab-documentoRip.js
Normal file
829
rus/admin/contab/_js/ab-documentoRip.js
Normal file
|
|
@ -0,0 +1,829 @@
|
|||
|
||||
function reportPdf()
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
var f = document.main;
|
||||
checkBoxesCR();
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=report&flgTipoReport="+f.flgTipoReport.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
//alert(theAction.length);
|
||||
//alert(theAction);
|
||||
if(f.flgTipoReport.value==8){
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;
|
||||
|
||||
}
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report_","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
//if(f.nominativoDocumento.value!="")
|
||||
//f.id_clifor.value=1;
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','id_users','Operatore','RisNumKey',
|
||||
'descrizioneRiga', 'Articolo', 'R');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaArticolo()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
// 1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
var l_descrizioneRiga=Ab.prendiElementoDaId("descrizioneRiga");
|
||||
l_descrizioneRiga.value=l_descrizioneRiga.value.replace(/€/ig,"€");
|
||||
|
||||
//alert(f.currentTab.value);
|
||||
if(f.flgTipologia.value==4)
|
||||
{
|
||||
|
||||
cf= checkCPrenotazione();
|
||||
}
|
||||
else{
|
||||
if(f.flgClienteFornitore.value=="F")
|
||||
cf= checkF();
|
||||
else if(f.flgClienteFornitore.value=="C")
|
||||
cf=checkC();
|
||||
else if(f.flgClienteFornitore.value=="A")
|
||||
cf=checkA();
|
||||
else {
|
||||
cf=false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
}
|
||||
|
||||
if (cf)
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRigaArticolo";
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
Ab.popUp("ELAB");
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkF()
|
||||
{//alert('f');
|
||||
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if(f.imponibile.value=="0,00" || f.imponibile.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('imponibile').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
return Ab.validateForm('id_clifor','Fornitore','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
}
|
||||
|
||||
function checkC()
|
||||
{//alert('C');
|
||||
var f = document.main;
|
||||
if(f.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3 && !Ab.validateForm('seriale','Seriale articolo','R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 è obbligatorio flgEmettiFatturaScontrino
|
||||
if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','descrizioneRiga','Articolo','R','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
else
|
||||
return false;
|
||||
}
|
||||
function checkCPrenotazione()
|
||||
{//alert('C');
|
||||
|
||||
var f = document.main;
|
||||
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if(f.prezzoPubblicoConIva.value=="0,00" || f.prezzoPubblicoConIva.value=="")
|
||||
{
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
|
||||
return Ab.validateForm('nominativoDocumento','Cliente','R','quantita','quantita','RisNum>0','id_users','Operatore','RisNumKey');
|
||||
|
||||
}
|
||||
function checkA()
|
||||
{
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor','Cliente/Fornitore','RisNumKey','id_articolo','Articolo','RisNumKey','quantita','quantita','RisNum>0','id_iva','codice iva','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
function delRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRigaArticolo(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
|
||||
}
|
||||
|
||||
function cambiaFocus()
|
||||
{
|
||||
var f = document.main;
|
||||
var l_id_tipoDocumento=Ab.prendiElementoDaId('id_tipoDocumento').value;
|
||||
var l_id_clifor=Ab.prendiElementoDaId('id_clifor').value;
|
||||
checkBoxes();
|
||||
if(l_id_tipoDocumento==1 ||l_id_clifor>0 )
|
||||
{
|
||||
if( f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
}
|
||||
else
|
||||
{
|
||||
if(f.currentTab.value=="RIGHE")
|
||||
{
|
||||
if(f.flgUsaSeriale.value==1)
|
||||
Ab.setFocus('seriale')
|
||||
else
|
||||
Ab.setFocus('searchArticolo')
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Ab.setFocus('nominativoDocumento')
|
||||
|
||||
}
|
||||
}
|
||||
//alert('pio');
|
||||
}
|
||||
function beep()
|
||||
{
|
||||
var theBeep;
|
||||
if (ns4 || mz7){
|
||||
|
||||
var theIdStyle = document.getElementById('seriale').style;
|
||||
theIdStyle.backgroundColor="#ff0000";
|
||||
}
|
||||
else
|
||||
{
|
||||
theBeep=Ab.prendiElementoDaId('beep');
|
||||
theBeep.src='../../_sounds/left.wav';
|
||||
}
|
||||
|
||||
//document.all.beep.src='../../_sounds/left.wav';
|
||||
|
||||
}
|
||||
|
||||
function descRigaKeyUp(theEvent)
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
focusNextOnCr(theEvent,'seriale');
|
||||
beep();
|
||||
}
|
||||
else
|
||||
focusNextOnCr(theEvent,'quantita') ;
|
||||
}
|
||||
|
||||
function saveConferma()
|
||||
{
|
||||
|
||||
var f= document.main;
|
||||
f.flgStato.value=1;
|
||||
saveCommand();
|
||||
}
|
||||
|
||||
function ricalcolaMag()
|
||||
{
|
||||
if(confirm("Verrà ricalcolato tutto il magazzino. Sei Sicuro?"))
|
||||
{
|
||||
var f= document.main;
|
||||
f.cmd.value="ricalcolaMag";
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onFocusSeriale()
|
||||
{//alert('ofs');
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('seriale').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
// checkBoxes();
|
||||
// Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onFocusDescRiga()
|
||||
{//alert('ofds');
|
||||
checkBoxes();
|
||||
if(Ab.prendiElementoDaId("id_articolo").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
{
|
||||
//se non è bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
if(document.main.flgUsaSeriale.value==1 && document.main.flgTipologia.value!=3)
|
||||
{
|
||||
Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
beep();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyUpSeriale(theEvent)
|
||||
{
|
||||
var keyCode = theEvent.keyCode;
|
||||
if(keyCode==13)
|
||||
{
|
||||
Ab.prendiElementoDaId('notaRigaDocumento').focus() ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function labelD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Documento_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function labelCR()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verranno stampate le etichette di tutti i documenti relativi al criteri di ricerca selezionato. Sei sicuro?"))
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArt"+"&progDocumento="+f.progDocumento.value+"&id_esercizio="+f.id_esercizio.value+"&id_tipoDocumento="+f.id_tipoDocumento.value+"&id_clifor="+f.id_clifor.value+"&dataDocumentoDa="+f.dataDocumentoDa.value+"&dataDocumentoA="+f.dataDocumentoA.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare per articolo","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function emettiFatturaClick()
|
||||
{alert('old');
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino==1)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function emettiDocumentoChange()
|
||||
{
|
||||
checkBoxes();
|
||||
var rowCliente=Ab.prendiElementoDaId('CLIENTE');
|
||||
var l_flgEmettiFatturaScontrino=Ab.prendiElementoDaId('flgEmettiFatturaScontrino').value;
|
||||
if(l_flgEmettiFatturaScontrino>0)
|
||||
{
|
||||
rowCliente.style.display="table-row";
|
||||
}
|
||||
else
|
||||
{
|
||||
rowCliente.style.display="none";
|
||||
//non cancello niente... lo devo fare se salvo 'gniosa
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ristampaScontrino()
|
||||
{ checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else
|
||||
if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="ristampaScontrino";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
if(f.totDocumento.value=="0,00")
|
||||
alert("ATTENZIONE! Scontrino a valore zero");
|
||||
else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi stampare lo scontrino');
|
||||
else if(confirm("Verrà stampato lo scontrino. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="stampaScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
function chiudiScontrino()
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
//if(f.totDocumento.value=="0,00")
|
||||
// alert("ATTENZIONE! Scontrino a valore zero");
|
||||
//else
|
||||
if(flgEmettiFatturaScontrino.value>0)
|
||||
alert('ATTENZIONE! Stai emettendo una fattura. Non puoi chiudere lo scontrino');
|
||||
else if(confirm("Lo scontrino verrà chiuso. Sei sicuro?"))
|
||||
{
|
||||
Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="print";
|
||||
f.act.value="chiudiScontrinoESalva";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function generaDocumento()
|
||||
{
|
||||
if(confirm("Verrà generato il documento relativo. Sei sicuro?"))
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
f.cmd.value="generaDocumento";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_documento.value);
|
||||
}
|
||||
|
||||
function stampaDocumento(id)
|
||||
{
|
||||
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
if(f.flgTipoStampa.value==10)
|
||||
{
|
||||
f.cmd.value="print";
|
||||
f.act.value="doc";
|
||||
f.action=f.actionPage.value;
|
||||
f.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=doc"+"&id_documento="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Fattura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function prelevaArticolo(id)
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="prelevaArticolo";
|
||||
f.id_rigaDocumentoDaPrelevare.value=id;
|
||||
var qdp=document.getElementById('qtaDaPrelevare_'+id);
|
||||
var qdpMax=document.getElementById('qtaDaPrelevareMax_'+id);
|
||||
if(qdp.value>qdpMax.value)
|
||||
alert("ERRORE! Non puoi prelevare piu' di quanto hai caricato");
|
||||
else if (qdp.value<=0)
|
||||
alert("ERRORE! Quantita' non valida!")
|
||||
else
|
||||
{
|
||||
f.qtaDaPrelevare.value=qdp.value;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delArticoloPrelevato(id_rd, id_rdP)
|
||||
{
|
||||
if(confirm("Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delPrelevaArticolo";
|
||||
f.id_rigaDocumento.value=id_rd;
|
||||
f.id_rigaDocumentoPrelevata.value=id_rdP;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function impostaRigaChiusa(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà chiusa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="chiudiRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
function impostaRigaAperta(l_id)
|
||||
{
|
||||
if(confirm("La riga verrà aperta nuovamente. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="apriRigaArticolo";
|
||||
f.id_rigaDocumento.value=l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function filtraRighe()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.pageNumber_righe.value=1;
|
||||
f.submit();
|
||||
|
||||
}
|
||||
|
||||
function mailCommand()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare il documento via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mailCommandCR()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
if(confirm("Vuoi mandare i documenti selezionati via email?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.eMailInvio.value=prompt("Inserisci l'indirizzo di posta elettronica",f.eMailInvio.value);
|
||||
//alert('pio_'+f.eMail.value);
|
||||
if(f.eMailInvio.value!='null')
|
||||
{
|
||||
Ab.popUp("ELAB");
|
||||
f.cmd.value="mail";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function documentoPagato(id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
// if( Ab.validateForm2('main','dataFatturazione','Data Fatturazione','R'))
|
||||
{
|
||||
if(confirm("Vuoi rendere il documento pagato?"))
|
||||
|
||||
{ checkRadioCR();
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="docPagato";
|
||||
//f.act.value="view";
|
||||
f.id_documento.value=id;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function refreshIvaByreparto()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
var l_id_iva=Ab.prendiElementoDaId('id_reparto_'+f.id_reparto.value).value;
|
||||
f.id_iva.value=l_id_iva;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function labelAccD()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=print&act=lblArtAcc"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Etichette_Accessori_Articolo","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function refreshStatoRiparazione(id)
|
||||
{
|
||||
if(confirm("Attenzione! Stai cambiando lo stato della riparazione. Sei Sicuro?"))
|
||||
{
|
||||
var nuovoStato=Ab.prendiElementoDaId("flgStatoRiparazione_"+id).value;
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.flgStatoRiparazioneS.value=nuovoStato;
|
||||
f.id_documento.value=id;
|
||||
f.cmd.value="aggionraSRCR";
|
||||
f.flgReport.value="";
|
||||
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function inviaAvviso(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
if(confirm("Verrà inviato un avviso. Vuoi continuare?"))
|
||||
{
|
||||
|
||||
f.id_documento.value=l_id;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="inviaAvviso";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function vediRientri(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
modalW("Elenco rientri", "DocumentoRip.abl?cmd=vediRientri&id_rigaDocumento="+l_id, 510, 300 );
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoDocumento.value=l_id;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modifyClifor()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action="../anag/Cliente.abl";
|
||||
f.cmd.value="md";
|
||||
//f.id_clifor.value=f.id_cliforListino.value;
|
||||
f.submit();
|
||||
}
|
||||
396
rus/admin/contab/_js/ab-documentoScadenza.js
Normal file
396
rus/admin/contab/_js/ab-documentoScadenza.js
Normal file
|
|
@ -0,0 +1,396 @@
|
|||
// javascript per gestione campi obbligatori//
|
||||
// javascript per gestione campi obbligatori///
|
||||
|
||||
function documentReadyScriptCR()
|
||||
{
|
||||
calcolaImportoSelezionate();
|
||||
}
|
||||
|
||||
$('#myModal').on('show.bs.modal', function (e)
|
||||
{
|
||||
$("#dataScadenzaMDa").val($("#dataScadenzaDa").val());
|
||||
$("#dataScadenzaMA").val($("#dataScadenzaA").val());
|
||||
|
||||
if ($("input[id^=ckflgScadenzaSelezionata_]:checked").length > 0)
|
||||
{
|
||||
var scadenze = "";
|
||||
|
||||
$("input[id^=ckflgScadenzaSelezionata_]:checked").each(function(k, v) {
|
||||
scadenze += $(v).attr("idScadenza") + ";";
|
||||
});
|
||||
|
||||
$("#scadenzeSelezionate").val(scadenze);
|
||||
}
|
||||
else
|
||||
{
|
||||
swal("Errore", "Selezionare almeno una scadenza!", "error");
|
||||
$('#myModal').close();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function creaDistinta()
|
||||
{
|
||||
var dataDa = $("#dataScadenzaMDa").val(),
|
||||
dataA = $("#dataScadenzaMA").val();
|
||||
|
||||
/*
|
||||
if (dataDa == "")
|
||||
{
|
||||
swal("Errore!", "Inserire la data da", "error");
|
||||
$("#dataScadenzaMDa").focus();
|
||||
return;
|
||||
}
|
||||
if (dataA == "")
|
||||
{
|
||||
swal("Errore!", "Inserire la data a", "error");
|
||||
$("#dataScadenzaMA").focus();
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if ($("#id_banca").val() == 0)
|
||||
{
|
||||
swal("Errore!", "Inserire la banca", "error");
|
||||
$("#id_banca").focus();
|
||||
return;
|
||||
}
|
||||
if ($("#dataPresentazione").val() == 0)
|
||||
{
|
||||
swal("Errore!", "Inserire la data presentazione", "error");
|
||||
$("#dataPresentazione").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
Ab.removeFadeModal();
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="creaDistinta";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
$(":checkbox").on("ifChecked", null, null, function () {
|
||||
if ($(this).attr("name").indexOf("ckflgScadenza") >= 0)
|
||||
{
|
||||
var id_documentoScadenza = $(this).attr("idScadenza");
|
||||
|
||||
Ab.fetch($("#actionPage").val(), "cmd=selezionaScadenza&id_documentoScadenza="+id_documentoScadenza);
|
||||
|
||||
calcolaImportoSelezionate();
|
||||
}
|
||||
else if ($(this).attr("name") == "ckflgAll")
|
||||
{
|
||||
|
||||
$("input[id^=ckflgScadenzaSelezionata_]").each(function(key, val)
|
||||
{
|
||||
$(val).iCheck('check');
|
||||
});
|
||||
|
||||
checkUncheck(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkUncheck(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(":checkbox").on("ifUnchecked", null, null, function () {
|
||||
if ($(this).attr("name").indexOf("ckflgScadenza") >= 0)
|
||||
{
|
||||
var id_documentoScadenza = $(this).attr("idScadenza");
|
||||
|
||||
$("#ckflgAll").iCheck('uncheck');
|
||||
|
||||
Ab.fetch($("#actionPage").val(), "cmd=deselezionaScadenza&id_documentoScadenza="+id_documentoScadenza);
|
||||
|
||||
calcolaImportoSelezionate();
|
||||
}
|
||||
else if ($(this).attr("name") == "ckflgAll")
|
||||
{
|
||||
|
||||
$("input[id^=ckflgScadenzaSelezionata_]").each(function(key, val)
|
||||
{
|
||||
$(val).iCheck('uncheck');
|
||||
});
|
||||
|
||||
checkUncheck(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkUncheck(this);
|
||||
}
|
||||
});
|
||||
|
||||
function checkUncheck(that)
|
||||
{
|
||||
// trovo l'input collegato alla checkbox
|
||||
var name = $(that).attr("name").replace("ck", "");
|
||||
|
||||
// controllo lo stato della checkbox e valorizzo la input
|
||||
if ($(that).is(":checked"))
|
||||
{
|
||||
$("#" + name).val(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#" + name).val(0);
|
||||
}
|
||||
|
||||
searching();
|
||||
}
|
||||
|
||||
function calcolaImportoSelezionate()
|
||||
{
|
||||
var tot = 0;
|
||||
|
||||
$("input[id^=ckflgScadenzaSelezionata_]:checked").each(function(k, v) {
|
||||
tot += parseFloat($(v).attr("importo"));
|
||||
});
|
||||
|
||||
$("#importoSelezionato").val(tot.toFixed(2).replace(".", ","));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
|
||||
function creaDistintaAuto()
|
||||
{
|
||||
var dataFatturaDa=$("#dataFatturaDa").val(),
|
||||
dataFatturaA=$("#dataFatturaA").val(),
|
||||
dataScadenzaDa=$("#dataScadenzaDa").val(),
|
||||
dataScadenzaA=$("#dataScadenzaA").val();
|
||||
|
||||
if((dataFatturaDa==0 || dataFatturaA==0) && (dataScadenzaDa==0 || dataScadenazaA==0))
|
||||
{
|
||||
swal("Errore", "Selezionare almeno una intervallo di fatturazione o scadenza!", "error");
|
||||
return;
|
||||
}
|
||||
if($("#numBancheSelezionate").val()==0)
|
||||
{
|
||||
swal("Errore", "Selezionare almeno una banca!", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
swal({
|
||||
title: "Sei sicuro?",
|
||||
text: "Vuoi creare le distinte relative agli importi selezionati?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Si",
|
||||
cancelButtonText: "No",
|
||||
closeOnConfirm: true
|
||||
}, function(){
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="creaDistinta";
|
||||
Ab.submitAj('main');
|
||||
});
|
||||
}
|
||||
|
||||
function recuperaTotaleAuto()
|
||||
{
|
||||
var actionPage = $("#actionPage").val(),
|
||||
dataFatturaDa = $("#dataFatturaDa").val(),
|
||||
dataFatturaA = $("#dataFatturaA").val(),
|
||||
dataScadenzaDa = $("#dataScadenzaDa").val(),
|
||||
dataScadenzaA = $("#dataScadenzaA").val(),
|
||||
numDocumentoDa = $("#numDocumentoDa").val(),
|
||||
numDocumentoA = $("#numDocumentoA").val();
|
||||
|
||||
Ab.fetch(actionPage, "cmd=recuperaTotale&dataFatturaDa="+dataFatturaDa + "&dataFatturaA="+dataFatturaA +"&dataScadenzaDa="+dataScadenzaDa + "&dataScadenzaA="+dataScadenzaA + "&numDocumentoDa="+numDocumentoDa + "&numDocumentoA="+numDocumentoA, null, "postRecuperaTotaleAuto()", true);
|
||||
|
||||
}
|
||||
|
||||
function postRecuperaTotaleAuto(data)
|
||||
{
|
||||
$("#totaleRiba").val(data);
|
||||
}
|
||||
|
||||
function caricaEstrazione(tmstp)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.timestampElaborazione.value = tmstp;
|
||||
refresh();
|
||||
}
|
||||
|
||||
/*********************************/
|
||||
/*********************************/
|
||||
/* STAMPA SINGOLA DISTINTA */
|
||||
/*********************************/
|
||||
/*********************************/
|
||||
function stampaDistinta(id)
|
||||
{
|
||||
var f = document.main,
|
||||
debug=false,
|
||||
wwD="700",
|
||||
whD="500",
|
||||
theAction=f.actionPage.value+".pdf?cmd=print"+"&id_distintaRiba="+id;
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("dettaglio","flgSommaCRL","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
|
||||
function printr()
|
||||
{
|
||||
var f = document.main;
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=lista"+"&id_clifor="+f.id_clifor.value+"&dataScadenzaDa="+f.dataScadenzaDa.value+"&dataScadenzaA="+f.dataScadenzaA.value+"&flgTipoPagamento="+f.flgTipoPagamento.value;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
/*
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="print";
|
||||
f.act.value="lista";
|
||||
Ab.submitAj('main');
|
||||
*/
|
||||
}
|
||||
|
||||
function eliminaDistinta(l_id)
|
||||
{
|
||||
swal({
|
||||
title: "Sei sicuro?",
|
||||
text: "I dati saranno cancellati. Vuoi continuare?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Si",
|
||||
cancelButtonText: "No",
|
||||
closeOnConfirm: true
|
||||
}, function(){
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.id_distintaRiba.value = l_id;
|
||||
f.cmd.value="eliminaDistinta";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
});
|
||||
}
|
||||
|
||||
function bancaPiu(id)
|
||||
{
|
||||
//console.log("aaaa");
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.id_banca.value = id;
|
||||
f.cmd.value="bancaMeno";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function bancaMeno(id)
|
||||
{
|
||||
console.log("bbbb");
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.id_banca.value = id;
|
||||
f.cmd.value="bancaPiu";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* aggiunge la banca all'elenco delle visibili per la distinta */
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function addBancaADistinta()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
//f.id_banca.value = id;
|
||||
f.cmd.value="addBancaADistinta";
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* rimuove la banca all'elenco delle visibili per la distinta */
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function rimuoviBancaDaDistinta(id)
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.id_banca.value = id;
|
||||
f.cmd.value="rimuoviBancaDaDistinta";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
/*********************************/
|
||||
/*********************************/
|
||||
/* STAMPA elaborazione DISTINTA */
|
||||
/*********************************/
|
||||
/*********************************/
|
||||
function stampaElaborazione()
|
||||
{
|
||||
var f = document.main,
|
||||
debug=false,
|
||||
wwD="700",
|
||||
whD="500",
|
||||
theAction=f.actionPage.value+".pdf?cmd=print"+"×tampElaborazione="+$("#timestampElaborazione").val();
|
||||
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Report","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
378
rus/admin/contab/_js/ab-documentoTaglio.js
Normal file
378
rus/admin/contab/_js/ab-documentoTaglio.js
Normal file
|
|
@ -0,0 +1,378 @@
|
|||
/* ab-documento lte *
|
||||
/* 4.1 */
|
||||
/******************************/
|
||||
/* JAVASCRIPT AD HOC PER DOCUMENTO TAGIO */
|
||||
/* DALLA MODAL ALLA MAIN E VICEVERSA */
|
||||
/******************************/
|
||||
/* COPPIA FORMFIELD MODALFIELD PER CARICAMENTO DATI */
|
||||
/* DALLA MODAL ALLA MAIN E VICEVERSA per cnuovo o midifico clifor*/
|
||||
var retItemsColoreTaglio = [{
|
||||
"formField": "id_coloreDaAggiungere",
|
||||
"modalField": "id_colore"
|
||||
}, {
|
||||
"formField": "descrizioneColore",
|
||||
"modalField": "descrizioneColore"
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
// evento dopo aver cercato articolo
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function refreshArticolo() {
|
||||
$("#currentFocus").val("id_taglia");
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
//
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function calcolaTessutiTaglio() {
|
||||
|
||||
if($("#id_magFisicoPartenza2").val()==0)
|
||||
{
|
||||
swal("Attenzione!", "Impostare una Magazzino di partenza tessuto", "warning")
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
|
||||
swal({
|
||||
title: "Calcola Necessita' Tessuti per taglio",
|
||||
text: "In base agli articoli scelti, vengono scaricati i tessuti necessari. Sei Sicuro?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonClass: "btn-danger",
|
||||
confirmButtonText: "si",
|
||||
cancelButtonText: "no",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
//alert( $('#main').serialize());
|
||||
if (isConfirm) {
|
||||
//chiamo un comando che lancia un thread?
|
||||
var f = document.main;
|
||||
f.action = f.actionPage.value;
|
||||
//$("#id_documento").val(l_id);
|
||||
$("#cmd").val("calcolaTessutiTaglio");
|
||||
Ab.submitAj('main');
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* documento taglio.. aggiunger riga smart!!!*/
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function aggiungiColoreTaglio() {
|
||||
|
||||
|
||||
var f = document.main;
|
||||
|
||||
var l_lang = $("#lang").val(),
|
||||
descArticolo = $("#descArticolo").val(),
|
||||
descTaglia = $("#descTaglia").val(),
|
||||
descColore = $("#descColore").val();
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
|
||||
|
||||
|
||||
if (Ab.validateForm3(l_lang, "main", "id_articolo", descArticolo, "RisNumKey", "id_taglia", descTaglia, "RisNumkey", "id_coloreDaAggiungere", descColore, "RisNumKey")) {
|
||||
|
||||
|
||||
f.cmd.value = "aggiungiColoreTaglio";
|
||||
//f.act.value="addRigaTessuto";
|
||||
$("#currentFocus").val("descrizioneColore");
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* documento taglio.. salva riga con totale capi da fare!!!*/
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function aggiornaCapiRigaDocumentoTaglio(l_id) {
|
||||
var action = $("#actionPage").val();
|
||||
|
||||
|
||||
Ab.fetch(action, "cmd=aggiornaCapiRigaDocumentoTaglio&id_rigaDocumento=" + l_id + "&nrNew=" + $("#nr_" + l_id).val(), "messaggi");
|
||||
Ab.setFocusNextField("nr_" + l_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// APRE POPUP lista ordini di taglio
|
||||
/////////////////////////////////////////////
|
||||
function popupOrdiniTaglio() {
|
||||
var l_id_documento = $("#id_documento").val();
|
||||
//alert($("#actionPage").val() + "?cmd=associaOrdineTaglioS&id_documento=" + l_id_documento);
|
||||
$('#modalWindow .modal-title').html("Elenco Ordini Taglio");
|
||||
$('#modalWindow').modal('show');
|
||||
$('#modalWindow .modal-body').load($("#actionPage").val() + "?cmd=associaOrdineTaglioS&id_documento=" + l_id_documento);
|
||||
/*$(".dummyCreaDoc").load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, function () {
|
||||
$('#modalDocFiglio .modal-body').html($(".dummyCreaDoc").html());
|
||||
|
||||
$(".dummyCreaDoc").html();
|
||||
});*/
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
//comando associazione ordine di taglio a disposizione taglio
|
||||
/////////////////////////////////////////////
|
||||
function associaOrdineTaglio(l_id_documento) {
|
||||
var f = document.main;
|
||||
if (l_id_documento == 0) {
|
||||
alert("ERRORE! documento non valido!");
|
||||
return;
|
||||
}
|
||||
$('#modalWindow').modal('hide')
|
||||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||||
|
||||
f.cmd.value = "associaOrdineTaglio";
|
||||
f.action = f.actionPage.value;
|
||||
f.id_documentoOrdineTaglio.value = l_id_documento;
|
||||
|
||||
//f.act.value="addRigaTessuto";
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/*****************************************************/
|
||||
/*****************************************************/
|
||||
/* DISSOCIA ORDINE TAGLIO MA NON TOGLIE LE RIGHE */
|
||||
/*****************************************************/
|
||||
/*****************************************************/
|
||||
function dissociaOrdineTaglio(l_id) {
|
||||
Ab.confirmDelete4(function () {
|
||||
var f = document.main;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value = "dissociaOrdineTaglio";
|
||||
f.id_docFiglioPadre.value = l_id;
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* BOTTONE NUOVOCOLORE CAMPO AJAX
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function nuovoColoreTaglio() {
|
||||
newColore("main", retItemsColoreTaglio);
|
||||
}
|
||||
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* dopo aver salvato il colore vodo ad associarlo all'ordine di taglio
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function extraPostSaveColore() {
|
||||
aggiungiColoreTaglio();
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* da articolo non funziona direttamente il save command....
|
||||
// mezzo secondo di ritatdo e funziona
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function saveCommandDaArticolo() {
|
||||
setTimeout(function () {
|
||||
{
|
||||
$("#currentTab").val("#ORDINI");
|
||||
$("#act").val("saveDisposizioneTaglio");
|
||||
//attivaTab("ORDINI");
|
||||
saveCommand();
|
||||
|
||||
}
|
||||
|
||||
}, 100);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* nella schelta degli ordine taglio seleziono tutti gli ordini
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function selezionaTuttoOrdineTaglio() {
|
||||
//var valore = $("#ckflgSelezionaTutto").attr("checked")=="checked"?true:false;
|
||||
var valore = $("#flgOrdineTaglioST").val();
|
||||
$("input[id^='ckflgOrdineTaglio_']").each(function (index, element) {
|
||||
//element.checked = valore;
|
||||
var id = $(element).attr("name").replace("ckflgOrdineTaglio_", "");
|
||||
element.checked = valore == 0 ? false : true;
|
||||
$("#flgOrdineTaglio_" + id).val(valore);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* comando associa tutti gli ordini di taglio selezionati/*
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function associaOrdineTaglioSelezionati() {
|
||||
var f = document.main;
|
||||
$('#modalWindow').modal('hide')
|
||||
setTimeout(function () {
|
||||
{
|
||||
swal({
|
||||
title: "Associazione Ordini Taglio",
|
||||
text: "Verranno Associati gli Ordini di Taglio Selezionati. Sei Sicuro?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonClass: "btn-danger",
|
||||
confirmButtonText: "si",
|
||||
cancelButtonText: "no",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
f.cmd.value = "associaOrdiniTaglio";
|
||||
|
||||
|
||||
|
||||
var id_documenti = "";
|
||||
$("input[name^='ckflgOrdineTaglio_']").each(function () {
|
||||
// faccio la lista dei servizi selezionati da passare alla servlet
|
||||
if (this.checked) {
|
||||
var id = this.name.replace("ckflgOrdineTaglio_", "");
|
||||
|
||||
id_documenti += id + ",";
|
||||
}
|
||||
});
|
||||
|
||||
f.id_documenti.value = id_documenti;
|
||||
|
||||
f.action = f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* stampaDisposizioneTaglio report, non quella per il tagliatore/*
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function stampaDisposizioneTaglio()
|
||||
{
|
||||
//swal(id);
|
||||
id=$("#id_documento").val();
|
||||
//alert(id);
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=printDisposizioneTaglio&id_documento="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Disposizione","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* nuovo articolo: va proprio sulla pagina articolo/*
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function nuovoArticolo()
|
||||
{
|
||||
|
||||
swal({
|
||||
title: "Nuovo Articolo",
|
||||
text: "Crei un nuovo articolo?",
|
||||
type: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonClass: "btn-info",
|
||||
confirmButtonText: "si",
|
||||
cancelButtonText: "no",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$("#main").attr("action","../art/Articolo.abl");
|
||||
//$("#flgReport").val("S");
|
||||
$("#cmd", "#main").val("ni");
|
||||
$("#act","#main").val("");
|
||||
$("#cmd2").val("");
|
||||
$("#act2").val("");
|
||||
$("#pageNumber").val("1");
|
||||
Ab.submitAj('main');
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* modifica articolo: va proprio sulla pagina articolo/*
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
function modificaArticolo()
|
||||
{
|
||||
|
||||
|
||||
$("#main").attr("action","../art/Articolo.abl");
|
||||
//$("#flgReport").val("S");
|
||||
$("#cmd", "#main").val("md");
|
||||
$("#act","#main").val("");
|
||||
$("#cmd2").val("");
|
||||
$("#act2").val("");
|
||||
$("#pageNumber").val("1");
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
324
rus/admin/contab/_js/ab-documentoTessuto.js
Normal file
324
rus/admin/contab/_js/ab-documentoTessuto.js
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaTessuto()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//prima cosa salvo le quantità sui campi hidden
|
||||
//alert('pio');
|
||||
//1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
Ab.aggiustaInputText(f.descrizioneRiga);
|
||||
Ab.aggiustaInputText(f.notaRigaDocumento);
|
||||
if (document.getElementById('notaBarcode'))
|
||||
Ab.aggiustaInputText(f.notaBarcode);
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//Tessuto SOLO MT!!!!!!!
|
||||
|
||||
|
||||
//$("#quantita").val($("#kgT").val());
|
||||
$("#quantita").val($("#mtT").val());
|
||||
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoF();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoC();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoA();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto";
|
||||
//f.act.value="addRigaTessuto";
|
||||
$("#currentFocus").val("searchArticolo");
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
//Ab.popUp("ELAB");
|
||||
// Ab.submitAj('main');
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a fornitori*/
|
||||
function checkTessutoF() {
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Lotto', 'R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if (f.imponibile.value == "0,00" || f.imponibile.value == "") {
|
||||
var theIdStyle = document.getElementById('imponibile').style;
|
||||
theIdStyle.backgroundColor = "#ff0000";
|
||||
}
|
||||
|
||||
var checkMag = true;
|
||||
if ($("#magPartenzaDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#magArrivoDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkTessutoC() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Seriale articolo', 'R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if (f.prezzoPubblicoConIva.value == "0,00" || f.prezzoPubblicoConIva.value == "") {
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva').style;
|
||||
theIdStyle.backgroundColor = "#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 obbligatorio flgEmettiFatturaScontrino
|
||||
//s09-02-2010 viene chamato da add riga... non controllo id_clilfor2
|
||||
// if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && //Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'R', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???*/
|
||||
function checkTessutoA() {
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articolo', 'Articolo', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// onFocusDescRiga
|
||||
// determina che succede quando arriva il focus su descriga
|
||||
// deve andare sulla qta giusta. Si attiva dopo il CR
|
||||
////////////////////////////////////
|
||||
function onFocusDescRigaTessuto() {
|
||||
//checkBoxes();
|
||||
/* if(Ab.prendiElementoDaId("id_articoloTessutoColore").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
//se non bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
//dovrei verificare getTipoCaricoScarico=0-- anagrafiche chiedo seriale tipoCaricoScarico==0
|
||||
if (document.main.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3) {
|
||||
$("#descrizioneRiga").select();
|
||||
//Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
//beep();
|
||||
} else {
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaTessutoLav()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//prima cosa salvo le quantità sui campi hidden
|
||||
//alert('pio');
|
||||
//1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
Ab.aggiustaInputText(f.descrizioneRiga);
|
||||
Ab.aggiustaInputText(f.notaRigaDocumento);
|
||||
if (document.getElementById('notaBarcode'))
|
||||
Ab.aggiustaInputText(f.notaBarcode);
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//Tessuto SOLO MT!!!!!!!
|
||||
|
||||
|
||||
//$("#quantita").val($("#kgT").val());
|
||||
$("#quantita").val($("#mtT").val());
|
||||
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoFLAV();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoCLAV();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoALAV();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto";
|
||||
//f.act.value="addRigaTessuto";
|
||||
//da gestire se descrizioneCodiceRiga o descrizione riga
|
||||
$("#currentFocus").val("descrizioneCodiceRiga"); //f.flgCaricaArticoli.value=1;
|
||||
//Ab.popUp("ELAB");
|
||||
// Ab.submitAj('main');
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a fornitori
|
||||
caso lavorazioni*/
|
||||
function checkTessutoFLAV() {
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if (document.getElementById('flgUsaSeriale')) {
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Lotto', 'R'))
|
||||
return false;
|
||||
}
|
||||
//imponibile in rosso
|
||||
|
||||
var checkMag = true;
|
||||
if ($("#magPartenzaDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#magArrivoDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
}
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti
|
||||
per lavorazioni*/
|
||||
function checkTessutoCLAV() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (document.getElementById('flgUsaSeriale')) {
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Seriale articolo', 'R'))
|
||||
return false;
|
||||
}
|
||||
//prezzoPubblicoConIva in rosso
|
||||
|
||||
//corrispettivi.... se emetti fattura id_clifor2 obbligatorio flgEmettiFatturaScontrino
|
||||
//s09-02-2010 viene chamato da add riga... non controllo id_clilfor2
|
||||
// if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && //Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'R', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???
|
||||
caso lavorazione*/
|
||||
function checkTessutoALAV() {
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articolo', 'Articolo', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* calcola tessuti totali */
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function calcolaMtTotali()
|
||||
{
|
||||
|
||||
var stacchi=parseFloat($("#stacchi").val().replace(/[,]/, '.'));
|
||||
var metriStacchi=parseFloat($("#metriStacchi").val());
|
||||
console.log(stacchi+" "+metriStacchi+" "+stacchi*metriStacchi);
|
||||
numeral.locale('it');
|
||||
var mtString = numeral(stacchi*metriStacchi).format('0,0.00');
|
||||
$("#mtT").val(mtString);
|
||||
|
||||
}
|
||||
|
||||
function codBarreDispoTessitura()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+"?cmd=codBarreDispoTessitura"+"&id_documento="+f.id_documento.value;
|
||||
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
var blankLabels=prompt("Numero di etichette da saltare","0");
|
||||
theAction=theAction+"&blankLabels="+blankLabels;//+"&numLabels="+numLabels;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Codici_Barre_Dispo_Tessitura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
277
rus/admin/contab/_js/ab-documentoTessuto2.js
Normal file
277
rus/admin/contab/_js/ab-documentoTessuto2.js
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaTessuto2()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//prima cosa salvo le quantità sui campi hidden
|
||||
//alert('pio');
|
||||
//1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
Ab.aggiustaInputText(f.descrizioneRiga2);
|
||||
Ab.aggiustaInputText(f.notaRigaDocumento2);
|
||||
if (document.getElementById('notaBarcode2'))
|
||||
Ab.aggiustaInputText(f.notaBarcode2);
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//Tessuto SOLO MT!!!!!!!
|
||||
|
||||
|
||||
//$("#quantita").val($("#kgT").val());
|
||||
$("#quantita2").val($("#mtT2").val());
|
||||
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoF2();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoC2();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoA2();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto2";
|
||||
//f.act.value="addRigaTessuto";
|
||||
$("#currentFocus").val("searchArticolo");
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
//Ab.popUp("ELAB");
|
||||
// Ab.submitAj('main');
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a fornitori*/
|
||||
function checkTessutoF2() {
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale2', 'Lotto', 'R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
if (f.imponibile2.value == "0,00" || f.imponibile2.value == "") {
|
||||
var theIdStyle = document.getElementById('imponibile2').style;
|
||||
theIdStyle.backgroundColor = "#ff0000";
|
||||
}
|
||||
|
||||
var checkMag = true;
|
||||
if ($("#magPartenzaDaScegliere2").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza2', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#magArrivoDaScegliere2").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo2', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'descrizioneRiga2', 'Articolo', 'R', 'quantita2', 'quantita', 'RisNum>0', 'id_iva2', 'codice iva', 'RisNumKey');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkTessutoC2() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale2', 'Seriale articolo', 'R'))
|
||||
return false;
|
||||
//prezzoPubblicoConIva in rosso
|
||||
if (f.prezzoPubblicoConIva2.value == "0,00" || f.prezzoPubblicoConIva2.value == "") {
|
||||
var theIdStyle = document.getElementById('prezzoPubblicoConIva2').style;
|
||||
theIdStyle.backgroundColor = "#ff0000";
|
||||
}
|
||||
//corrispettivi.... se emetti fattura id_clifor2 obbligatorio flgEmettiFatturaScontrino
|
||||
//s09-02-2010 viene chamato da add riga... non controllo id_clilfor2
|
||||
// if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && //Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'R', 'descrizioneRiga2', 'Articolo', 'R', 'quantita2', 'quantita', 'RisNum>0', 'id_iva2', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???*/
|
||||
function checkTessutoA2() {
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articolo2', 'Articolo', 'RisNumKey', 'quantita2', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// onFocusDescRiga
|
||||
// determina che succede quando arriva il focus su descriga
|
||||
// deve andare sulla qta giusta. Si attiva dopo il CR
|
||||
////////////////////////////////////
|
||||
function onFocusDescRigaTessuto2() {
|
||||
//checkBoxes();
|
||||
/* if(Ab.prendiElementoDaId("id_articoloTessutoColore").value>0 && Ab.prendiElementoDaId("descrizioneRiga").value!="" && Ab.prendiElementoDaId('flgAutoAdd').value==1)
|
||||
{
|
||||
addRigaArticolo();
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
//se non bolla fattura o nc allora il seriale non lo chiedo (es. ordine)flgTipologia!=3
|
||||
//dovrei verificare getTipoCaricoScarico=0-- anagrafiche chiedo seriale tipoCaricoScarico==0
|
||||
if (document.main.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3) {
|
||||
$("#descrizioneRiga2").select();
|
||||
//Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
//beep();
|
||||
} else {
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRigaTessutoLav2()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//prima cosa salvo le quantità sui campi hidden
|
||||
//alert('pio');
|
||||
//1 FT fatt vendita
|
||||
//2 FB fattura accompagnatoria
|
||||
//3 fa fattura acquisto
|
||||
//4 bo bolla di accompagnamento
|
||||
//5 prenotazione
|
||||
//Ab.prendiElementoDaId("ADDRIGA").disable;
|
||||
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
var cf;
|
||||
//gestione euro
|
||||
Ab.aggiustaInputText(f.descrizioneRiga2);
|
||||
Ab.aggiustaInputText(f.notaRigaDocumento2);
|
||||
if (document.getElementById('notaBarcode'))
|
||||
Ab.aggiustaInputText(f.notaBarcode2);
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//Tessuto SOLO MT!!!!!!!
|
||||
|
||||
|
||||
//$("#quantita").val($("#kgT").val());
|
||||
$("#quantita2").val($("#mtT").val());
|
||||
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoFLAV();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoCLAV();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoALAV();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto";
|
||||
//f.act.value="addRigaTessuto";
|
||||
//da gestire se descrizioneCodiceRiga o descrizione riga
|
||||
$("#currentFocus").val("descrizioneCodiceRiga"); //f.flgCaricaArticoli.value=1;
|
||||
//Ab.popUp("ELAB");
|
||||
// Ab.submitAj('main');
|
||||
//
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a fornitori
|
||||
caso lavorazioni*/
|
||||
function checkTessutoFLAV2() {
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if (document.getElementById('flgUsaSeriale2')) {
|
||||
if (f.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Lotto', 'R'))
|
||||
return false;
|
||||
}
|
||||
//imponibile in rosso
|
||||
|
||||
var checkMag = true;
|
||||
if ($("#magPartenzaDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#magArrivoDaScegliere").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
}
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti
|
||||
per lavorazioni*/
|
||||
function checkTessutoCLAV2() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (document.getElementById('flgUsaSeriale2')) {
|
||||
if (f.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Seriale articolo', 'R'))
|
||||
return false;
|
||||
}
|
||||
//prezzoPubblicoConIva in rosso
|
||||
|
||||
//corrispettivi.... se emetti fattura id_clifor2 obbligatorio flgEmettiFatturaScontrino
|
||||
//s09-02-2010 viene chamato da add riga... non controllo id_clilfor2
|
||||
// if(f.id_tipoDocumento.value!=1 || (f.id_tipoDocumento.value==1 && f.flgEmettiFatturaScontrino.value==0) ||(f.id_tipoDocumento.value==1 && //Ab.validateForm('id_clifor2','Cliente/Fornitore','RisNumKey')))
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'R', 'descrizioneRiga', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???
|
||||
caso lavorazione*/
|
||||
function checkTessutoALAV2() {
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articolo', 'Articolo', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
|
||||
}
|
||||
316
rus/admin/contab/_js/ab-movimento.js
Normal file
316
rus/admin/contab/_js/ab-movimento.js
Normal file
|
|
@ -0,0 +1,316 @@
|
|||
$(function() {
|
||||
$( "#selReport" ).dialog({
|
||||
autoOpen: false,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#selReport" ).dialog("option", "title", "Seleziona Tipo Report");
|
||||
$( "#btn_elabReport" ).click(function() {
|
||||
report();
|
||||
$( "#selReport" ).dialog( "close" );
|
||||
});
|
||||
$( "#btn_closerReport" ).click(function() {
|
||||
$( "#selReport" ).dialog( "close" );
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
//R per required
|
||||
//isNum per numerico
|
||||
//isNumKey è una chiave.. uguale a isNum>0 ma cambio il messaggio
|
||||
//isNum>x per numerico maggiore di x
|
||||
//isNum<x per numerico minore di x
|
||||
//isEmail per indirizzo email
|
||||
//inRange1:10 per ..
|
||||
//3 stringhe
|
||||
//1: nome del field
|
||||
//2: se '' visualizza il nome del field, altrimenti questo campo
|
||||
//3: R/N+''/isNum/isEmail/inRangea:b
|
||||
var f = document.main;
|
||||
if(f.flgTipo.value==1)
|
||||
return Ab.validateForm('descrizione','Descrizione','R','oggettoEmail','Oggetto Email','R');
|
||||
else
|
||||
return Ab.validateForm('descrizione','Descrizione','R');
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("dettaglio","flgSommaCRL","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRow()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('id_rowBean','RowBean','R'))
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRow";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function creaCMByFile()
|
||||
{
|
||||
var f = document.main;
|
||||
if(f.id_templateMsg.value!="" && f.nomeFile.value!="")
|
||||
{
|
||||
if (confirm("Verrà creata una nuova coda di messaggi in base al template e al file di indirizzi email selezionato. Sei Sicuro?"))
|
||||
{
|
||||
//Ab.popUp("ELAB");
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="creaCodaMsg";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
else
|
||||
alert('Template non valido o file non selezionato!');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoTemplateMsg.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////
|
||||
// funzione richiamata sul document ready
|
||||
//in modo da averne uno solo
|
||||
///////////////////////////////
|
||||
function documentReadyScript()
|
||||
{
|
||||
//////////////////////
|
||||
//$('.editor').jqte();
|
||||
////////////////////////////
|
||||
var opts = {
|
||||
lang : 'it', // set your language
|
||||
styleWithCSS : false,
|
||||
height : 500,
|
||||
toolbar : 'maxi'
|
||||
};
|
||||
// create editor
|
||||
//$('#messaggio').elrte(opts);
|
||||
/////////////////////////////
|
||||
if($("#flgTipo").val()==1)
|
||||
CKEDITOR.replace( 'messaggio' );
|
||||
//rebuildAllEditor();
|
||||
}
|
||||
|
||||
function dettaglioArticoliVarianti(l_id_articolo, l_id_magazzino, l_id_clifor) {
|
||||
var f = document.main;
|
||||
|
||||
$("#dettaglioWin").dialog("open");
|
||||
$("#dettaglioWin").load("Movimento.abl?cmd=viewM&id_articolo="+l_id_articolo+"&id_magFisico="+l_id_magazzino+"&id_clifor="+l_id_clifor+"&flgInMagazzino="+f.flgInMagazzino.value);
|
||||
|
||||
/*
|
||||
var f = document.main;
|
||||
//alert("kk "+f.descrizioneCli.value);
|
||||
theAction=webApp+"/admin/contab/Movimento.abl?cmd=viewM&id_articolo="+l_id_articolo+"&id_magFisico="+l_id_magazzino+"&id_clifor="+l_id_clifor+"&flgInMagazzino="+f.flgInMagazzino.value;
|
||||
//hideList('listaClienti');
|
||||
//f.descrizioneCliente.value="";
|
||||
//f.id_cliente.value="";
|
||||
wArticolo=window.open(theAction, "Lista_Varianti","width=810,height=600,status=yes,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
wArticolo.focus();
|
||||
*/
|
||||
}
|
||||
|
||||
function closeMW() {
|
||||
$("#dettaglioWin").dialog("close");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// INTERROGAZIONI ACCESSORIE SU ORDINI A FORNITORE
|
||||
////////////////////////////////////////////////////
|
||||
function searching2()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="interrogazione2";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function loadDettaglio2(id_documento)
|
||||
{
|
||||
var f = document.main;
|
||||
f.id_documento.value = id_documento;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="loadDettaglio2";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function loadDettaglio3(id_documento)
|
||||
{
|
||||
var f = document.main;
|
||||
f.id_documento2.value = id_documento;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="loadDettaglio3";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function loadDettaglio4(id_rigaDocumento)
|
||||
{
|
||||
var f = document.main;
|
||||
f.id_rigaDocumento.value = id_rigaDocumento;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="loadDettaglio4";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function aggiustaOrdini()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="aggiustaOrdini";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function searching3()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="interrogazione3";
|
||||
f.act.value="";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/////////////////////////////////////report
|
||||
///////////////////////////////////
|
||||
function apriReport() {
|
||||
$( "#selReport" ).dialog( "open" );
|
||||
}
|
||||
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
//fetch per report csv
|
||||
///////////////////////////////////
|
||||
function reportCsv()
|
||||
{
|
||||
Ab.fetch("Movimento.abl", "cmd=creaReportCsv", "fileCsv",null,1);
|
||||
}
|
||||
177
rus/admin/contab/_js/ab-rigaDocumento.js
Normal file
177
rus/admin/contab/_js/ab-rigaDocumento.js
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
// pkg_rigaDocumento
|
||||
|
||||
$(function() {
|
||||
$( "#selReport" ).dialog({
|
||||
autoOpen: false,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#selReport" ).dialog("option", "title", "Seleziona Tipo Report");
|
||||
$( "#btn_elabReport" ).click(function() {
|
||||
report();
|
||||
$( "#selReport" ).dialog( "close" );
|
||||
});
|
||||
$( "#btn_closerReport" ).click(function() {
|
||||
$( "#selReport" ).dialog( "close" );
|
||||
});
|
||||
});
|
||||
|
||||
///////////////////////////////////////////
|
||||
////////T O O L B A R /////////////////////
|
||||
///////////////////////////////////////////
|
||||
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
var rep = document.rep;
|
||||
|
||||
//f.flgTipoReport.value = rep.flgTipoReportC.value;
|
||||
|
||||
//f.flgReport.value="S";
|
||||
f.flgReport.value=rep.flgTipoReport.value;
|
||||
if(rep.flgTipoReport.value=="TA")
|
||||
f.flgOrderBy.value=9;
|
||||
else
|
||||
f.flgOrderBy.value="";
|
||||
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
//R per required
|
||||
//isNum per numerico
|
||||
//isNumKey è una chiave.. uguale a isNum>0 ma cambio il messaggio
|
||||
//isNum>x per numerico maggiore di x
|
||||
//isNum<x per numerico minore di x
|
||||
//isEmail per indirizzo email
|
||||
//inRange1:10 per ..
|
||||
//3 stringhe
|
||||
//1: nome del field
|
||||
//2: se '' visualizza il nome del field, altrimenti questo campo
|
||||
//3: R/N+''/isNum/isEmail/inRangea:b
|
||||
return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("dettaglio","flgSommaCRL","1","0");
|
||||
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab.setRadioButtonValue("dettaglio","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("ricerca","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRow()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('id_rowBean','RowBean','R'))
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRow";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
|
||||
}
|
||||
|
||||
function modifyDocumento(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action="../contab/Documento.abl";
|
||||
f.cmd.value="md";
|
||||
//f.act.value="view";
|
||||
f.id_documento.value=id;
|
||||
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
function riordino()
|
||||
{
|
||||
var f = document.main;
|
||||
if(confirm("Verrà effettuato il riordino di magazzino per l'articolo. Vuoi continuare?"))
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="riordinoMag";
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function apriReport() {
|
||||
$( "#selReport" ).dialog( "open" );
|
||||
}
|
||||
104
rus/admin/contab/_js/coave-documento.js
Normal file
104
rus/admin/contab/_js/coave-documento.js
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
// JavaScript Document
|
||||
//script ad hoc solo per coave documento
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
//stacca servizio e lo rende fatturabile nuovament
|
||||
////////////////////////////////////////////
|
||||
function staccaServizio(id_rigaDocumento)
|
||||
{
|
||||
|
||||
checkBoxes();
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verra' dissociato il servizio alla fattura. Il servizio sara' poi nuovamente fatturabile. Vuoi continuare?"))
|
||||
{
|
||||
//Ab.popUp("ELAB_SC");
|
||||
f.cmd.value="dissociaServizio";
|
||||
f.id_rigaDocumento.value=id_rigaDocumento;
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
////////////////////////////////////////////
|
||||
//salva il solo dato della banca in cui anticipo
|
||||
//perché devo salvare anche quando la fattura è stampata
|
||||
////////////////////////////////////////////
|
||||
function salvaAnticipo()
|
||||
{
|
||||
|
||||
Ab.fetch("Documento.abl", "cmd=aggiornaBancaAnticipo&id_documento=" + $("#id_documento").val() + "&id_bancaAnticipo=" + $("#id_bancaAnticipo").val(), "messaggi");
|
||||
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//allinea da fattura a servizi
|
||||
//
|
||||
function allineaServiziDaProforma() {
|
||||
var f = document.main;
|
||||
|
||||
if (confirm('Vuoi aggiornare i servizi dal dettaglio della fattura?')) {
|
||||
f.cmd.value="allineaServiziDaProforma";
|
||||
f.act.value="";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
//allinea da fattura a servizi
|
||||
//
|
||||
function allineaProformaConPrezziServizi() {
|
||||
var f = document.main;
|
||||
|
||||
if (confirm('Vuoi aggiornare i servizi dal dettaglio della fattura?')) {
|
||||
f.cmd.value="allineaProformaConPrezziServizi";
|
||||
f.act.value="";
|
||||
f.action=f.actionPage.value;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
//sul campio da bozza a proforma a fattura
|
||||
//azzero numero
|
||||
function onChangeFlgStato()
|
||||
{
|
||||
$("#progDocumento").val("");
|
||||
$("#progDocumentoAgg").val("");
|
||||
$("#id_esercizio").val("");
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//allinea da servizi a fattura
|
||||
//
|
||||
|
||||
function refreshDocumento()
|
||||
{
|
||||
|
||||
var l_flgPagamentoDataFissa=prendiElementoDaId("flgPagamentoDataFissa");
|
||||
var l_tipoPagamento=prendiElementoDaId("id_tipoPagamento");
|
||||
var l_dataScadenzaPagamento=prendiElementoDaId("dataScadenzaPagamento");
|
||||
var l_dataScadenzaPagamentoDP=prendiElementoDaId("dataScadenzaPagamentoDP");
|
||||
|
||||
var f = document.main;
|
||||
if(l_flgPagamentoDataFissa.value>0)
|
||||
{
|
||||
l_tipoPagamento.disabled="disabled";
|
||||
l_tipoPagamento.value="";
|
||||
l_dataScadenzaPagamento.disabled="";
|
||||
l_dataScadenzaPagamentoDP.style.display="inline";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
l_tipoPagamento.disabled="";
|
||||
l_dataScadenzaPagamento.value="";
|
||||
l_dataScadenzaPagamento.disabled="disabled";
|
||||
l_dataScadenzaPagamentoDP.style.display="none";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
906
rus/admin/contab/_js/coave-servizioDF.js
Normal file
906
rus/admin/contab/_js/coave-servizioDF.js
Normal file
|
|
@ -0,0 +1,906 @@
|
|||
// pkg_servizioStd
|
||||
|
||||
///////////////////////////////////////////
|
||||
////////T O O L B A R /////////////////////
|
||||
///////////////////////////////////////////
|
||||
$(function() {
|
||||
$( "#tipoFattura" ).dialog({
|
||||
autoOpen: false,
|
||||
width: 400,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100,
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#tipoFattura" ).dialog("option", "title", "SELEZIONE TIPO DI DOCUMENTO");
|
||||
//
|
||||
$( "#listaFatture" ).dialog({
|
||||
autoOpen: false,
|
||||
width: 400,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100,
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#listaFatture" ).dialog("option", "title", "DOCUMENTI CREATI");
|
||||
});
|
||||
|
||||
function formSearching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="";
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="search";
|
||||
f.pageNumber.value=1;
|
||||
//f.submit();
|
||||
}
|
||||
function searching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
formSearching();
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function modifyCommand(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=webApp+"/admin/serv/ServizioStd.abl";
|
||||
f.cmd.value="md";
|
||||
//f.act.value="view";
|
||||
f.id_servizioStd.value=id;
|
||||
|
||||
//Ab.submitAj("main");
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function deleteCommandCR(id,l_tmst)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="delCR";
|
||||
f.cmd.value="asq";
|
||||
f.lastUpdTmst.value=l_tmst;
|
||||
f.id_servizioStd.value=id;
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function deleteCommandCR(id)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
f.id_servizioStd.value=id;
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function deleteCommand()
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function refresh()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.act.value="refresh";
|
||||
//f.currentTab.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
//R per required
|
||||
//isNum per numerico
|
||||
//isNumKey è una chiave.. uguale a isNum>0 ma cambio il messaggio
|
||||
//isNum>x per numerico maggiore di x
|
||||
//isNum<x per numerico minore di x
|
||||
//isEmail per indirizzo email
|
||||
//inRange1:10 per ..
|
||||
//3 stringhe
|
||||
//1: nome del field
|
||||
//2: se '' visualizza il nome del field, altrimenti questo campo
|
||||
//3: R/N+''/isNum/isEmail/inRangea:b
|
||||
|
||||
return Ab.validateForm('numeroRichiesta','Numero Richiesta','R','id_cliente','Cliente','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
Ab.setChekBoxValue("main","flgCartello","1","0");
|
||||
Ab.setChekBoxValue("main","flgPadre","1","0");
|
||||
Ab.setChekBoxValue("main","flgStampaCornice","1","0");
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab. Ab.setRadioButtonValue("main","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("main","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab. Ab.setRadioButtonValue("main","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
function generaFattura()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verra' generata la fattura relativa. Sei Sicuro?"))
|
||||
if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="GENFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancellaFattura()
|
||||
{
|
||||
if(confirm("Verra' cancellata la fattura relativa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="DELFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function stampaFattura()
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
var f = document.main;
|
||||
if(f.id_documentoxStampa.value==0)
|
||||
{
|
||||
alert('Fattura non ancora creata');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=ft&id_servizioStd="+f.id_servizioStd.value;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Fattura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancellaFattura()
|
||||
{
|
||||
if(confirm("Verra' cancellata la fattura relativa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="DELFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
$('#stampa').dialog( "open" );
|
||||
}
|
||||
|
||||
function printCommandCli()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docCli');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
function printCommandFor()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docFor');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
function printCommandAut()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docAut');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
function mailCommand()
|
||||
{
|
||||
//var f = document.main;
|
||||
// stampaDocumento(f.id_servizioStd.value, 'docFor');
|
||||
//Ab.modalWin=dhtmlwindow.open('Ab.modalW', 'div', 'mail', "Stampa Voucher ", 'width=420px,height=100px,left=400px,top=250px,resize=0,scrolling=0');
|
||||
|
||||
$('#mail').dialog( "open" );
|
||||
}
|
||||
function mailCommandCli()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_cliente.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo cliente!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docCli";
|
||||
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//alert(f.emailAlternativa.value);
|
||||
f.action=f.actionPage.value;
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
function mailCommandFor()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_fornitore.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo fornitore!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docFor";
|
||||
f.action=f.actionPage.value;
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
function mailCommandAut()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_autista.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo Autista!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docAut";
|
||||
f.action=f.actionPage.value;
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function stampaDocumento(id,tipo)
|
||||
{
|
||||
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
if(id>0)
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act="+tipo+"&id_servizioStd="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Servizio","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function dup()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
//var msg=Ab.prendiElementoDaId("msgDup").value
|
||||
var msg="Il servizio verrà duplicato. Vuoi continuare?";
|
||||
if(confirm(msg))
|
||||
{
|
||||
//if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="dup";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function caricaListinoCliente()
|
||||
{
|
||||
// se ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_cliente.value!="" && f.id_cliente.value!="0" && f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CL";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
//f.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function caricaListinoFornitore()
|
||||
{
|
||||
// se ho fornitore, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_fornitore.value!="" && f.id_fornitore.value!="0" && f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CLF";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function vediListinoCliente()
|
||||
{
|
||||
//sse ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if( $('#id_tipoServizio').val()!="0" || $('#id_tipoMezzo').val()!="")
|
||||
{
|
||||
//Ab.modalW("Vedi Listino",webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoCliente&id_tipoServizio="+f.id_tipoServizio.value+"&id_tipoMezzo="+f.id_tipoMezzo.value, 650, 300);
|
||||
$('#jQueryWIN').dialog( "option", "width", 700 );
|
||||
$('#jQueryWIN').dialog( "option", "height", 500 );
|
||||
$( "#jQueryWIN" ).dialog("option", "title", "Listini Disponibili");
|
||||
$('#jQueryWIN').load(webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoCliente&id_tipoServizio="+$('#id_tipoServizio').val()+"&id_tipoMezzo="+$('#id_tipoMezzo').val()).dialog( "open" );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
}
|
||||
|
||||
function vediListinoFornitore()
|
||||
{
|
||||
//sse ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if( f.id_tipoServizio.value!="0" || f.id_tipoMezzo.value!="")
|
||||
{
|
||||
//Ab.modalW("Vedi Listino",webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoFornitore&id_tipoServizio="+f.id_tipoServizio.value+"&id_tipoMezzo="+f.id_tipoMezzo.value, 650, 300);
|
||||
$('#jQueryWIN').dialog( "option", "width", 700 );
|
||||
$('#jQueryWIN').dialog( "option", "height", 500 );
|
||||
$("#jQueryWIN").dialog("option", "title", "Listini Disponibili");
|
||||
$('#jQueryWIN').load(webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoFornitore&id_tipoServizio="+$('#id_tipoServizio').val()+"&id_tipoMezzo="+$('#id_tipoMezzo').val()).dialog( "open" );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
function mailCommandCRCli()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docCliCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
|
||||
}
|
||||
function mailCommandCRFor()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docForCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
function mailCommandCRAut()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docAutCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function duplica() {
|
||||
var v = document.duplica;
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Vuoi duplicare il servizio?"))
|
||||
{
|
||||
f.dataInizio.value = v.dataInizio.value;
|
||||
f.dataFine.value = v.dataFine.value;
|
||||
|
||||
//alert("DI: "+f.dataInizio.value+" DF: "+f.dataFine.value);
|
||||
|
||||
f.cmd.value="dupDate";
|
||||
f.act.value=""
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function dupDate() {
|
||||
$( "#duplica" ).dialog( "open" );
|
||||
}
|
||||
|
||||
function applicaTariffaNotturna() {
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
f.tariffa.value = f.tariffaNotturna.value;
|
||||
f.action = f.actionPage.value;
|
||||
f.cmd.value = "asq";
|
||||
f.act.value = "save";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function applicaTariffaDiurna() {
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
f.tariffa.value = f.tariffaDiurna.value;
|
||||
f.action = f.actionPage.value;
|
||||
f.cmd.value = "asq";
|
||||
f.act.value = "save";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function checkDateRicerca() {
|
||||
|
||||
var now = new Date();
|
||||
var ret = 1;
|
||||
|
||||
//alert($("#dataInizio").val());
|
||||
|
||||
if ($("#dataDa").val()!='') {
|
||||
var from = $("#dataDa").val().split("/");
|
||||
var dataInizio = new Date(from[2], from[1] - 1, from[0]);
|
||||
|
||||
if(from[2]!='') {
|
||||
|
||||
if (dataInizio.getFullYear()!=now.getFullYear()) {
|
||||
if (confirm("L'anno inserito nella data di inizio non corrisponde con quello attuale, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
// controllo indietro di tre giorni
|
||||
now.SustractDays(3);
|
||||
|
||||
if (dataInizio.getTime() < now.getTime()){
|
||||
if (confirm("Il giorno inserito nella data di inizio e' inferiore di tre giorni dalla data odierna, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
}
|
||||
// controllo avanti di ventotto giorni
|
||||
now = new Date();
|
||||
now.SustractDays(-28);
|
||||
|
||||
if (dataInizio.getTime() > now.getTime()){
|
||||
if (confirm("Il giorno inserito nella data di inizio e' superiore di ventotto giorni dalla data odierna, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == true) {
|
||||
if ($("#dataFine").val()!='') {
|
||||
var from = $("#dataFine").val().split("/");
|
||||
var dataFine = new Date(from[2], from[1] - 1, from[0]);
|
||||
|
||||
|
||||
if(from[2]!='') {
|
||||
if (dataFine.getFullYear()!=now.getFullYear()) {
|
||||
if (confirm("L'anno inserito nella data di fine non corrisponde con quello attuale, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
now = new Date();
|
||||
now.SustractDays(3);
|
||||
|
||||
if (dataFine.getTime() < now.getTime()){
|
||||
if (confirm("Il giorno inserito nella data di fine e' inferiore di tre giorni dalla data odierna, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// controllo avanti di ventotto giorni
|
||||
now = new Date();
|
||||
now.SustractDays(-28);
|
||||
|
||||
if (dataFine.getTime() > now.getTime()){
|
||||
if (confirm("Il giorno inserito nella data di fine e' superiore di ventotto giorni dalla data odierna, vuoi continuare?")) {
|
||||
//alert("ok");
|
||||
ret = 1;
|
||||
} else {
|
||||
//alert("annulla");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//alert(ret);
|
||||
|
||||
return ret==1?true:false;
|
||||
|
||||
//return ret;
|
||||
}
|
||||
|
||||
Date.prototype.SustractDays = function (days)
|
||||
{
|
||||
this.setTime(this.getTime() - days * 86400000 );
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
//// se ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
////////////////////////////////////
|
||||
function caricaListini()
|
||||
{
|
||||
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CLA";
|
||||
f.act.value="";
|
||||
f.currentFocus.value="descrizioneMezzo";
|
||||
Ab.submitAj("main");
|
||||
//f.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function closeStampa() {
|
||||
$('#stampa').dialog("close");
|
||||
}
|
||||
|
||||
function closeMail() {
|
||||
$('#mail').dialog("close");
|
||||
}
|
||||
|
||||
function printCartello()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
|
||||
if (f.id_allegatoClifor.value!=0) {
|
||||
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=cartello"+"&id_servizioStd="+f.id_servizioStd.value;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Cartello","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
/*} else {
|
||||
alert('Selezionare il modello di stampa!');
|
||||
}*/
|
||||
} else {
|
||||
alert("Inserire il modello da stampare!");
|
||||
}
|
||||
}
|
||||
|
||||
function saveAj()
|
||||
{
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
if (checkFields())
|
||||
{
|
||||
$("#main").attr("action",$("#actionPage").val());
|
||||
$("#main input[name=cmd]").val("asq");
|
||||
$("#main input[name=act]").val("save");
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R','flgTipoAllegato','Tipo Allegato','RisNumKey','descrizioneAllegato','Descrizione Allegato','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
f.submit();
|
||||
//Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoServizio.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function addPadre() {
|
||||
$('#padre').dialog('open');
|
||||
}
|
||||
|
||||
function addServizioPadre(l_id) {
|
||||
var f = document.main;
|
||||
//f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
//f.cmd.value="addServizioPadre";
|
||||
f.id_servizioPadre.value=l_id;
|
||||
|
||||
saveCommand();
|
||||
//Ab.submitAj('main');
|
||||
//f.submit();
|
||||
//$('#padre').dialog('close');
|
||||
}
|
||||
|
||||
function pregeneraFatture() {
|
||||
// check dei servizi selezionati
|
||||
var id_servizi = 0;
|
||||
Ab.setChekBoxValue("main","flgIgnoraRiferimentiDiversi","1","0");
|
||||
$("input[name^='ckflgServizio_']").each(function() {
|
||||
// faccio la lista dei servizi selezionati da passare alla servlet
|
||||
if (this.checked) {
|
||||
id_servizi += 1;
|
||||
}
|
||||
});
|
||||
// apro la dialog oppure mando un messaggio di errore
|
||||
if (id_servizi>0) {
|
||||
$("#tipoFattura").dialog("open");
|
||||
} else {
|
||||
alert("Selezionare almeno un servizio.");
|
||||
}
|
||||
}
|
||||
|
||||
function generaFatture()
|
||||
{
|
||||
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?"))
|
||||
{
|
||||
f.cmd.value="GENFATTDF";
|
||||
|
||||
$("#flgStato").val($("#flgStatoD").val());
|
||||
$("#id_tipoDocumento").val($("#id_tipoDocumentoD").val());
|
||||
|
||||
var id_servizi = "";
|
||||
$("input[name^='ckflgServizio_']").each(function() {
|
||||
// faccio la lista dei servizi selezionati da passare alla servlet
|
||||
if (this.checked) {
|
||||
var id = this.name.replace("ckflgServizio_", "");
|
||||
|
||||
id_servizi += id + ",";
|
||||
}
|
||||
});
|
||||
|
||||
f.id_servizi.value = id_servizi;
|
||||
|
||||
f.action=f.actionPage.value;
|
||||
//data emissione
|
||||
$("#dataEmissioneDocumento").val($("#dataED").val())
|
||||
Ab.popUp('ELAB')
|
||||
Ab.submitAj("main", null, null, "listaFatture()");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati mancanti!");
|
||||
}
|
||||
}
|
||||
|
||||
function selezionaTutto() {
|
||||
var valore = $("#ckflgSelezionaTutto").attr("checked")=="checked"?true:false;
|
||||
|
||||
$("input[id^='ckflgServizio_']").each(function(index, element) {
|
||||
element.checked = valore;
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// callback dopo la generazione delle fatture
|
||||
////////////////////////////////////////
|
||||
function listaFatture()
|
||||
{
|
||||
var listaDocumenti = $("#listaDocumenti").val(),
|
||||
listaDoc = listaDocumenti.split("|");
|
||||
if (listaDoc.length > 1)
|
||||
{
|
||||
var tableFatture = $("#tableFatture"),
|
||||
righe = "";
|
||||
|
||||
for (var i = 0; i < listaDoc.length; i++)
|
||||
{
|
||||
var documento = listaDoc[i].split(";"),
|
||||
riga = "<tr><td><a href='javascript:modifyFattura(" + documento[0] + ")'>" + documento[1] + "</a></td></tr>";
|
||||
|
||||
righe += riga;
|
||||
}
|
||||
|
||||
$(tableFatture).html(righe);
|
||||
|
||||
$("#listaFatture").dialog("open");
|
||||
}
|
||||
else
|
||||
{
|
||||
var documento = listaDoc[0].split(";");
|
||||
//verifico se arriva qualcosa!!!!
|
||||
if(documento[0].length > 1)
|
||||
modifyFattura(documento[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function modifyFattura(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action="Documento.abl";
|
||||
f.cmd.value="md";
|
||||
f.id_documento.value=id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
838
rus/admin/contab/_js/coave-servizioDP.js
Normal file
838
rus/admin/contab/_js/coave-servizioDP.js
Normal file
|
|
@ -0,0 +1,838 @@
|
|||
// pkg_servizioStd
|
||||
|
||||
///////////////////////////////////////////
|
||||
////////T O O L B A R /////////////////////
|
||||
///////////////////////////////////////////
|
||||
$(function() {
|
||||
$( "#tipoFattura" ).dialog({
|
||||
autoOpen: false,
|
||||
width: 400,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100,
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#tipoFattura" ).dialog("option", "title", "SELEZIONE TIPO DI DOCUMENTO");
|
||||
//
|
||||
$( "#listaFatture" ).dialog({
|
||||
autoOpen: false,
|
||||
width: 400,
|
||||
show: {
|
||||
effect: "blind",
|
||||
duration: 100,
|
||||
},
|
||||
/*hide: {
|
||||
effect: "explode",
|
||||
duration: 1000
|
||||
}*/
|
||||
});
|
||||
$( "#listaFatture" ).dialog("option", "title", "DOCUMENTI CREATI");
|
||||
});
|
||||
|
||||
function formSearching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="";
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="search";
|
||||
f.pageNumber.value=1;
|
||||
//f.submit();
|
||||
}
|
||||
function searching()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
formSearching();
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function report()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.flgReport.value="S";
|
||||
//f.action=webApp+"/tr/Pratica.abl";
|
||||
f.cmd.value="search";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function modifyCommand(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=webApp+"/admin/serv/ServizioStd.abl";
|
||||
f.cmd.value="md";
|
||||
//f.act.value="view";
|
||||
f.id_servizioStd.value=id;
|
||||
|
||||
//Ab.submitAj("main");
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function deleteCommandCR(id,l_tmst)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="delCR";
|
||||
f.cmd.value="asq";
|
||||
f.lastUpdTmst.value=l_tmst;
|
||||
f.id_servizioStd.value=id;
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function deleteCommandCR(id)
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
f.id_servizioStd.value=id;
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function deleteCommand()
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.act.value="del";
|
||||
f.cmd.value="asq";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function refresh()
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="md";
|
||||
f.act.value="refresh";
|
||||
//f.currentTab.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
//R per required
|
||||
//isNum per numerico
|
||||
//isNumKey è una chiave.. uguale a isNum>0 ma cambio il messaggio
|
||||
//isNum>x per numerico maggiore di x
|
||||
//isNum<x per numerico minore di x
|
||||
//isEmail per indirizzo email
|
||||
//inRange1:10 per ..
|
||||
//3 stringhe
|
||||
//1: nome del field
|
||||
//2: se '' visualizza il nome del field, altrimenti questo campo
|
||||
//3: R/N+''/isNum/isEmail/inRangea:b
|
||||
|
||||
return Ab.validateForm('numeroRichiesta','Numero Richiesta','R','id_cliente','Cliente','RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////7
|
||||
function checkSearchFields()
|
||||
/////////////////////////////////////////////7
|
||||
{
|
||||
if(document.main.crNS==1)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//return Ab.validateForm('descrizione','Descrizione','R','numero','Numero','RisNum>0','eMail','','NisEmail');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkBoxes()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
Ab.setChekBoxValue("main","flgCartello","1","0");
|
||||
Ab.setChekBoxValue("main","flgPadre","1","0");
|
||||
Ab.setChekBoxValue("main","flgStampaCornice","1","0");
|
||||
}
|
||||
|
||||
function checkRadio()
|
||||
{
|
||||
//Ab. Ab.setRadioButtonValue("main","flgPlaAntPos");
|
||||
}
|
||||
|
||||
function checkBoxesCR()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
//Ab.setChekBoxValue("main","flgSommaCRL","1","0");
|
||||
}
|
||||
|
||||
function checkRadioCR()
|
||||
{
|
||||
//Ab. Ab.setRadioButtonValue("main","flgPlaAntPos");
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addRow()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('id_rowBean','RowBean','R'))
|
||||
{
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addRow";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function delRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function modRow(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="modRow";
|
||||
f.id_rowBean.value=l_id;
|
||||
Ab.submitAj("main");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function generaFattura()
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Verra' generata la fattura relativa. Sei Sicuro?"))
|
||||
if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="GENFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancellaFattura()
|
||||
{
|
||||
if(confirm("Verra' cancellata la fattura relativa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="DELFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
function stampaFattura()
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
var f = document.main;
|
||||
if(f.id_documentoxStampa.value==0)
|
||||
{
|
||||
alert('Fattura non ancora creata');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=ft&id_servizioStd="+f.id_servizioStd.value;
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Fattura","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancellaFattura()
|
||||
{
|
||||
if(confirm("Verra' cancellata la fattura relativa. Sei Sicuro?"))
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="DELFATT";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function printCommand()
|
||||
{
|
||||
$('#stampa').dialog( "open" );
|
||||
}
|
||||
|
||||
function printCommandCli()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docCli');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
function printCommandFor()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docFor');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
function printCommandAut()
|
||||
{
|
||||
var f = document.main;
|
||||
stampaDocumento(f.id_servizioStd.value, 'docAut');
|
||||
closeStampa();
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
function mailCommand()
|
||||
{
|
||||
//var f = document.main;
|
||||
// stampaDocumento(f.id_servizioStd.value, 'docFor');
|
||||
//Ab.modalWin=dhtmlwindow.open('Ab.modalW', 'div', 'mail', "Stampa Voucher ", 'width=420px,height=100px,left=400px,top=250px,resize=0,scrolling=0');
|
||||
|
||||
$('#mail').dialog( "open" );
|
||||
}
|
||||
function mailCommandCli()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_cliente.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo cliente!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docCli";
|
||||
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//alert(f.emailAlternativa.value);
|
||||
f.action=f.actionPage.value;
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
function mailCommandFor()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_fornitore.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo fornitore!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docFor";
|
||||
f.action=f.actionPage.value;
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
function mailCommandAut()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
if(f.id_autista.value==0 && $('#emailAlt').val()=='') {
|
||||
alert('Impossibile inviare la mail! Compilare il campo Autista!');
|
||||
} else {
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docAut";
|
||||
f.action=f.actionPage.value;
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
$('#flgCartello').val($('#ckFlgCartello').val()=="on"?1:0);
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function stampaDocumento(id,tipo)
|
||||
{
|
||||
|
||||
if(id!=0)
|
||||
{
|
||||
var f = document.main;
|
||||
if(id>0)
|
||||
|
||||
{
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act="+tipo+"&id_servizioStd="+id;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Servizio","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(theAction);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function dup()
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
//var msg=Ab.prendiElementoDaId("msgDup").value
|
||||
var msg="Il servizio verrà duplicato. Vuoi continuare?";
|
||||
if(confirm(msg))
|
||||
{
|
||||
//if (checkFields())
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="dup";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function caricaListinoCliente()
|
||||
{
|
||||
// se ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_cliente.value!="" && f.id_cliente.value!="0" && f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CL";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
//f.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function caricaListinoFornitore()
|
||||
{
|
||||
// se ho fornitore, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_fornitore.value!="" && f.id_fornitore.value!="0" && f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CLF";
|
||||
f.act.value="";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function vediListinoCliente()
|
||||
{
|
||||
//sse ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if( $('#id_tipoServizio').val()!="0" || $('#id_tipoMezzo').val()!="")
|
||||
{
|
||||
//Ab.modalW("Vedi Listino",webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoCliente&id_tipoServizio="+f.id_tipoServizio.value+"&id_tipoMezzo="+f.id_tipoMezzo.value, 650, 300);
|
||||
$('#jQueryWIN').dialog( "option", "width", 700 );
|
||||
$('#jQueryWIN').dialog( "option", "height", 500 );
|
||||
$( "#jQueryWIN" ).dialog("option", "title", "Listini Disponibili");
|
||||
$('#jQueryWIN').load(webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoCliente&id_tipoServizio="+$('#id_tipoServizio').val()+"&id_tipoMezzo="+$('#id_tipoMezzo').val()).dialog( "open" );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
}
|
||||
|
||||
function vediListinoFornitore()
|
||||
{
|
||||
//sse ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
|
||||
var f = document.main;
|
||||
if( f.id_tipoServizio.value!="0" || f.id_tipoMezzo.value!="")
|
||||
{
|
||||
//Ab.modalW("Vedi Listino",webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoFornitore&id_tipoServizio="+f.id_tipoServizio.value+"&id_tipoMezzo="+f.id_tipoMezzo.value, 650, 300);
|
||||
$('#jQueryWIN').dialog( "option", "width", 700 );
|
||||
$('#jQueryWIN').dialog( "option", "height", 500 );
|
||||
$("#jQueryWIN").dialog("option", "title", "Listini Disponibili");
|
||||
$('#jQueryWIN').load(webApp+"/admin/serv/ListinoServizioStd.abl?cmd=vediListinoFornitore&id_tipoServizio="+$('#id_tipoServizio').val()+"&id_tipoMezzo="+$('#id_tipoMezzo').val()).dialog( "open" );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
function mailCommandCRCli()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docCliCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
|
||||
}
|
||||
function mailCommandCRFor()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docForCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
function mailCommandCRAut()
|
||||
{
|
||||
var f = document.main;
|
||||
f.cmd.value="mail";
|
||||
f.act.value="docAutCR"
|
||||
$('#emailAlternativa').val($('#emailAlt').val());
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function duplica() {
|
||||
var v = document.duplica;
|
||||
|
||||
var f = document.main;
|
||||
|
||||
if(confirm("Vuoi duplicare il servizio?"))
|
||||
{
|
||||
f.dataInizio.value = v.dataInizio.value;
|
||||
f.dataFine.value = v.dataFine.value;
|
||||
|
||||
//alert("DI: "+f.dataInizio.value+" DF: "+f.dataFine.value);
|
||||
|
||||
f.cmd.value="dupDate";
|
||||
f.act.value=""
|
||||
f.action=f.actionPage.value;
|
||||
|
||||
//Ab.popUp('ELAB')
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
function dupDate() {
|
||||
$( "#duplica" ).dialog( "open" );
|
||||
}
|
||||
|
||||
function applicaTariffaNotturna() {
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
f.tariffa.value = f.tariffaNotturna.value;
|
||||
f.action = f.actionPage.value;
|
||||
f.cmd.value = "asq";
|
||||
f.act.value = "save";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
function applicaTariffaDiurna() {
|
||||
var f = document.main;
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
f.tariffa.value = f.tariffaDiurna.value;
|
||||
f.action = f.actionPage.value;
|
||||
f.cmd.value = "asq";
|
||||
f.act.value = "save";
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
//// se ho cliente, tipo mezzo e tipo servizio allora posso caricare il listino...
|
||||
////////////////////////////////////
|
||||
function caricaListini()
|
||||
{
|
||||
|
||||
|
||||
var f = document.main;
|
||||
if(f.id_tipoServizio.value!="" && f.id_tipoMezzo.value!="")
|
||||
{
|
||||
if (checkFields())
|
||||
{
|
||||
f.action=f.actionPage.value;
|
||||
f.cmd.value="CLA";
|
||||
f.act.value="";
|
||||
f.currentFocus.value="descrizioneMezzo";
|
||||
Ab.submitAj("main");
|
||||
//f.submit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati insufficienti!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function closeStampa() {
|
||||
$('#stampa').dialog("close");
|
||||
}
|
||||
|
||||
function closeMail() {
|
||||
$('#mail').dialog("close");
|
||||
}
|
||||
|
||||
function printCartello()
|
||||
{
|
||||
var f = document.main;
|
||||
|
||||
|
||||
if (f.id_allegatoClifor.value!=0) {
|
||||
|
||||
var debug=false;
|
||||
var wwD="700";
|
||||
var whD="500";
|
||||
//+"&xxx="+f.xxx.value
|
||||
theAction=f.actionPage.value+".pdf?cmd=print&act=cartello"+"&id_servizioStd="+f.id_servizioStd.value;
|
||||
//
|
||||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||||
if(debug==false)
|
||||
{
|
||||
window.open(theAction, "Stampa_Cartello","width="+wwD+",height="+whD+",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
}
|
||||
/*} else {
|
||||
alert('Selezionare il modello di stampa!');
|
||||
}*/
|
||||
} else {
|
||||
alert("Inserire il modello da stampare!");
|
||||
}
|
||||
}
|
||||
|
||||
function saveAj()
|
||||
{
|
||||
checkBoxes();
|
||||
checkRadio();
|
||||
if (checkFields())
|
||||
{
|
||||
$("#main").attr("action",$("#actionPage").val());
|
||||
$("#main input[name=cmd]").val("asq");
|
||||
$("#main input[name=act]").val("save");
|
||||
Ab.submitAj("main");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
function addAllegato()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
if (Ab.validateForm('nomeFile','Nome File','R','flgTipoAllegato','Tipo Allegato','RisNumKey','descrizioneAllegato','Descrizione Allegato','R'))
|
||||
{
|
||||
checkBoxes();
|
||||
f.cmd.value="gr";
|
||||
f.act.value="addAllegato";
|
||||
f.submit();
|
||||
//Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
|
||||
function delAllegato(l_id)
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
if (Ab.confirmDelete())
|
||||
{
|
||||
var f = document.main;
|
||||
f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value="gr";
|
||||
f.act.value="delAllegato";
|
||||
f.id_allegatoServizio.value=l_id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function addPadre() {
|
||||
$('#padre').dialog('open');
|
||||
}
|
||||
|
||||
function addServizioPadre(l_id) {
|
||||
var f = document.main;
|
||||
//f.action=f.actionPage.value;
|
||||
// FACCIO IL SUBMIT
|
||||
//f.cmd.value="addServizioPadre";
|
||||
f.id_servizioPadre.value=l_id;
|
||||
|
||||
saveCommand();
|
||||
//Ab.submitAj('main');
|
||||
//f.submit();
|
||||
//$('#padre').dialog('close');
|
||||
}
|
||||
|
||||
function pregeneraFattureAcquisto() {
|
||||
// check dei servizi selezionati
|
||||
var id_servizi = 0;
|
||||
$("input[name^='ckflgServizio_']").each(function() {
|
||||
// faccio la lista dei servizi selezionati da passare alla servlet
|
||||
if (this.checked) {
|
||||
id_servizi += 1;
|
||||
}
|
||||
});
|
||||
// apro la dialog oppure mando un messaggio di errore
|
||||
if (id_servizi>0) {
|
||||
$("#tipoFattura").dialog("open");
|
||||
} else {
|
||||
alert("Selezionare almeno un servizio.");
|
||||
}
|
||||
}
|
||||
|
||||
function generaFattureAcquisto()
|
||||
{
|
||||
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?"))
|
||||
{
|
||||
f.cmd.value="GENFATTDP";
|
||||
|
||||
$("#flgStato").val($("#flgStatoD").val());
|
||||
$("#id_tipoDocumento").val($("#id_tipoDocumentoD").val());
|
||||
|
||||
var id_servizi = "";
|
||||
$("input[name^='ckflgServizio_']").each(function() {
|
||||
// faccio la lista dei servizi selezionati da passare alla servlet
|
||||
if (this.checked) {
|
||||
var id = this.name.replace("ckflgServizio_", "");
|
||||
|
||||
id_servizi += id + ",";
|
||||
}
|
||||
});
|
||||
|
||||
f.id_servizi.value = id_servizi;
|
||||
|
||||
f.action=f.actionPage.value;
|
||||
//data emissione
|
||||
$("#dataEmissioneDocumento").val($("#dataED").val())
|
||||
Ab.popUp('ELAB')
|
||||
Ab.submitAj("main", null, null, "listaFatture()");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Dati mancanti!");
|
||||
}
|
||||
}
|
||||
|
||||
function selezionaTutto() {
|
||||
var valore = $("#ckflgSelezionaTutto").attr("checked")=="checked"?true:false;
|
||||
|
||||
$("input[id^='ckflgServizio_']").each(function(index, element) {
|
||||
element.checked = valore;
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
// callback dopo la generazione delle fatture
|
||||
////////////////////////////////////////
|
||||
function listaFatture()
|
||||
{
|
||||
var listaDocumenti = $("#listaDocumenti").val(),
|
||||
listaDoc = listaDocumenti.split("|");
|
||||
if (listaDoc.length > 1)
|
||||
{
|
||||
var tableFatture = $("#tableFatture"),
|
||||
righe = "";
|
||||
|
||||
for (var i = 0; i < listaDoc.length; i++)
|
||||
{
|
||||
var documento = listaDoc[i].split(";"),
|
||||
riga = "<tr><td><a href='javascript:modifyFattura(" + documento[0] + ")'>" + documento[1] + "</a></td></tr>";
|
||||
|
||||
righe += riga;
|
||||
}
|
||||
|
||||
$(tableFatture).html(righe);
|
||||
|
||||
$("#listaFatture").dialog("open");
|
||||
}
|
||||
else
|
||||
{
|
||||
var documento = listaDoc[0].split(";");
|
||||
//verifico se arriva qualcosa!!!!
|
||||
if(documento[0].length > 1)
|
||||
modifyFattura(documento[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function modifyFattura(id)
|
||||
{
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action="Documento.abl";
|
||||
f.cmd.value="md";
|
||||
f.id_documento.value=id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue