First commit
This commit is contained in:
parent
cf97b64877
commit
cc69770608
1468 changed files with 265316 additions and 128 deletions
21
www/admin/contab/_js/_inc_documento_testa.js
Normal file
21
www/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
www/admin/contab/_js/acxent-distintaRiba.js
Normal file
82
www/admin/contab/_js/acxent-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);
|
||||
}
|
||||
}
|
||||
234
www/admin/contab/_js/acxent-documentiFigli.js
Normal file
234
www/admin/contab/_js/acxent-documentiFigli.js
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
/****************************************/
|
||||
/* DOCUMENTI FIGLI SCRIPT MAIN CONTAB
|
||||
/****************************************/
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// 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);
|
||||
$('#modalJsp').modal('show');
|
||||
$("#modalJsp").load(f.actionPage.value + "?cmd=creaDocFigliS&id_tipoDocumento=" + l_id_tipoDocumento);
|
||||
|
||||
|
||||
//$('#modalJsp .modal-title').html("Crea documento figlio");
|
||||
//$('#modalJsp').modal('show');
|
||||
//$('#modalJsp .modal-body').load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
/*$(".dummyCreaDoc").load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, function () {
|
||||
$('#modalJsp .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;
|
||||
$('#modalJsp').modal('show');
|
||||
$("#modalJsp").load(f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
|
||||
|
||||
//$('#modalJsp .modal-title').html("Crea documento figlio");
|
||||
//$('#modalJsp').modal('show');
|
||||
//$('#modalJsp .modal-body').load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
/*$(".dummyCreaDoc").load($("#actionPage").val() + "?cmd=creaDocFigliS&id_documento=" + l_id_documento, function () {
|
||||
$('#modalJsp .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;
|
||||
$('#modalJsp').modal('show');
|
||||
$("#modalJsp").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
|
||||
//alert('pio: '+f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
$('#modalJsp').modal('show');
|
||||
$("#modalJsp").load(f.actionPage.value + "?cmd=creaDocFigliS&id_documento=" + l_id_documento);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// INVIO COMANDO DI CREAZIONE DOCUMENTO FIGLIO
|
||||
/////////////////////////////////////////////
|
||||
function creaDocFiglio(l_id_documento) {
|
||||
//alert('xxccccc');
|
||||
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")) {
|
||||
$('#modalJsp').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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// INVIO COMANDO DI CREAZIONE DOCUMENTO FIGLIO da ddt a ft tessitura
|
||||
/////////////////////////////////////////////
|
||||
function creaFattureDaDDtTessitura(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")) {
|
||||
$('#modalJsp').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);
|
||||
//creaFattureDaDDtTessitura
|
||||
//
|
||||
f.cmd.value = "creaFattureDaDDtTessituraThread";
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
3110
www/admin/contab/_js/acxent-documento.js
Normal file
3110
www/admin/contab/_js/acxent-documento.js
Normal file
File diff suppressed because it is too large
Load diff
1420
www/admin/contab/_js/acxent-documento23072013.js
Normal file
1420
www/admin/contab/_js/acxent-documento23072013.js
Normal file
File diff suppressed because it is too large
Load diff
151
www/admin/contab/_js/acxent-documentoAutonoleggioXXXX.js
Normal file
151
www/admin/contab/_js/acxent-documentoAutonoleggioXXXX.js
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
// 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";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
/* report pdf e fatturato ncc*/
|
||||
/************************************************/
|
||||
/************************************************/
|
||||
function reportPdfNcc() {
|
||||
var tipoReport = $("#flgTipoReportC").val();
|
||||
if (tipoReport != 5)
|
||||
{
|
||||
|
||||
reportPdf();}
|
||||
else {
|
||||
$("#modalReport").modal("hide");
|
||||
setTimeout(function () {
|
||||
{
|
||||
$("#flgTipoReport").val(tipoReport);
|
||||
report();
|
||||
}
|
||||
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/***** vecchia versione NON lte **/
|
||||
|
||||
function apriReport() {
|
||||
$("#selReport").dialog("open");
|
||||
}
|
||||
|
||||
function elaboraReport() {
|
||||
var rep = document.rep;
|
||||
var tipoReport = rep.flgTipoReportC.value;
|
||||
if (tipoReport != 5)
|
||||
reportPdf();
|
||||
else {
|
||||
report();
|
||||
}
|
||||
|
||||
}
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* fa una chiamata asincrona per creare il report servizi NCCcsv
|
||||
/* il CR lo prendo dalla sessione*/
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
|
||||
function reportServizi()
|
||||
{
|
||||
//fetch(servlet, command, divList, postProcess, async, type)
|
||||
Ab.fetch("../contab/Documento.abl", "cmd=creaReportServiziCsv", "fileCsv",null,1);
|
||||
|
||||
}
|
||||
21
www/admin/contab/_js/acxent-documentoCash.js
Normal file
21
www/admin/contab/_js/acxent-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");
|
||||
/////////////////////////////////////////////
|
||||
|
||||
});
|
||||
369
www/admin/contab/_js/acxent-documentoFilato.js
Normal file
369
www/admin/contab/_js/acxent-documentoFilato.js
Normal file
|
|
@ -0,0 +1,369 @@
|
|||
/////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
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");
|
||||
}
|
||||
debugger;
|
||||
|
||||
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', 'id_articoloFilatoColore', 'Filato', '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')))
|
||||
|
||||
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', 'Cliente/Fornitore', 'R', 'id_articoloFilatoColore', 'Filato', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0');
|
||||
}
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???*/
|
||||
function checkFilatoA() {
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale', 'Seriale articolo', 'R'))
|
||||
return false;
|
||||
//alert('A');
|
||||
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', 'Cliente/Fornitore', 'RisNumKey', 'id_articoloFilatoColore', 'Filato', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// 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() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* DETTAGLIO filati da RIGAFILATO2 (sportyex) */
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function dettaglioArticoliFilatiRF2(l_id) {
|
||||
/*
|
||||
var f = document.main;
|
||||
theAction=webApp+"/admin/art/Articolo.abl?cmd=viewM&id_articolo="+l_id;
|
||||
wArticolo=window.open(theAction, "Lista_Varianti","width=810,height=600,status=yes,resizable=yes,top=100,left=100,scrollbars=yes");
|
||||
wArticolo.focus();
|
||||
*/
|
||||
|
||||
$(".mov-body").load("../filato/ArticoloFilatoColore.abl?cmd=dettaglioDisponibilita&id_articoloFilato=" + l_id);
|
||||
|
||||
$("#modalMov").modal("show");
|
||||
|
||||
|
||||
}
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* aggoinge riga filato a disposizione tessitura */
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function addRigaFilatoDtess2()
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//FILATO SOLO KG!!!!!!!
|
||||
|
||||
|
||||
$("#quantita2").val($("#kgF2").val());
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkFilatoDtess2F();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkFilatoDtess2C();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkFilatoDtess2A();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaFilato2";
|
||||
//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 checkFilatoDtess2F() {
|
||||
//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
|
||||
|
||||
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', 'quantita2', 'quantita2', 'RisNum>0');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkFilatoDtess2C() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale2', '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', 'descrizioneRiga2', 'Articolo', 'R', 'quantita', 'quantita2', 'RisNum>0', 'id_iva2', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???*/
|
||||
function checkFilatoDtess2A() {
|
||||
//alert('A');
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articolo2', 'Articolo', 'RisNumKey', 'quantita2', 'quantita', 'RisNum>0', 'id_iva2', 'codice iva', 'RisNumKey');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* dall'elenco dei filati necessari du un tessuto, carico i campi per l'inserimento(sportex) */
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function sceltaFilatoNecessario2(l_id) {
|
||||
|
||||
$("#kgF2").val($("#kg_necessari2_" + l_id).val());
|
||||
$("#descrizioneRiga2").val($("#descrizioneFilatoNecessario2_" + l_id).val());
|
||||
$("#id_articoloFilatoColore2").val("");
|
||||
var e = jQuery.Event("keydown");
|
||||
e.which = 13; // # Some key code value
|
||||
e.keyCode = 13
|
||||
$("#descrizioneRiga2").trigger(e);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
// onFocusDescRigaFilato2 Dispotess sportex
|
||||
// determina che succede quando arriva il focus su descriga
|
||||
// deve andare sulla qta giusta. Si attiva dopo il CR
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function onFocusDescRigaFilato2() {
|
||||
//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.flgUsaSeriale2.value == 1 && document.main.flgTipologia.value != 3) {
|
||||
$("#descrizioneRiga2").select();
|
||||
//Ab.prendiElementoDaId('descrizioneRiga').select();
|
||||
//beep();
|
||||
} else {
|
||||
//Ab.prendiElementoDaId('quantita').focus() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
50
www/admin/contab/_js/acxent-documentoListaPre.js
Normal file
50
www/admin/contab/_js/acxent-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');
|
||||
}
|
||||
478
www/admin/contab/_js/acxent-documentoPagamento.js
Normal file
478
www/admin/contab/_js/acxent-documentoPagamento.js
Normal file
|
|
@ -0,0 +1,478 @@
|
|||
/*** 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) {
|
||||
Ab.swalError('Errore',"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');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
che roba e'
|
||||
**/
|
||||
|
||||
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;
|
||||
|
||||
Ab.fetch(url, cmd, "lista");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function loadList() {
|
||||
loadListInit();
|
||||
$("#importo").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)) {
|
||||
Ab.swalError('Errore',"Importo maggiore dell'importo residuo! Importo immesso: " + importoRigo + " Importo residuo: " + importoResiduo);
|
||||
$(that).val(0);
|
||||
//$(that).focus();
|
||||
} else if (importoRigo > saldoRigo) {
|
||||
Ab.swalError('Errore',"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) {
|
||||
Ab.swalError('Attenzione',"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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
/* il modifica su clifor va in dettaglio *
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
function modificaClifor() {
|
||||
|
||||
if ($("#id_clifor").val() != "" && $("#id_clifor").val() != "0") {
|
||||
var f = document.main;
|
||||
f.action = "../anag/Clifor.abl";
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value = "md";
|
||||
f.act.value = "";
|
||||
Ab.submitAj('main');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
/* print pdf *
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
function printPdf()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
/* file csv*
|
||||
/******************************************/
|
||||
/******************************************/
|
||||
function fileCsv() {
|
||||
//fetch(servlet, command, divList, postProcess, async, type)
|
||||
Ab.fetch("../contab/DocumentoPagamento.abl", "cmd=creaFileCvs", "fileCsv", null, 1);
|
||||
|
||||
}
|
||||
913
www/admin/contab/_js/acxent-documentoPre.js
Normal file
913
www/admin/contab/_js/acxent-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
www/admin/contab/_js/acxent-documentoRic.js
Normal file
1943
www/admin/contab/_js/acxent-documentoRic.js
Normal file
File diff suppressed because it is too large
Load diff
988
www/admin/contab/_js/acxent-documentoRip - Copia.js
Normal file
988
www/admin/contab/_js/acxent-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
www/admin/contab/_js/acxent-documentoRip.js
Normal file
829
www/admin/contab/_js/acxent-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();
|
||||
}
|
||||
364
www/admin/contab/_js/acxent-documentoScadenza.js
Normal file
364
www/admin/contab/_js/acxent-documentoScadenza.js
Normal file
|
|
@ -0,0 +1,364 @@
|
|||
// 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.fire({
|
||||
title: "Sei sicuro?",
|
||||
text: "Vuoi creare le distinte relative agli importi selezionati?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
var f = document.main;
|
||||
f.action = f.actionPage.value;
|
||||
f.cmd.value = "creaDistinta";
|
||||
Ab.submitAj('main');
|
||||
////////////////////////////////////////////////////////////////////
|
||||
} else if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
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.fire({
|
||||
title: "Sei sicuro?",
|
||||
text: "I dati saranno cancellati. Vuoi continuare?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
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');
|
||||
////////////////////////////////////////////////////////////////////
|
||||
} else if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
389
www/admin/contab/_js/acxent-documentoTaglio.js
Normal file
389
www/admin/contab/_js/acxent-documentoTaglio.js
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
/* 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() {
|
||||
if ($("#id_articolo").val() == 0 || $("#id_articolo").val() == "") {
|
||||
alert("articolo non trovato");
|
||||
} else {
|
||||
$("#currentFocus").val("id_taglia");
|
||||
refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function checkArticoloTrovato() {
|
||||
if ($("#id_articolo").val() == 0 || $("#id_articolo").val() == "") {
|
||||
|
||||
Ab.setFocus("descrizioneRiga");
|
||||
setTimeout(function () {
|
||||
{
|
||||
swal("Attenzione!", "Articolo non trovato", "error")
|
||||
|
||||
}
|
||||
|
||||
}, 100);
|
||||
|
||||
//alert("articolo non trovato");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
//
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function calcolaTessutiTaglio() {
|
||||
|
||||
if ($("#id_magFisicoPartenza2").val() == 0) {
|
||||
swal("Attenzione!", "Impostare una Magazzino di partenza tessuto", "warning")
|
||||
} else {
|
||||
|
||||
Swal.fire({
|
||||
title: "Calcola Necessita' Tessuti per taglio",
|
||||
text: "In base agli articoli scelti, vengono scaricati i tessuti necessari. Sei Sicuro?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//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 if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* 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 () {
|
||||
$('#modalJsp .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.fire({
|
||||
title: "Associazione Ordini Taglio",
|
||||
text: "Verranno Associati gli Ordini di Taglio Selezionati. Sei Sicuro?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
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 if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
}, 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.fire({
|
||||
title: "Nuovo Articolo",
|
||||
text: "Crei un nuovo articolo?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
$("#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 if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/*****************************************/
|
||||
/* 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');
|
||||
|
||||
}
|
||||
776
www/admin/contab/_js/acxent-documentoTessuto.js
Normal file
776
www/admin/contab/_js/acxent-documentoTessuto.js
Normal file
|
|
@ -0,0 +1,776 @@
|
|||
|
||||
|
||||
/**********************************************/
|
||||
/**********************************************/
|
||||
/* PER ?? STANDARD SU RIGA TESSUTO...*/
|
||||
/**********************************************/
|
||||
/**********************************************/
|
||||
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());
|
||||
if ($("#quantita").val() == 0) {
|
||||
$("#quantita").val($("#mtT").val());
|
||||
}
|
||||
if ($("#quantita").val() == 0) {
|
||||
$("#quantita").val($("#nrT").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 ($("#isMagPartenza").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#isMagArrivo").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";
|
||||
}
|
||||
//
|
||||
var checkMag = true;
|
||||
if ($("#isMagPartenza").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#isMagArrivo").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
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');
|
||||
var checkMag = true;
|
||||
if ($("#isMagPartenza").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoPartenza', 'Magazzino Partenza', 'RisNumKey');
|
||||
}
|
||||
|
||||
if (checkMag) {
|
||||
if ($("#isMagArrivo").val() == "true") {
|
||||
checkMag = Ab.validateForm('id_magFisicoArrivo', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
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() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************************/
|
||||
/**********************************************/
|
||||
/* PER LAVORAZIONI TESSITURA (INSINNA)*/
|
||||
/**********************************************/
|
||||
/**********************************************/
|
||||
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', 'numColpiDM', 'Numero Colpi Al dm', '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);
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* STAMPA CODICI A BARRE LAV. TESSITURA (INSINNA)
|
||||
/******************************************/
|
||||
/*******************************************/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* ordina per tela (insinna) */
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function ordinaPerTela() {
|
||||
Swal.fire({
|
||||
title: "Ordina righe documento per tela ",
|
||||
text: "Sei Sicuro?",
|
||||
icon: "warning",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: `Si`,
|
||||
denyButtonText: `No`,
|
||||
cancelButtonText: `Annulla`,
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
$("#main").attr("action", $("#actionPage").val());
|
||||
//$("#flgReport").val("S");
|
||||
$("#cmd", "#main").val("ordinaRighePerTela");
|
||||
$("#act", "#main").val("");
|
||||
$("#cmd2").val("");
|
||||
$("#id_documento").val($("#id_documento").val());
|
||||
//$("#pageNumber").val("1");
|
||||
Ab.submitAj('main');
|
||||
////////////////////////////////////////////////////////////////////
|
||||
} else if (result.isDenied) {
|
||||
//Swal.fire('Changes are not saved', '', 'info')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* add riga tessuto disposizione per tessitura (sportex)*/
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function addRigaTessutoDispoTessuto() {
|
||||
//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);
|
||||
|
||||
//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 = checkTessutoFDISPO();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoCDISPO();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoADISPO();
|
||||
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
|
||||
caso lavorazioni*/
|
||||
function checkTessutoFDISPO() {
|
||||
|
||||
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) {
|
||||
if (Ab.validateFormMandatory($("#lang").val())) {
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'id_articoloTessuto', 'Tessuto', 'RisNumKey', 'id_colore', 'Colore', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti
|
||||
per lavorazioni*/
|
||||
function checkTessutoCDISPO() {
|
||||
//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')))
|
||||
if (Ab.validateFormMandatory($("#lang").val())) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'R', 'id_articoloTessuto', 'Tessuto', 'RisNumKey', 'id_colore', 'Colore', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'numColpiDM', 'Numero Colpi Al dm', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a altro???
|
||||
caso lavorazione*/
|
||||
function checkTessutoADISPO() {
|
||||
//alert('A');
|
||||
if (Ab.validateFormMandatory($("#lang").val())) {
|
||||
return Ab.validateForm('id_clifor', 'Cliente/Fornitore', 'RisNumKey', 'id_articoloTessuto', 'Tessuto', 'RisNumKey', 'id_colore', 'Colore', 'RisNumKey', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
/* dispo tess. scelgo il tessuto per poter inserire i filati (sportex)*/
|
||||
/*******************************************/
|
||||
/*******************************************/
|
||||
function sceltaTessuto(l_id) {
|
||||
var f = document.main;
|
||||
//checkBoxes();
|
||||
f.action = f.actionPage.value;
|
||||
//f.action=$("#actionPage", "#main").val();
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value = "sceltaTessuto";
|
||||
f.id_rigaDocumento.value = l_id;
|
||||
//f.flgCaricaArticoli.value=1;
|
||||
// Ab.submitAj('main');
|
||||
//sweetAlert("aaaaa");
|
||||
Ab.submitAj('main');
|
||||
//sweetAlert("aaaaa");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* aggiunge riga tessuto a lavorazione tessuto*/
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function addRigaTessutoLavTessuto()
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//FILATO SOLO KG!!!!!!!
|
||||
|
||||
if ($("#flgUdm").val() == 2)
|
||||
$("#quantita").val($("#kgT").val());
|
||||
else if ($("#flgUdm").val() == 3)
|
||||
$("#quantita").val($("#mtT").val());
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoLavTessutoF();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoLavTessutoC();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoLavTessutoA();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto";
|
||||
//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 checkTessutoLavTessutoF() {
|
||||
//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
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkTessutoLavTessutoC() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale2', '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', 'descrizioneRiga2', 'Articolo', 'R', 'quantita', 'quantita', 'RisNum>0', 'id_iva', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* aggiunge riga tessuto a lavorazione tessuto*/
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* aggiunge riga tessuto a lavorazione tessuto 2*/
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function addRigaTessutoLavTessuto2()
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
//alert(f.flgTipologia.value);
|
||||
//alert(f.flgClienteFornitore.value);
|
||||
//aggiorniamo la quantiaa
|
||||
//FILATO SOLO KG!!!!!!!
|
||||
//alert($("#flgUdm2").val());
|
||||
|
||||
if ($("#flgUdm2").val() == 2)
|
||||
$("#quantita2").val($("#kgT2").val());
|
||||
else if ($("#flgUdm2").val() == 3)
|
||||
$("#quantita2").val($("#mtT2").val());
|
||||
|
||||
|
||||
//CONTROLLO CAMPI OBBLIGATORI
|
||||
|
||||
if (f.flgClienteFornitore.value == "F")
|
||||
cf = checkTessutoLavTessutoF2();
|
||||
else if (f.flgClienteFornitore.value == "C")
|
||||
cf = checkTessutoLavTessutoC2();
|
||||
else if (f.flgClienteFornitore.value == "A")
|
||||
cf = checkTessutoLavTessutoA2();
|
||||
else {
|
||||
cf = false;
|
||||
alert("ERRORE! Tipo documento no valido");
|
||||
}
|
||||
|
||||
|
||||
if (cf) {
|
||||
f.cmd.value = "addRigaTessuto2";
|
||||
//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 checkTessutoLavTessutoF2() {
|
||||
//alert('f');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale2.value == 1 && document.main.flgTipologia2.value != 3 && !Ab.validateForm('seriale2', 'Lotto', 'R'))
|
||||
return false;
|
||||
//imponibile in rosso
|
||||
|
||||
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_magFisicoArriv2o', 'Magazzino Arrivo', 'RisNumKey');
|
||||
}
|
||||
}
|
||||
if (checkMag) {
|
||||
|
||||
return Ab.validateForm('id_clifor', 'Fornitore', 'RisNumKey', 'quantita2', 'quantita2', 'RisNum>0');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* campi obbligatori per documenti a clienti*/
|
||||
function checkTessutoLavTessutoC2() {
|
||||
//alert('C');
|
||||
var f = document.main;
|
||||
if (f.flgUsaSeriale.value == 1 && document.main.flgTipologia.value != 3 && !Ab.validateForm('seriale2', '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', 'descrizioneRiga2', 'Articolo', 'R', 'quantita2', 'quantita2', 'RisNum>0', 'id_iva2', 'codice iva', 'RisNumKey');
|
||||
// else
|
||||
// return false;
|
||||
}
|
||||
|
||||
277
www/admin/contab/_js/acxent-documentoTessuto2xxxxx.js
Normal file
277
www/admin/contab/_js/acxent-documentoTessuto2xxxxx.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');
|
||||
|
||||
}
|
||||
54
www/admin/contab/_js/acxent-documento_TEX.js
Normal file
54
www/admin/contab/_js/acxent-documento_TEX.js
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
// JavaScript Document
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* MOSTRA DETTAGLIO PEZZE su popup */
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function mostraPezze(l_id) {
|
||||
|
||||
|
||||
$(".pezze-body").load("../lav/LavTessitura.abl?cmd=dettaglioPezze&id_documento=" + l_id);
|
||||
|
||||
|
||||
$("#modalPezze").modal("show");
|
||||
|
||||
/*
|
||||
$( "#dettaglioWin" ).dialog("option", "title", "Dettaglio Articolo Varianti");
|
||||
$("#dettaglioWin").load("Articolo.abl?cmd=viewM&id_articolo="+l_id);
|
||||
$("#dettaglioWin").dialog("open");
|
||||
*/
|
||||
}
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
/* dettaglio documento se unico....*/
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function mostraDocumento(id) {
|
||||
//FACCIO IL SUBMIT
|
||||
var f = document.main;
|
||||
f.action = "../contab/Documento.abl";
|
||||
f.cmd.value = "md";
|
||||
f.id_documento.value = id;
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
// mostra documento che nasconde la modal
|
||||
/***********************************************/
|
||||
/***********************************************/
|
||||
function mostraDocumentoDaModalPezze(id) {
|
||||
|
||||
$("#modalPezze").modal("hide");
|
||||
setTimeout(function () {
|
||||
{
|
||||
mostraDocumento(id);
|
||||
|
||||
}
|
||||
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
316
www/admin/contab/_js/acxent-movimento.js
Normal file
316
www/admin/contab/_js/acxent-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);
|
||||
}
|
||||
46
www/admin/contab/_js/acxent-registroIva.js
Normal file
46
www/admin/contab/_js/acxent-registroIva.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// javascript per gestione campi obbligatori///
|
||||
// //
|
||||
|
||||
|
||||
///////////////////////////////////////////
|
||||
////////T O O L B A R /////////////////////
|
||||
///////////////////////////////////////////
|
||||
|
||||
function refreshxxxx() {
|
||||
checkBoxes();
|
||||
var f = document.dettaglio;
|
||||
// FACCIO IL SUBMIT
|
||||
f.cmd.value = "search";
|
||||
f.act.value = "refresh";
|
||||
|
||||
f.submit();
|
||||
|
||||
}
|
||||
|
||||
/********************************************************/
|
||||
/********************************************************/
|
||||
/* registro iva */
|
||||
/********************************************************/
|
||||
/********************************************************/
|
||||
function registroIva() {
|
||||
|
||||
{
|
||||
|
||||
var f = document.main;
|
||||
f.action = f.actionPage.value;
|
||||
|
||||
|
||||
if (Ab.validateForm('dataDa', 'Data da', 'R','dataA', 'Data a', 'R')) {
|
||||
|
||||
|
||||
if (f.flgDefinitivo.value == "0" || f.flgDefinitivo.value == "" || (f.flgDefinitivo.value == "1" && confirm("Sei sicuro di fare la stampa definitiva?"))) {
|
||||
|
||||
f.cmd.value = "stampaRegistroIva";
|
||||
f.act.value = "";
|
||||
|
||||
Ab.submitAj('main');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
177
www/admin/contab/_js/acxent-rigaDocumento.js
Normal file
177
www/admin/contab/_js/acxent-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" );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue