4528 lines
127 KiB
JavaScript
4528 lines
127 KiB
JavaScript
// javascript per gestione campi obbligatori///
|
||
$(function () {
|
||
/*$( "#selReport" ).dialog({
|
||
autoOpen: false,
|
||
show: {
|
||
effect: "blind",
|
||
duration: 100
|
||
},
|
||
|
||
});
|
||
*/
|
||
//$( "#selReport" ).dialog("option", "title", "Seleziona Tipo Report");
|
||
|
||
|
||
$("#dettaglioWin").dialog({
|
||
autoOpen: false,
|
||
width: 800,
|
||
height: 300,
|
||
show: {
|
||
effect: "blind",
|
||
duration: 100
|
||
},
|
||
/*hide: {
|
||
effect: "explode",
|
||
duration: 1000
|
||
}*/
|
||
});
|
||
$("#dettaglioWin").dialog("option", "title", "Riordino Articolo");
|
||
});
|
||
|
||
|
||
/////////////////////////////////////////////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;
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/***********************************************/
|
||
/***********************************************/
|
||
/* apri finestra selezione report */
|
||
/***********************************************/
|
||
/***********************************************/
|
||
function apriReport() {
|
||
$("#selReport").modal("show");
|
||
//$( "#selReport" ).dialog( "open" );
|
||
}
|
||
/***********************************************/
|
||
/***********************************************/
|
||
/* apri finestra selezione report */
|
||
/***********************************************/
|
||
/***********************************************/
|
||
function chiudiReport() {
|
||
|
||
$("#selReport").modal("hide");
|
||
|
||
}
|
||
|
||
|
||
/**************************************************/
|
||
/**************************************************/
|
||
// chiamata per fare i report di inventario dalla CR
|
||
/**************************************************/
|
||
/**************************************************/
|
||
function reportContinua() {
|
||
//FACCIO IL SUBMIT
|
||
var f = document.main;
|
||
|
||
|
||
//scrivo l'operatore selezionato dalla combo nel campo nascosto della form dettaglio
|
||
f.flgTipoReport.value = $("#flgTipoReportC").val();
|
||
|
||
//checkBoxesCR();
|
||
if (f.flgTipoReport.value != "3") {
|
||
f.flgReport.value = "S";
|
||
//f.flgRiordino.value=0;
|
||
} else {
|
||
f.flgReport.value = "";
|
||
//f.flgRiordino.value=1;
|
||
}
|
||
$("#selReport").modal("hide");
|
||
if (f.flgTipoReport.value == "10" || f.flgTipoReport.value == "11") {
|
||
creaReportUsato();
|
||
} else {
|
||
report();
|
||
}
|
||
}
|
||
/**************************************************/
|
||
/**************************************************/
|
||
/* report usato */
|
||
/**************************************************/
|
||
/**************************************************/
|
||
function creaReportUsato() {
|
||
|
||
|
||
setTimeout(function () {
|
||
{
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
//+"&xxx="+f.xxx.value
|
||
f.cmd.value = "reportPdf";
|
||
f.dataDocumentoUsatoA.value = $("#dataDocumentoUsatoAP").val();
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
//
|
||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
////////////////////////////////////////////
|
||
// fa una chiamata asincrona per creare il report csv
|
||
// il CR lo prendo dalla sessione
|
||
////////////////////////////////////////////////////
|
||
function reportCsv() {
|
||
//fetch(servlet, command, divList, postProcess, async, type)
|
||
Ab.fetch("../art/Articolo.abl", "cmd=creaReportCsv", "fileCsv", null, 1);
|
||
|
||
}
|
||
|
||
/////////////////////////////////////////////7
|
||
function checkFields()
|
||
/////////////////////////////////////////////7
|
||
{
|
||
//alert($("#descrizioneTecnica_it").val());
|
||
//gestione euro sul campo nome
|
||
var l_nome = Ab.prendiElementoDaId("nome");
|
||
l_nome.value = l_nome.value.replace(/<2F>/ig, "<22>");
|
||
return Ab.validateForm('id_articolo', 'Codice Articolo', 'R', 'id_tipo', 'Tipo', 'RisNum>0', 'id_iva', 'Iva', 'RisNum>0', 'nome', 'Nome Articolo', 'R');
|
||
|
||
}
|
||
|
||
|
||
function checkBoxes()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
Ab.setChekBoxValue('main', 'flgAggGiacenza', '1', '0');
|
||
Ab.setChekBoxValue("main", "flgRC", "1", "0");
|
||
Ab.setChekBoxValue("main", "flgAbituale", "1", "0");
|
||
//Ab.setChekBoxValue('main','flgRiordino','1','0');
|
||
}
|
||
|
||
//////////////////////////////////////////
|
||
/////////////////////////////////////////////////
|
||
//////////////////////////////////////////////////
|
||
function addCaratteristica()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('id_caratteristica', 'Caratteristica', 'R')) {
|
||
checkBoxes();
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addCaratteristica";
|
||
//f.flgRiga.value="A";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
|
||
function delCaratteristica(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delCaratteristica";
|
||
f.id_caratteristica.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function modifyCaratteristica(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "modCaratteristica";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshCaratteristica";
|
||
f.id_caratteristica.value = l_id;
|
||
//f.flgRiga.value="A";
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
//////////////////////////////////////////////////
|
||
function addFornitore()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('id_clifor', 'Fornitore', 'R')) {
|
||
checkBoxes();
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addFornitore";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
|
||
function delFornitore(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Swal.fire({
|
||
title: "Cancellazione Prezzo Fornitore",
|
||
text: "Verra' cancellato l'ultimo prezzo registrato per il fornitore. 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("gr");
|
||
$("#act", "#main").val("delFornitore");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
$("#id_articoloFornitore").val(l_id);
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
function modifyFornitore(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "modFornitore";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshFornitore";
|
||
f.id_articoloFornitore.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
|
||
//////////////////////////////////////////////////
|
||
function addAccessorio()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
//alert('primo');
|
||
var f = document.main;
|
||
//alert('secondo');
|
||
Ab.setChekBoxValue('main', 'flgEstendiVariante', '1', '0');
|
||
//alert('terzo');
|
||
checkBoxes();
|
||
//alert('quarto');
|
||
//Ab.validateForm('id_articoloVariante','Fornitore','R'))
|
||
if (Ab.validateForm('id_articolo', 'Articolo Non salvato', 'RisNum>0', 'id_articoloAssociato', 'Articolo Associato', 'RisNum>0', 'id_tipoAccessorio', 'Tipo Accessorio', 'RisNum>0'))
|
||
//if (Ab.validateForm('id_articolo','Articolo Non salvato','RisNum>0'))
|
||
{
|
||
|
||
//alert('quinto');
|
||
if (f.id_articoloAssociato.value == f.id_articolo.value)
|
||
alert("Impossibile associare l'articolo a se stesso");
|
||
else {
|
||
//alert('sesto');
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addAcce";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
}
|
||
|
||
function delAccessorio(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delAcce";
|
||
f.id_accessorio.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
//////////////////////////////////////////////////
|
||
function addDispo()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
//Ab.validateForm('id_articoloVariante','Fornitore','R'))
|
||
if (Ab.validateForm('id_articoloVarianteD', 'Variante', 'RisNum>0', 'id_tagliaD', 'Taglia', 'RisNum>0')) {
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addDispo";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function delDispo(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delDispo";
|
||
f.id_disponibilita.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function modifyDispo(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "modDispo";
|
||
f.id_disponibilita.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
|
||
function caricaCaratt()
|
||
/////////////////////////////////////////////
|
||
{
|
||
//FACCIO IL SUBMIT
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "md";
|
||
f.act.value = "refreshCC";
|
||
//f.currentTab.value="";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function caricaCarattTipo()
|
||
/////////////////////////////////////////////
|
||
{
|
||
//FACCIO IL SUBMIT
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "caricaCarattTipo";
|
||
|
||
//f.currentTab.value="";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function caricaCarattArti()
|
||
/////////////////////////////////////////////
|
||
{
|
||
//FACCIO IL SUBMIT
|
||
if ($("#id_articoloSource").val() > 0) {
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "caricaCarattArti";
|
||
|
||
//f.currentTab.value="";
|
||
Ab.submitAj('main');
|
||
} else {
|
||
Ab.swalError("Carica Caratteristiche da articolo sorgente", "Inserire un id dell'articolo sorgente");
|
||
|
||
}
|
||
}
|
||
|
||
|
||
function copiaCaratt()
|
||
/////////////////////////////////////////////
|
||
{
|
||
//FACCIO IL SUBMIT
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "md";
|
||
f.act.value = "refreshCopyC";
|
||
//f.currentTab.value="";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function visibilita() {
|
||
var f = document.main;
|
||
|
||
if (confirm("Verra impostata la visibilita' di tutti gli articoli con il criterio di ricerca selezionato. Vuoi Continuare?")) {
|
||
//FACCIO IL SUBMIT
|
||
|
||
f.action = f.actionPage.value;
|
||
f.act.value = "vis";
|
||
f.cmd.value = "search";
|
||
//f.lastUpdTmst.value=l_tmst;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
/////////////////////////////////////////////////
|
||
//////////////////////////////////////////////////
|
||
function addVariante() {
|
||
var f = document.main;
|
||
checkBoxes();
|
||
//alert(f.flgUsaVarianti.value);
|
||
if (f.flgUsaVarianti.value == 1 && checkFields()) {
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "ni";
|
||
f.act.value = "";
|
||
f.action = "../art/ArticoloVariante.abl";
|
||
f.currentTab.value = "";
|
||
Ab.submitAj('main');
|
||
} else
|
||
alert('Articolo senza varianti');
|
||
|
||
}
|
||
/////////////////////////////////////////////////
|
||
|
||
|
||
function delVariante(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delVariante";
|
||
f.id_articoloVariante.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
f.currentTab.value = "";
|
||
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
function modVariante(id) {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
//checkBoxes();
|
||
f.cmd.value = "md";
|
||
f.act.value = "";
|
||
f.act2.value = "";
|
||
f.id_articoloVariante.value = id;
|
||
//alert("idav="+f.id_articoloVariante.value);
|
||
f.action = "../art/ArticoloVariante.abl";
|
||
f.currentTab.value = "";
|
||
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
|
||
function hideAll() {
|
||
popDown("DES");
|
||
popDown("IMG");
|
||
popDown("CAR");
|
||
popDown("VAR");
|
||
popDown("ACC");
|
||
popDown("FOR");
|
||
Ab.popUp("CLEAN");
|
||
|
||
|
||
}
|
||
|
||
function showTab2(l_layer, l_layerPrev) {
|
||
//la funzione hideAll deve essere definita!!!
|
||
hideAll();
|
||
|
||
alert('pio');
|
||
obj = document.getElementById(l_layer).style;
|
||
obj.pixelLeft = "-660px";
|
||
|
||
/*
|
||
document.getElementById(l_layer).style.pixelTop = ;
|
||
alert( document.getElementById(l_layer).style.posTop);
|
||
alert( document.getElementById(l_layer).style.pixelTop);*/
|
||
Ab.popUp(l_layer);
|
||
|
||
}
|
||
|
||
function checkBoxesCR()
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.setChekBoxValue("main", "flgQta", "1", "0");
|
||
Ab.setChekBoxValue("main", "flgShowCostoAcquisto", "1", "0");
|
||
Ab.setChekBoxValue("main", "flgShowDeleteLogic", "1", "0");
|
||
}
|
||
|
||
function checkRadioCR() {
|
||
//Ab.setRadioButtonValue("ricerca","flgPlaAntPos");
|
||
|
||
}
|
||
|
||
/////////////////////////////////////////////////
|
||
//////////////////////////////////////////////////
|
||
function addAllegato()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
if (Ab.validateForm('fileNameOnServer_1', 'File non caricato', 'R')) {
|
||
checkBoxes();
|
||
f.cmd.value = "addAllegato";
|
||
//f.act.value="addAllegato";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function delAllegato(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delAllegato";
|
||
//f.act.value="delAllegato";
|
||
f.id_allegatoArticolo.value = l_id;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
///////////////////////////////////////
|
||
//stampa etichetta articolo dettaglio
|
||
///////////////////////////////////////
|
||
function labelD() {
|
||
|
||
var f = document.main; {
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
|
||
var articolo = document.getElementById('id_articolo').value;
|
||
|
||
//+"&xxx="+f.xxx.value
|
||
theAction = f.actionPage.value + "?cmd=print&act=lblArt" + "&id_articolo=" + articolo;
|
||
|
||
//
|
||
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_Articolo", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
|
||
///////////////////////////////////////
|
||
//stampa etichetta articolo CR
|
||
///////////////////////////////////////
|
||
function labelCR() {
|
||
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" + "&codice=" + f.codice.value + "&searchTxt=" + f.searchTxt.value + "&id_tipo=" + f.id_tipo.value + "&id_marca=" + f.id_marca.value + "&flgStockOfferte=" + f.flgStockOfferte.value + "&flgNascondi=" + f.flgNascondi.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);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
////////////////////////////////////////////
|
||
// metodo che imposta l'utilizzo o meno delle varianti
|
||
////////////////////////////////////////////
|
||
function showEstVar() {
|
||
Ab.setChekBoxValue('main', 'flgEstendiVariante', '1', '0');
|
||
|
||
if ($("#flgUsaVariantiArt").val() == -1)
|
||
$("#flgUsaVarianti").val($("#flgUsaVariantiT").val())
|
||
else
|
||
$("#flgUsaVarianti").val($("#flgUsaVariantiArt").val())
|
||
//
|
||
//SU ACCESSORIO ESTENDI A VARIANTE
|
||
if ($("#flgUsaVarianti").val() == 1) {
|
||
$("#ESTVAR").show(0);
|
||
} else {
|
||
$("#ESTVAR").hide(0);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
|
||
////////////////////////////////////////////
|
||
// metodo che imposta la visibilita' dell'inserimento componenti, ovvero articoli composti da altri artivoli
|
||
////////////////////////////////////////////
|
||
function componenteSiNo() {
|
||
|
||
|
||
//
|
||
if ($("#flgArticoloComponente").val() == 1) {
|
||
$("#LISTA_ARTICOLI_COMPONENTI_ASSOCIATI").show(0);
|
||
$("#AGGIUNGI_COMPONENTE").hide(0);
|
||
} else {
|
||
$("#LISTA_ARTICOLI_COMPONENTI_ASSOCIATI").hide(0);
|
||
$("#AGGIUNGI_COMPONENTE").show(0);
|
||
}
|
||
|
||
|
||
}
|
||
////////////////////////////////////////////
|
||
// copiaAccessori
|
||
////////////////////////////////////////////
|
||
function copiaAccessori() {
|
||
var f = document.main;
|
||
if (Ab.validateForm('id_articoloAssociato', 'Articolo Associato', 'RisNumKey')) {
|
||
if (confirm("Verranno aggiunti tutti gli accessori dall'articolo " + f.descrizioneArticolo.value + ". Sei sicuro?")) {
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "copyAcce";
|
||
//f.currentTab.value="";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
}
|
||
|
||
function labelAccD() {
|
||
var f = document.main;
|
||
|
||
{
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
|
||
var articolo = document.getElementById('id_articolo').value;
|
||
|
||
//+"&xxx="+f.xxx.value
|
||
theAction = f.actionPage.value + "?cmd=print&act=lblArtAcc" + "&id_articolo=" + articolo;
|
||
|
||
//
|
||
var numLabels = prompt("Numero di etichette da stampare", "1");
|
||
var blankLabels = prompt("Numero di etichette da saltare", "0");
|
||
theAction = theAction + "&blankLabels=" + blankLabels + "&numLabels=" + numLabels;
|
||
|
||
//alert(theAction);
|
||
|
||
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 labelAccCR() {
|
||
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" + "&codice=" + f.codice.value + "&searchTxt=" + f.searchTxt.value + "&id_tipo=" + f.id_tipo.value + "&id_marca=" + f.id_marca.value + "&flgStockOfferte=" + f.flgStockOfferte.value + "&flgNascondi=" + f.flgNascondi.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_Accessori_Articolo", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna prezzo di vendita ivato da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaPV(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggPrezzoVenditaCR";
|
||
var idPV = document.getElementById(id + '_prezzoPubblico');
|
||
f.prezzoPubblicoNuovo.value = idPV.value;
|
||
var idCN = document.getElementById(id + '_costoNetto');
|
||
f.costoNetto.value = idCN.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna perc ricarico base da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaPercRicarico(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggPercRicaricoCR";
|
||
var idVal = document.getElementById(id + '_percRicarico');
|
||
f.percRicarico.value = idVal.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna prezzo di vendita a street price da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaPVSP(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggPrezzoVenditaAStreetPriceCR";
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna prezzo di vendita netto (imponibile) da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaPVImponibile(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggPrezzoVenditaImponibileCR";
|
||
var idPV = document.getElementById(id + '_imponibile');
|
||
f.imponibileNuovo.value = idPV.value;
|
||
|
||
//if(!document.getElementById(id+'_prezzoRiv')==null) {
|
||
|
||
|
||
//var idCN=document.getElementById(id+'_costoNuovo');
|
||
//f.costoNetto.value=idCN.value;
|
||
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna costo netto CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaCN(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggCostoNettoCR";
|
||
var idCN = document.getElementById(id + '_costoNetto');
|
||
f.costoNetto.value = idCN.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna costo netto DET*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaCN_Det() {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "aggCostoNettoDet";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* importa prezzo barrato con street price DET*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function impostaPrezzoBarratoDet() {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "impostaPrezzoBarratoDet";
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* aggiorna costo nuovo ovvero aggiorno il costo con quello nuovo e metto prezzo di vendita inbase al ricarico*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function aggiornaCNuovo(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggiornaCNuovo";
|
||
var idCN = document.getElementById(id + '_costoNetto');
|
||
f.costoNetto.value = idCN.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
//////////////////////////////////////////////////
|
||
function addRivalutazione()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('dataRivalutazione', 'data rivalutazione', 'R', 'imponibileRivalutazione', 'importo rivalutazione', 'RisNum>0')) {
|
||
checkBoxes();
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addRivalutazione";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function delRivalutazione(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delRivalutazione";
|
||
f.id_rivalutazione.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function modifyRivalutazione(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
var f = document.main;
|
||
f.cmd.value = "gr";
|
||
f.act.value = "modRivalutazione";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshRivalutazione";
|
||
f.id_rivalutazione.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
|
||
function aggiornaScMin(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "aggScortaMinCR";
|
||
var idQR = document.getElementById(id + '_qtaRiordino');
|
||
f.qtaRiordinoNuovo.value = idQR.value;
|
||
//var idCN=document.getElementById(id+'_costoNuovo');
|
||
//f.costoNetto.value=idCN.value;
|
||
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function riordinoCR(l_id_articolo)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (l_id_articolo == 0) {
|
||
alert("ERRORE! Articolo non valido!");
|
||
return;
|
||
}
|
||
|
||
/*
|
||
$( "#dettaglioWin" ).dialog("option", "title", "Riordino Articolo");
|
||
$("#dettaglioWin").dialog("open");
|
||
$("#dettaglioWin").load("../art/Articolo.abl?cmd=riordinoS&id_articolo="+l_id_articolo);
|
||
*/
|
||
|
||
$("#modalMov").modal("show");
|
||
|
||
$(".mov-body").load("../art/Articolo.abl?cmd=riordinoS&id_articolo=" + l_id_articolo);
|
||
|
||
}
|
||
|
||
function riordinoD()
|
||
/////////////////////////////////////////////
|
||
{
|
||
var f = document.main;
|
||
var l_id_articolo = document.getElementById('id_articolo');
|
||
if (l_id_articolo.value == 0) {
|
||
alert("ERRORE! Articolo non valido!");
|
||
return;
|
||
}
|
||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||
//eventualmente la variante
|
||
//modalW=dhtmlwindow.open('modalW', 'ajax', 'Articolo.abl?cmd=riordinoS', 'Riordino articolo', 'width=650px,height=300px,left=300px,top=100px,resize=1,scrolling=1');
|
||
// modalW("Riordino articolo", "Articolo.abl?cmd=riordinoS&id_articolo="+l_id_articolo.value, 650, 300 );
|
||
|
||
$("#modalMov").modal("show");
|
||
|
||
$(".mov-body").load("../art/Articolo.abl?cmd=riordinoS&id_articolo=" + l_id_articolo.value);
|
||
|
||
/*
|
||
$( "#dettaglioWin" ).dialog("option", "title", "Riordino Articolo");
|
||
$("#dettaglioWin").dialog("open");
|
||
$("#dettaglioWin").load("Articolo.abl?cmd=riordinoS&id_articolo="+l_id_articolo.value);
|
||
*/
|
||
}
|
||
|
||
|
||
function dispoView(l_id_articolo)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
//var l_id_articolo=document.getElementById('id_articolo');
|
||
if (l_id_articolo == 0) {
|
||
alert("ERRORE! Articolo non valido!");
|
||
return;
|
||
}
|
||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||
//eventualmente la variante
|
||
//modalW=dhtmlwindow.open('modalW', 'ajax', 'Articolo.abl?cmd=riordinoS', 'Riordino articolo', 'width=650px,height=300px,left=300px,top=100px,resize=1,scrolling=1');
|
||
modalW("Dettaglio Magazzini", "../art/Disponibilita.abl?cmd=dv&id_articolo=" + l_id_articolo, 505, 300);
|
||
}
|
||
|
||
|
||
function ordiniView(l_id_articolo)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
//var l_id_articolo=document.getElementById('id_articolo');
|
||
if (l_id_articolo == 0) {
|
||
alert("ERRORE! Articolo non valido!");
|
||
return;
|
||
}
|
||
//apro la finestra che mi permette di scegliere il fornitore ed
|
||
//eventualmente la variante
|
||
//modalW=dhtmlwindow.open('modalW', 'ajax', 'Articolo.abl?cmd=riordinoS', 'Riordino articolo', 'width=650px,height=300px,left=300px,top=100px,resize=1,scrolling=1');
|
||
modalW("Dettaglio Ordini", "../contab/RigaDocumento.abl?cmd=ov&id_articolo=" + l_id_articolo, 505, 300);
|
||
}
|
||
|
||
|
||
//////////////////////////////////////////////////
|
||
function addTaglia()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('codiceAT', 'Barcode', 'R', 'id_taglia', 'Taglia', 'RisNum>0')) {
|
||
checkBoxes();
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addArticoloTaglia";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
|
||
function delTaglia(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delArticoloTaglia";
|
||
f.id_articoloTaglia.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
//////////////////////////////////////////////////
|
||
function addTaglie()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
checkBoxes();
|
||
f.cmd.value = "addTaglie";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function impostaQtaRiordino(l_id_articoloVariante)
|
||
/////////////////////////////////////////////
|
||
{
|
||
var qtaRiordino = document.getElementById('qtaRiordino_' + l_id_articoloVariante);
|
||
var qtaDaRiordinare = document.getElementById('qtaDaRiordinare_' + l_id_articoloVariante);
|
||
qtaDaRiordinare.value = qtaRiordino.value;
|
||
|
||
}
|
||
|
||
function riordino()
|
||
/////////////////////////////////////////////
|
||
{
|
||
//chiamata da finestra su articoloCR
|
||
var f = document.main,
|
||
flgUsaVarianti = document.getElementById('flgUsaVarianti');
|
||
|
||
if (flgUsaVarianti.value == 0) {
|
||
//articolo
|
||
var id_articolo = document.getElementById('id_articoloRA');
|
||
var clifor = document.getElementById('id_cliforRA');
|
||
var qta = document.getElementById('qtaDaRiordinare');
|
||
if (clifor.value == "0" || clifor.value == "" || id_articolo == 0 || qta.value <= 0) {
|
||
alert("ERRORE! Fornitore, articolo o quantita' non validi!");
|
||
return;
|
||
}
|
||
if (confirm("Verra' creato un ordine per l'articolo. Sei Sicuro")) {
|
||
f.id_cliforR.value = clifor.value;
|
||
f.qtaR.value = qta.value;
|
||
f.id_articoloR.value = id_articolo.value;
|
||
f.cmd.value = "riordinaCR";
|
||
f.act.value = "";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshRivalutazione";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
} else {
|
||
//articolo variante
|
||
var id_articolo = document.getElementById('id_articoloRA');
|
||
var clifor = document.getElementById('id_cliforRA');
|
||
var qta = getQtaTotVariantiRiordino();
|
||
//alert(qta);
|
||
if (clifor.value == "0" || clifor.value == "" || id_articolo == 0 || qta <= 0) {
|
||
alert("ERRORE! Fornitore, articolo o quantita' non validi!");
|
||
return;
|
||
}
|
||
if (confirm("Verra' creato un ordine per gli articoli variante. Sei Sicuro?")) {
|
||
f.id_cliforR.value = clifor.value;
|
||
f.qtaArticoloVarianteRV.value = getQtaVariantiRiordino();
|
||
f.id_articoloVarianteRV.value = getIdVariantiRiordino();
|
||
f.cmd.value = "riordinaAVCR";
|
||
f.act.value = "";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshRivalutazione";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
//$(".modal-backdrop").remove();
|
||
|
||
$("#modalMov").modal("hide")
|
||
}
|
||
|
||
/* FUNZIONI PER CARICARE GLI ID E LE QTA VARIANTI PER IL RIORDINO*/
|
||
|
||
function getIdVariantiRiordino() {
|
||
var ogg_p = document.getElementsByTagName("input");
|
||
var varianti = "";
|
||
var str = "";
|
||
|
||
for (var i = 0; i < ogg_p.length; i++) {
|
||
|
||
//if(ogg_p[i].name.indexOf('qt_') == 0 && ogg_p[i].value != "")
|
||
if (ogg_p[i].name.indexOf('qtaDaRiordinare_') == 0 && ogg_p[i].value != "") {
|
||
str = ogg_p[i].name
|
||
|
||
if (varianti != "")
|
||
varianti += ";"
|
||
varianti += str.substring(16, str.length);
|
||
|
||
//alert("tag qt: id="+ogg_p[i].id+" "+ ogg_p[i].value+" tot:"+tot);
|
||
}
|
||
}
|
||
|
||
|
||
return varianti;
|
||
}
|
||
|
||
function getQtaVariantiRiordino() {
|
||
var ogg_p = document.getElementsByTagName("input");
|
||
var qta = "";
|
||
|
||
for (var i = 0; i < ogg_p.length; i++) {
|
||
|
||
//if(ogg_p[i].name.indexOf('qt_') == 0 && ogg_p[i].value != "")
|
||
if (ogg_p[i].name.indexOf('qtaDaRiordinare_') == 0 && ogg_p[i].value != "") {
|
||
if (qta != "")
|
||
qta += ";"
|
||
qta += ogg_p[i].value;
|
||
}
|
||
}
|
||
|
||
return qta;
|
||
}
|
||
|
||
function getQtaTotVariantiRiordino() {
|
||
var ogg_p = document.getElementsByTagName("input");
|
||
var tot = 0;
|
||
|
||
for (var i = 0; i < ogg_p.length; i++) {
|
||
|
||
if (ogg_p[i].name.indexOf('qtaDaRiordinare_') == 0 && ogg_p[i].value != "") {
|
||
//alert(ogg_p[i].value);
|
||
tot += parseFloat(ogg_p[i].value.replace(',', '.'));
|
||
//alert("tag qt: id="+ogg_p[i].id+" "+ ogg_p[i].value+" tot:"+tot);
|
||
}
|
||
}
|
||
return tot;
|
||
}
|
||
|
||
//////////////////////////////////////////////////
|
||
function addArticoloComponente()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
//alert('primo');
|
||
var f = document.main;
|
||
|
||
//alert('terzo');
|
||
checkBoxes();
|
||
//alert('quarto');
|
||
//Ab.validateForm('id_articoloVariante','Fornitore','R'))
|
||
if (Ab.validateForm('id_articolo', 'Articolo Non salvato', 'RisNum>0', 'id_articoloComponente', 'Articolo Componente', 'RisNum>0'))
|
||
//if (Ab.validateForm('id_articolo','Articolo Non salvato','RisNum>0'))
|
||
{
|
||
|
||
|
||
{
|
||
//alert('sesto');
|
||
f.cmd.value = "addArticoloComponente";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
}
|
||
|
||
function delArticoloComponente(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delArticoloComponente";
|
||
f.id_articoloArticoloComponente.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
//////////////////////////////////////////////////
|
||
function addListino()
|
||
/////////////////////////////////////////////
|
||
{
|
||
var f = document.main;
|
||
|
||
if (Ab.validateForm('id_listino', 'Listino', 'RisNum>0')) {
|
||
|
||
// controllo esclusivo..
|
||
if (checkCampiListino()) {
|
||
checkBoxes();
|
||
f.cmd.value = "gr";
|
||
f.act.value = "addListinoArticolo";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
}
|
||
|
||
function checkCampiListino() {
|
||
var f = document.main;
|
||
|
||
// alert(f.prezzoLA.value + " - " + f.percLA.value);
|
||
|
||
if ((f.prezzoLA.value != 0 && f.percLA.value != 0) || (f.prezzoLA.value == 0 && f.percLA.value == 0)) {
|
||
alert('Impossibile salvare! Inserire il prezzo o la percentuale!');
|
||
return false;
|
||
} else {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function delListino(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "gr";
|
||
f.act.value = "delListinoArticolo";
|
||
f.id_listinoArticolo.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
/////////////////////////////////
|
||
// funzione richiamata sul document ready
|
||
//in modo da averne uno solo
|
||
///////////////////////////////
|
||
function documentReadyScript() {
|
||
showEstVar();
|
||
componenteSiNo();
|
||
$('.summernote').summernote({
|
||
height: 200 //set editable area's height
|
||
});
|
||
|
||
|
||
/*
|
||
|
||
|
||
$('#summernote').summernote();
|
||
$('#summernote').summernote();
|
||
$('#summernote').summernote();
|
||
|
||
|
||
/*
|
||
sITOR.replace('descrizioneTecnica_');
|
||
CKEDITOR.replace('descrizioneCommerciale_');
|
||
CKEDITOR.replace('descrizioneVetrina_');
|
||
CKEDITOR.replace('altreCompatibilita');
|
||
*/
|
||
|
||
|
||
/*
|
||
$(function () {
|
||
// Replace the <textarea id="editor1"> with a CKEditor
|
||
// instance, using default configuration.
|
||
CKEDITOR.replace('editor');
|
||
//bootstrap WYSIHTML5 - text editor
|
||
$(".textarea").wysihtml5();
|
||
});
|
||
*/
|
||
|
||
//rebuildAllEditor();
|
||
}
|
||
|
||
/////////////////////////////////
|
||
// funzione richiamata sul document ready
|
||
//in modo da averne uno solo
|
||
///////////////////////////////
|
||
function documentReadyScriptCR() {
|
||
//caricaFlagTipoFornitore();
|
||
}
|
||
|
||
|
||
function dettaglioArticoliVarianti(l_id) {
|
||
var f = document.main;
|
||
//alert("kk "+f.descrizioneCli.value);
|
||
theAction = webApp + "/admin/art/Articolo.abl?cmd=view&id_articolo=" + l_id;
|
||
//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();
|
||
}
|
||
|
||
/***********************************************/
|
||
/***********************************************/
|
||
/* DETTAGLIO ARTICOLO VARIANTI su popup */
|
||
/***********************************************/
|
||
/***********************************************/
|
||
function dettaglioArticoliVariantiMov(l_id, l_idAv) {
|
||
/*
|
||
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("../art/Articolo.abl?cmd=viewMRD&id_articolo=" + l_id + "&id_articoloVariante=" + l_idAv);
|
||
|
||
$("#modalMov").modal("show");
|
||
|
||
/*
|
||
$( "#dettaglioWin" ).dialog("option", "title", "Dettaglio Articolo Varianti");
|
||
$("#dettaglioWin").load("Articolo.abl?cmd=viewM&id_articolo="+l_id);
|
||
$("#dettaglioWin").dialog("open");
|
||
*/
|
||
}
|
||
|
||
function cambiaNascondi(l_id, l_flg) {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "cambiaNascondi";
|
||
f.act.value = "";
|
||
f.id_articoloVariante.value = l_id;
|
||
f.flgNascondi.value = l_flg;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
|
||
//var cmd = "cmd=cambiaNascondi&id_articoloVariante="+l_id+"&flgNascondi="+l_flg;
|
||
|
||
//fetch($("#actionPage").val(), cmd, null, null);
|
||
}
|
||
|
||
function cambiaNOrd(l_id, l_flg) {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "cambiaNOrd";
|
||
f.act.value = "";
|
||
f.id_articoloVariante.value = l_id;
|
||
f.flgNonOrdinabile.value = l_flg;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
function closeMW() {
|
||
$("#dettaglioWin").dialog("close");
|
||
}
|
||
|
||
|
||
function aggPrezzoFinale() {
|
||
if ($("#prezzoPubblicoConIva").val() == '' || $("#abbuonoPrezzoPubblico").val() == '') {
|
||
$("#prezzoPubblicoConIvaAbbuono").val("0,00");
|
||
} else {
|
||
var tot = parseFloat($("#prezzoPubblicoConIva").val().replace(",", ".")) - parseFloat($("#abbuonoPrezzoPubblico").val().replace(",", "."));
|
||
tot = tot.toFixed(2);
|
||
|
||
$("#prezzoPubblicoConIvaAbbuono").val(tot.toString().replace(".", ","));
|
||
}
|
||
};
|
||
|
||
|
||
/**
|
||
*
|
||
* funzione precedente alla save che mi imposta le
|
||
* descrizioni passandole dal summernote alla input
|
||
*
|
||
*/
|
||
function preSaveCommand(func, bool) {
|
||
var lang = $("#currentLang").val();
|
||
alert($('#descrizioneTecnica_' + lang).val());
|
||
/* $('#descrizioneTecnica_' + lang).val($('#descrizioneTecnica').summernote('code'));
|
||
$('#descrizioneCommerciale_' + lang).val($('#descrizioneCommerciale').summernote('code'));
|
||
$('#descrizioneVetrina_' + lang).val($('#descrizioneVetrina').summernote('code'));
|
||
$('#altreCompatibilita').val($('#altreCompatibilitaS').summernote('code'));
|
||
*/
|
||
saveCommand(func, bool);
|
||
|
||
|
||
//$('#summernote').summernote('code');
|
||
}
|
||
|
||
|
||
/***********************************************/
|
||
/***********************************************/
|
||
/* DUPLICA ARTICOLO */
|
||
/***********************************************/
|
||
/***********************************************/
|
||
function duplicaArticolo() {
|
||
Swal.fire({
|
||
title: "Duplicazione Articolo",
|
||
text: "Verra' creato un duplicato. Vuoi continuare?",
|
||
icon: "warning",
|
||
showDenyButton: true,
|
||
showCancelButton: false,
|
||
confirmButtonText: `Si`,
|
||
denyButtonText: `No`,
|
||
cancelButtonText: `Annulla`,
|
||
}).then((result) => {
|
||
/* Read more about isConfirmed, isDenied below */
|
||
if (result.isConfirmed) {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "duplicaArticolo";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
|
||
//////////////////////////////////////////////////
|
||
function addProgettista()
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('id_progettista', 'Progettista', 'R')) {
|
||
checkBoxes();
|
||
f.cmd.value = "addProgettista";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function delProgettista(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delProgettista";
|
||
f.act.value = "";
|
||
f.id_articoloProgettista.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function modifyProgettista(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
var f = document.main;
|
||
f.cmd.value = "modProgettista";
|
||
f.act.value = "";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshFornitore";
|
||
f.id_articoloProgettista.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
|
||
|
||
/************************************/
|
||
/************************************/
|
||
/* popup e comando catalogo */
|
||
/************************************/
|
||
/************************************/
|
||
function catalogoPopup(l_id_rigaBolla) {
|
||
|
||
$("#selRisoluzione").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
|
||
function catalogo() {
|
||
|
||
var f = document.main;
|
||
|
||
|
||
//var numBolla = $("#numBolla").val();
|
||
|
||
$("#selRisoluzione").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
//+"&xxx="+f.xxx.value
|
||
f.cmd.value = "stampaCatalogo";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/** COMANDI PER INSERIRE TESSUTO PER CONFEZIONI
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function addTessutoConfezione() {
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
if (Ab.validateForm('id_articoloTessuto', 'Tessuto', 'R', 'mmATT', 'Millimetri necessari', 'RisNum>0')) {
|
||
f.cmd.value = "addTessutoConfezione";
|
||
f.act.value = "";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/** COMANDI PER INSERIRE TESSUTO PER CONFEZIONI per articolo BASE
|
||
/***************************************************/
|
||
/***************************************************/
|
||
|
||
function delTessutoConfezione(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delTessutoConfezione";
|
||
f.act.value = "";
|
||
f.id_articoloArticoloTessuto.value = l_id;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/** tessuto principale nella composizione PER CONFEZIONI per articolo BASE
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function impostaTessutoPrincipale(l_id) {
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "impostaTessutoPrincipale";
|
||
f.act.value = "";
|
||
f.id_articoloArticoloTessuto.value = l_id;
|
||
Ab.submitAj('main');
|
||
|
||
|
||
}
|
||
|
||
|
||
/***********************************************/
|
||
/***********************************************/
|
||
/* STAMPA CATALOGO */
|
||
/***********************************************/
|
||
/***********************************************/
|
||
function catalogoxx() {
|
||
|
||
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
//+"&xxx="+f.xxx.value
|
||
f.cmd.value = "stampaCatalogo";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/** add kit
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function addKit() {
|
||
|
||
//alert('primo');
|
||
var f = document.main;
|
||
//alert('secondo');
|
||
//alert('terzo');
|
||
checkBoxes();
|
||
//alert('quarto');
|
||
//Ab.validateForm('id_articoloVariante','Fornitore','R'))
|
||
if (Ab.validateForm('id_articolo', 'Articolo Non salvato', 'RisNum>0', 'id_articoloSecondario', 'Articolo Kit', 'RisNum>0'))
|
||
//if (Ab.validateForm('id_articolo','Articolo Non salvato','RisNum>0'))
|
||
{
|
||
|
||
//alert('quinto');
|
||
if (f.id_articoloSecondario.value == f.id_articolo.value)
|
||
alert("Impossibile associare l'articolo a se stesso");
|
||
else {
|
||
//alert('sesto');
|
||
f.cmd.value = "addKit";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**del kit
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function delKit(l_id) {
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
f.cmd.value = "delKit";
|
||
f.act.value = "";
|
||
f.id_kit.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* COPPIA FORMFIELD MODALFIELD PER CARICAMENTO DATI */
|
||
/* DALLA MODAL ALLA MAIN E VICEVERSA per cnuovo o midifico clifor*/
|
||
/************************************************/
|
||
/************************************************/
|
||
var retItemsTessuto = [{
|
||
"formField": "id_articoloTessuto",
|
||
"modalField": "id_articoloTessuto"
|
||
}, {
|
||
"formField": "descrizioneGreggio",
|
||
"modalField": "descrizione"
|
||
}
|
||
|
||
];
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* BOTTONE nuovotessuto CAMPO AJAX
|
||
/************************************************/
|
||
/************************************************/
|
||
function nuovoTessuto() {
|
||
newTessuto("main", retItemsTessuto);
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* dopo aver salvato il colore vodo ad associarlo all'ordine di taglio
|
||
/************************************************/
|
||
/************************************************/
|
||
function extraPostSaveTessuto() {
|
||
//addColore();
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* BOTTONE edit tessuto CAMPO AJAX
|
||
/************************************************/
|
||
/************************************************/
|
||
function editTessuto() {
|
||
modTessuto("main", retItemsTessuto);
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* dopo aver salvato il colore vodo ad associarlo all'ordine di taglio
|
||
/************************************************/
|
||
/************************************************/
|
||
function extraPostLoadTessuto() {
|
||
//addColore();
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ADD ACQUISTO USATO */
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function addAcquistoUsato() {
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm4('it', 'main', 'id_fornitore', 'Cliente Usato', 'RisNumKey', 'dataDocumento', 'Data Acquisto', 'R', 'numeroDocumento', 'Documento di Acquisto', 'R')) {
|
||
|
||
f.cmd.value = "addAcquistoUsato";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
|
||
function delAcquistoUsato(l_id)
|
||
/////////////////////////////////////////////
|
||
{
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delAcquistoUsato";
|
||
f.act.value = "";
|
||
f.id_articoloUsato.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function xxxaddAcquisto() {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
if (validateForm('id_fornitore', 'Cliente Usato', 'RisNumKey', 'dataAcquisto', 'Data Acquisto', 'R', 'docAcquisto', 'Documento di Acquisto', 'R')) { //checkBoxes();
|
||
f.cmd.value = "aggAcquisto";
|
||
f.act.value = "";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function addReso() {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
if (validateForm('id_users', 'Cliente Reso', 'RisNumKey', 'dataReso', 'Data Reso', 'R', 'docReso', 'Documento di Reso', 'R')) {
|
||
//checkBoxes();
|
||
f.cmd.value = "aggReso";
|
||
f.act.value = "";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
function deleteUsato(l_id) {
|
||
if (confirm("Vuoi eliminare la registrazione di reso?")) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.id_articoloUsato.value = l_id;
|
||
f.cmd.value = "deleteUsato";
|
||
f.act.value = "";
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
/////////////////////////////
|
||
// stampe tulps su main
|
||
///////////////////////////////////////////////////////////////////////
|
||
function stampaTulps() {
|
||
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
// $("#form_id").serialize()
|
||
f.cmd.value = "stampaTulps";
|
||
f.act.value = "tulps";
|
||
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa_Tulps", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
function stampaTulpsDef() {
|
||
Swal.fire({
|
||
title: "Stampa Tulps",
|
||
text: "Verra' stampanto in modo definitivo il TUPLS. Vuoi continuare?",
|
||
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("stampaTulps");
|
||
$("#act", "#main").val("tulpsDef");
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa_Tulps", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
setTimeout(function () {
|
||
refresh();
|
||
}, 2000);
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
|
||
function stampaTulpsCR() {
|
||
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
// $("#form_id").serialize()
|
||
f.cmd.value = "stampaTulps";
|
||
f.act.value = "tulpsCR";
|
||
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa_Tulps", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
function stampaTulpsCRDef() {
|
||
Swal.fire({
|
||
title: "Stampa Tulps",
|
||
text: "Verra' stampanto in modo definitivo il TUPLS. Vuoi continuare?",
|
||
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("stampaTulps");
|
||
$("#act", "#main").val("tulpsCRDef");
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa_Tulps", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
|
||
/*********************************************/
|
||
/*********************************************/
|
||
/* modifica e nuovo clifor su dettaglio
|
||
SOLO FORNITORE*/
|
||
/*********************************************/
|
||
/*********************************************/
|
||
var retItemsClifor = [{
|
||
"formField": "id_confezionistaDefault",
|
||
"modalField": "id_clifor"
|
||
}, {
|
||
"formField": "descrizioneConfezionista",
|
||
"modalField": "descrizioneCompleta"
|
||
}];
|
||
|
||
|
||
function nuovoClifor() {
|
||
|
||
newFor("main", retItemsClifor);
|
||
}
|
||
|
||
function modificaClifor() {
|
||
$("#id_clifor").val($("#id_confezionistaDefault").val());
|
||
modClifor("main", retItemsClifor);
|
||
}
|
||
|
||
/*********************************************/
|
||
/*********************************************/
|
||
/* inventario e rpt vendite TF*/
|
||
/*********************************************/
|
||
/*********************************************/
|
||
function inventario() {
|
||
var f = document.main;
|
||
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "inventario";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
}
|
||
|
||
|
||
}
|
||
|
||
function rptVendite() {
|
||
var f = document.main;
|
||
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "reportVendite";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
|
||
}
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT SFERATRADE TF
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliSferaTrade() {
|
||
var f = document.main;
|
||
|
||
|
||
if (confirm("Import Sferatrade 930. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliSferaTrade";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
|
||
}
|
||
|
||
function importArticoliSferaTrade2() {
|
||
var f = document.main;
|
||
/*if (confirm("Import Sferatrade 931. Vuoi Continuare?"))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliSferaTrade2";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
*/
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT hitech TF
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliHitech930() {
|
||
var f = document.main;
|
||
|
||
|
||
if (confirm("Import Hitech 930. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliHitech930";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
|
||
}
|
||
|
||
function importArticoliHitech931() {
|
||
var f = document.main;
|
||
|
||
|
||
if (confirm("Import Hitech 931. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliHitech931";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* stampa listino CR (TF)*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function stampaListino() {
|
||
var f = document.main; {
|
||
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
// $("#form_id").serialize()
|
||
|
||
|
||
if ($("#id_tipologiaProdotto").val() == 0) {
|
||
swal("Attenzione!", "Impostare una tipologia Prodotto", "warning")
|
||
} else {
|
||
f.cmd.value = "stampaListinoCR";
|
||
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//alert(theAction);
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa Listino", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file subito*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileSubitoCsv() {
|
||
Swal.fire({
|
||
title: "Export Subito Csv",
|
||
text: "Verra' generato il file csv per subito.it. Vuoi Continuare?",
|
||
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("creaFileSubitoCsv");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
$("#pageNumber").val("1");
|
||
Ab.fetch($("#actionPage").val(), $("#main").serialize(), "fileDownload", null, 1);
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file google*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileGoogleXmlPopup() {
|
||
$("#btnGoogleXml").show();
|
||
$("#btnGoogleFtp").hide();
|
||
|
||
$("#selFileGoogle").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
}
|
||
|
||
function creaFileGoogleXml() {
|
||
{
|
||
if ($("#fileNameGoogle").val() == "") {
|
||
Ab.swalError("Errore", "Scegliere un nome del feed di google!")
|
||
|
||
} else {
|
||
|
||
$("#selFileGoogle").modal("hide");
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "creaFileGoogleXml";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file google via ftp*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function sendGoogleViaFtpPopup() {
|
||
$("#btnGoogleXml").hide();
|
||
$("#btnGoogleFtp").show();
|
||
|
||
$("#selFileGoogle").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function sendGoogleViaFtp() {
|
||
if ($("#fileNameGoogle").val() == "") {
|
||
Ab.swalError("Errore", "Scegliere un nome del feed di google!")
|
||
|
||
} else {
|
||
|
||
$("#selFileGoogle").modal("hide");
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Invio Google Xml",
|
||
text: "Verra' generato il file google xml ed inviato via ftp a Google Merchant. Vuoi Continuare?",
|
||
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("sendGoogleViaFtp");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
}
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file facebook*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileFacebookXml() {
|
||
var f = document.main;
|
||
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "creaFileFacebookXml";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
|
||
/*****************************************************/
|
||
/*****************************************************/
|
||
/* cambia flg da lista */
|
||
/*****************************************************/
|
||
/*****************************************************/
|
||
function cambiaFlgArt(l_id, l_flg) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "cambiaFlg";
|
||
f.act.value = "";
|
||
f.id_articolo.value = l_id;
|
||
f.flg.value = l_flg;
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
/************************************/
|
||
/************************************/
|
||
/* popup IMPORT CC */
|
||
/************************************/
|
||
/************************************/
|
||
function importPopup() {
|
||
|
||
$("#importCC").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT CGROSS
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliCgross() {
|
||
var f = document.main;
|
||
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Computer Gross. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliCgross";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
function importArticoliCgrossWeb() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Computer Gross Web. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliCgrossWeb";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file ZIP Computer Gross.")
|
||
}
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT INGRAMMICRO
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importListinoIngramMicro() {
|
||
var f = document.main;
|
||
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import LISTINO Ingram Micro. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importListinoIngramMicro";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
function importDispoIngramMicro() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import SIAE Ingram Micro. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importDispoIngramMicro";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
function importSiaeIngramMicro() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import DISPO Ingram Micro. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importSiaeIngramMicro";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT datamatic
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliDatamatic() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Datamatic. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliDatamatic";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file CSV tipo Large di datamatic.")
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT DATAMATIC VIA MAIL
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliDatamaticMail() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Datamatic VIA MAIL. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliDatamaticMail";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT esprinet
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliEsprinet() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Esprinet. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliEsprinet";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file CSV esprinet.")
|
||
}
|
||
|
||
|
||
}
|
||
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT logicom
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliLogicom() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Logicom. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliLogicom";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file xls logicom.")
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT LOGICOM VIA MAIL
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliLogicomMail() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Logicom VIA MAIL. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliLogicomMail";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT flexit
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliFlexit() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Flexit. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliFlexit";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file xls Flexit.")
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT LOGICOM VIA MAIL
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliFlexitMail() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Flexit VIA MAIL. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliFlexitMail";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**send google xml offerte
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function sendGoogleXml() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Invio File XML Google offerte al merchant. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "sendGoogleXml";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**reset impression articoli (anche varianti)
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function resetImpression() {
|
||
var f = document.main;
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Verranno resettate le impression di tutti gli articoli. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "resetImpression";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
/************************************/
|
||
/************************************/
|
||
/* popup e comando registro usato */
|
||
/************************************/
|
||
/************************************/
|
||
function creaRegistroUsatoPopup() {
|
||
;
|
||
$("#registroUsato").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function creaRegistroUsato() {
|
||
var f = document.main;
|
||
//var numBolla = $("#numBolla").val();
|
||
$("#registroUsato").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
//comando vero e proprio
|
||
var f = document.main;
|
||
var debug = false;
|
||
var wwD = "700";
|
||
var whD = "500";
|
||
//+"&xxx="+f.xxx.value
|
||
f.cmd.value = "creaRegistroUsato";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
//var numLabels=prompt("Numero di etichette da stampare","1");
|
||
if (debug == false) {
|
||
window.open(theAction, "Stampa_Registro_Usato", "width=" + wwD + ",height=" + whD + ",status=no,resizable=yes,top=100,left=100,scrollbars=yes");
|
||
} else {
|
||
window.open(theAction);
|
||
}
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* imposta prezzo precedente su barrato da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function impostaPrecedentePrezzoBarrato(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "impostaPrecedentePrezzoBarrato";
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* imposta street price su barrato da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function impostaSPPrezzoBarrato(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "impostaSPPrezzoBarrato";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* cancella prezzo barrato da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function cancellaPrezzoBarrato(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.cmd.value = "cancellaPrezzoBarrato";
|
||
Ab.submitAj('main');
|
||
}
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* cambia vetrina da CR*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
function cambiaVetrina(id) {
|
||
var f = document.main;
|
||
f.action = f.actionPage.value + "#a_" + id;
|
||
f.id_articoloMod.value = id;
|
||
f.id_vetrinaMod.value = $("#id_vetrina_" + id).val();
|
||
f.cmd.value = "cambiaVetrina";
|
||
Ab.submitAj('main');
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file sitemap*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileSitemapXmlPopup() {
|
||
$("#selFileSitemap").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function creaFileSitemapXml() {
|
||
var f = document.main;
|
||
$("#selFileSitemap").modal("hide");
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Creazione sitemap Xml",
|
||
text: "Verra' generata la nuova sitemap " + $("#sitemapFilename").val() + " in base ai criteri di ricerca selezionati. Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "creaFileSitemapXml";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* crea sitemap standard*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
|
||
function creaSitemapsStandard(){
|
||
var f = document.main;
|
||
Swal.fire({
|
||
title: "Creazione sitemap standard",
|
||
text: "Verra' generata la sitemap standard per tutti gli articoli sul percorso _sitemap/. Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "creaSitemapsStandard";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
Ab.submitAj('main');
|
||
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
/*******************************************/
|
||
/*******************************************/
|
||
/* azzera quantita da dettaglio*/
|
||
/*******************************************/
|
||
/*******************************************/
|
||
|
||
function azzeraQuantita() {
|
||
var f = document.main;
|
||
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Azzeramento Quantita",
|
||
text: "Verranno azzerate le quantita dei fornitori e sull'articolo. Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "azzeraQuantita";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* CAMBIO STATO DA CR*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function cambiaStatoPopup(l_id) {
|
||
$("#id_articoloMod").val(l_id);
|
||
$("#cambiaStato").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
}
|
||
|
||
/* cambio lo stato in sospeso e azzero le quantita */
|
||
function cambiaStatoSA() {
|
||
$("#flgEscludiWebCS").val(2);
|
||
$("#flgAzzeraQuantita").val(1);
|
||
$('#ckflgAzzeraQuantita').prop('checked', true);
|
||
cambiaStato();
|
||
|
||
}
|
||
|
||
function cambiaStato() {
|
||
var f = document.main;
|
||
$("#cambiaStato").modal("hide");
|
||
setTimeout(function () {
|
||
$("#main").attr("action", $("#actionPage").val());
|
||
//$("#flgReport").val("S");
|
||
f.cmd.value = "cambiaStato";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
Ab.submitAj('main');
|
||
|
||
}, 500);
|
||
}
|
||
|
||
function cambiaStatoVisibile() {
|
||
$("#flgEscludiWebCS").val(0);
|
||
cambiaStato();
|
||
|
||
}
|
||
|
||
function cambiaStatoNonVIsibile() {
|
||
$("#flgEscludiWebCS").val(1);
|
||
cambiaStato();
|
||
|
||
}
|
||
|
||
function cambiaStatoX() {
|
||
var f = document.main;
|
||
$("#cambiaStato").modal("hide");
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Cambio Stato Articolo",
|
||
text: "Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "cambiaStato";
|
||
theAction = f.actionPage.value + ".pdf?" + $("#main").serialize();
|
||
//
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* mostra la modal con il listino articolo/
|
||
/************************************************/
|
||
/************************************************/
|
||
function listinoArticoloMostra(l_id_listino) {
|
||
$("#modalLA").modal("show");
|
||
$("#id_listino").val(l_id_listino);
|
||
|
||
$(".mov-bodyLA").load("../art/Articolo.abl?cmd=listinoArticoloMostra&id_articolo=" + $("#id_articolo").val() + "&id_listino=" + l_id_listino);
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* salva il prezzo listino dal popup/
|
||
/************************************************/
|
||
/************************************************/
|
||
function salvaPrezzoListino() {
|
||
|
||
$("#modalLA").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
$("#main").attr("action", $("#actionPage").val());
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("listinoSalvaPrezzo");
|
||
//
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ripristina il prezzo del listino senza il dettaglio prezzo del listino.../
|
||
/************************************************/
|
||
/************************************************/
|
||
function listinoArticoloCancella(l_id_listino) {
|
||
Swal.fire({
|
||
title: "Ripristino Prezzo Listino",
|
||
text: "Verra' eliminato il prezzo particolare dell'articolo per questo listino. Vuoi Continuare?",
|
||
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());
|
||
$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("listinoArticoloCancella");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* usa le api ebay per aggiornare l'item id ebay in base allo sku../
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayAggiornaItemId() {
|
||
Swal.fire({
|
||
title: "Ricerca Ebay Item Id",
|
||
text: "Se questo articolo e' su ebay ed hai messo il codice nel campo sku di ebay, imposta l'item id di ebay. Vuoi Continuare?xxx",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayAggiornaItemIdXX");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay publish.. crea/aggiorna articoli, crea offerta e pubblica /
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayPublish() {
|
||
Swal.fire({
|
||
title: "Pubblica su ebay",
|
||
text: "Verra' aggiornato/creato l'articolo, creata l'offerta e pubblicata. Una volta pubblicato verra' restituito un id offerta. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayPublish");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay publish.. crea/aggiorna articoli, crea offerta e pubblica /
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayPublishOnly() {
|
||
Swal.fire({
|
||
title: "Pubblica su ebay",
|
||
text: "Verra' solamente aggiornata l'offerta se l'offerta e' gia' stata pubblicata. Una volta pubblicato verra' restituito un id offerta. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayPublishOnly");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay remove./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayRemoveOffer() {
|
||
Swal.fire({
|
||
title: "Rimuovi l'offerta da ebay",
|
||
text: "Verra' rimossa l'offerta dell'articolo, senza cancellare l'articolo. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayRemoveOffer");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay update item./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayUpdateItem() {
|
||
Swal.fire({
|
||
title: "Aggiorna/Crea l'articolo su ebay",
|
||
text: "Verra' aggiornato l'articolo identificato dal suo codice. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayUpdateItem");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay remove./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayRemoveItem() {
|
||
Swal.fire({
|
||
title: "Rimuovi l'articolo da ebay",
|
||
text: "Verra' rimosso l'articolo su ebay ed, eventualmente, anche l'offerta. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayRemoveItem");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay updateCR./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayUpdateItemCR(id) {
|
||
Swal.fire({
|
||
title: "Aggiorna l'articolo su ebay",
|
||
text: "Verra' aggiornato l'articolo identificato dal suo codice. Vuoi Continuare?",
|
||
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());
|
||
$("#id_articoloMod").val(id);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayUpdateItemCR");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay ebayPublishCR./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayPublishCR(id) {
|
||
Swal.fire({
|
||
title: "Aggiorna l'articolo su ebay",
|
||
text: "Verra' aggiornato/creato l'articolo, creata l'offerta e pubblicata. Vuoi Continuare?",
|
||
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());
|
||
$("#id_articoloMod").val(id);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayPublishCR");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay remove./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayRemoveOfferCR(id) {
|
||
Swal.fire({
|
||
title: "Rimuovi l'offerta da ebay",
|
||
text: "Verra' rimossa l'offerta dell'articolo, senza cancellare l'articolo. Vuoi Continuare?",
|
||
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());
|
||
$("#id_articoloMod").val(id);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayRemoveOfferCR");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* ebay removeCR./
|
||
/************************************************/
|
||
/************************************************/
|
||
function ebayRemoveItemCR(id) {
|
||
Swal.fire({
|
||
title: "Rimuovi l'articolo da ebay",
|
||
text: "Verra' rimosso l'articolo su ebay ed, eventualmente, anche l'offerta. Vuoi Continuare?",
|
||
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());
|
||
$("#id_articoloMod").val(id);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("ebayRemoveItemCR");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* fetch caratteristica. su post chiamo la visaulizzazione dei dati
|
||
/************************************************/
|
||
/************************************************/
|
||
function fetchCaratteristica() {
|
||
Ab.fetch("../art/Articolo.abl", 'cmd=fetchCaratteristica&id_caratteristica=' + $("#id_caratteristica").val(), null, "postfetchCaratteristica()");
|
||
|
||
|
||
}
|
||
|
||
/*****************************************/
|
||
/*****************************************/
|
||
// nota giornaliera post salva...
|
||
/*****************************************/
|
||
/*****************************************/
|
||
function postfetchCaratteristica(response) {
|
||
//sulla response ho flgTipoVal
|
||
var jsoResponse = JSON.parse(response);
|
||
var flgTipoVal = jsoResponse.flgTipoVal;
|
||
var select = jsoResponse.select;
|
||
$("#flgTipoVal").val(flgTipoVal);
|
||
if (flgTipoVal == 6) {
|
||
$("#id_lista").html(select);
|
||
}
|
||
refreshCaratteristica();
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* refresh caratteristica
|
||
/************************************************/
|
||
/************************************************/
|
||
function refreshCaratteristica() {
|
||
var flgTipoVal = $("#flgTipoVal").val();
|
||
//
|
||
//nascondo tutto
|
||
$("#dVal1").hide(0);
|
||
$("#dVal2").hide(0);
|
||
$("#dVal3").hide(0);
|
||
$("#dVal4").hide(0);
|
||
$("#dVal5").hide(0);
|
||
$("#dVal6").hide(0);
|
||
|
||
//alert(flgTipoVal);
|
||
if (flgTipoVal == 1) {
|
||
$("#dVal1").show(0);
|
||
} else if (flgTipoVal == 2) {
|
||
$("#dVal2").show(0);
|
||
} else if (flgTipoVal == 3) {
|
||
$("#dVal3").show(0);
|
||
} else if (flgTipoVal == 4) {
|
||
$("#dVal4").show(0);
|
||
} else if (flgTipoVal == 5) {
|
||
$("#dVal5").show(0);
|
||
} else if (flgTipoVal == 6) {
|
||
$("#dVal6").show(0);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* cerca e controlla articoli ebay con giacenza a zero
|
||
/************************************************/
|
||
/************************************************/
|
||
function checkArticoliEbaySearch() {
|
||
Swal.fire({
|
||
title: "Ricerca Ebay",
|
||
text: "Verranno controllati gli articoli ebay con giagenza a zero, ma e' un processo molto lungo. Devi aspettare che il sistema finisca tutte le chiamate a ebay. 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("");
|
||
$("#cmd", "#main").val("checkArticoliEbaySearch");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* copia la descrizione dell'articolo su nome marketplace
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function copiaDescrizioneBreve2MP() {
|
||
var lang = $("#currentLang").val();
|
||
$("#nomeMarketplace_" + lang).val($("#descrizioneBreve_" + lang).val());
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* copia la descrizione commerciale dell'articolo su descrizione marketplace
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function copiaDescrizioneCommerciale2MP() {
|
||
var lang = $("#currentLang").val();
|
||
$("#descrizioneMarketplace_" + lang).val($("#descrizioneCommerciale_" + lang).val());
|
||
CKEDITOR.instances['descrizioneMarketplace_' + lang].setData($("#descrizioneCommerciale_" + lang).val())
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* copia la descrizione commerciale e breve dell'articolo sulle descrizione marketplace
|
||
/************************************************/
|
||
/************************************************/
|
||
function copiaDescrizioni2MP() {
|
||
copiaDescrizioneCommerciale2MP();
|
||
copiaDescrizioneBreve2MP();
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* avvia thread che allinea qta e prezzi su ebay
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function startAllineaEbay() {
|
||
|
||
Swal.fire({
|
||
title: "Start Thread Ebay",
|
||
text: "Verra' avviato il thread che allinea le quantita' e i prezzi ebay. Vuoi Continuare?",
|
||
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("startAllineaEbay");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* carico icecat
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function caricaIcecat() {
|
||
|
||
if ($("#codiceEan").val() == "" && $("#id_marca").val() == "0" && $("#codiceProduttore").val() == "") {
|
||
Ab.swalWarning("Attenzione!", "Inserire codice ean (GTIN) oppure marca e codice produttore");
|
||
} else {
|
||
|
||
|
||
Swal.fire({
|
||
title: "Carica Catalogo ICECAT",
|
||
text: "Vuoi caricare il catalogo ICECAT?",
|
||
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("caricaIcecat");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
}
|
||
}
|
||
/************************************/
|
||
/************************************/
|
||
/* popup BULK UPDATE */
|
||
/************************************/
|
||
/************************************/
|
||
function bulkUpdatePopup() {
|
||
|
||
$("#bulkUpdate").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function bulkUpdate() {
|
||
|
||
if ($("#codiceEan").val() == "" && $("#id_marca").val() == "0" && $("#codiceProduttore").val() == "") {
|
||
Ab.swalWarning("Attenzione!", "Inserire codice ean (GTIN) oppure marca e codice produttore");
|
||
} else {
|
||
|
||
|
||
Swal.fire({
|
||
title: "Aggiornamento Massivo",
|
||
text: "Vuoi avviare il thread di aggiornamento massivo in base ai criteri di ricera immessi?",
|
||
icon: "warning",
|
||
showDenyButton: true,
|
||
showCancelButton: false,
|
||
confirmButtonText: `Si`,
|
||
denyButtonText: `No`,
|
||
cancelButtonText: `Annulla`,
|
||
}).then((result) => {
|
||
/* Read more about isConfirmed, isDenied below */
|
||
if (result.isConfirmed) {
|
||
$("#bulkUpdate").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
$("#main").attr("action", $("#actionPage").val());
|
||
//$("#flgReport").val("S");
|
||
$("#cmd", "#main").val("bulkUpdate");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
}
|
||
}
|
||
|
||
/************************************/
|
||
/************************************/
|
||
/* gestione articolo nazione */
|
||
/************************************/
|
||
/************************************/
|
||
function addArticoloNazione() {
|
||
|
||
var f = document.main;
|
||
if (Ab.validateForm('id_nazione', 'Nazione', 'R')) {
|
||
checkBoxes();
|
||
f.cmd.value = "addArticoloNazione";
|
||
//f.flgRiga.value="A";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
|
||
function delArticoloNazione(l_id) {
|
||
|
||
Ab.confirmDelete4(function () {
|
||
var f = document.main;
|
||
// FACCIO IL SUBMIT
|
||
f.cmd.value = "delArticoloNazione";
|
||
f.id_caratteristica.value = l_id;
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
});
|
||
|
||
|
||
}
|
||
|
||
function modArticoloNazione(l_id) {
|
||
|
||
var f = document.main;
|
||
f.action = f.actionPage.value;
|
||
f.cmd.value = "modArticoloNazione";
|
||
//f.cmd.value="md";
|
||
//f.act.value="refreshCaratteristica";
|
||
f.id_articoloNazione.value = l_id;
|
||
//f.flgRiga.value="A";
|
||
Ab.submitAj('main');
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* avvia thread di cancellazione massiva
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function cancellazioneMassiva() {
|
||
|
||
Swal.fire({
|
||
title: "Cancellazione Massiva",
|
||
text: "Verra' avviato il thread di cancellazione massiva (solo articoli NON pubblicati) Vuoi Continuare?",
|
||
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("startCancellazioneMassiva");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* avvia unione articoli con stesso EAN
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function unisciDoppioniEan() {
|
||
|
||
Swal.fire({
|
||
title: "Unione doppioni con stesso EAN",
|
||
text: "Verra' avviata l'unione degli articolo con stesso EAN Vuoi Continuare?",
|
||
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("unisciDoppioniEan");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/*cancella il campo icecatlang
|
||
/************************************************/
|
||
/************************************************/
|
||
function impostaIcecatlang() {
|
||
if ($("#icecatLang").val() == "") {
|
||
$("#icecatLang").val("it,en");
|
||
} else {
|
||
$("#icecatLang").val("");
|
||
}
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file xml trovaprezzi*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileTrovaprezziXmlPopup() {
|
||
$("#selFileTrovaprezzi").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function creaFileTrovaprezziXml() {
|
||
var f = document.main;
|
||
$("#selFileTrovaprezzi").modal("hide");
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Creazione File Trovaprezzi Xml",
|
||
text: "Verra' generato il nuovo file " + $("#fileNameTrovaprezzi").val() + " in base ai criteri di ricerca selezionati. Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "creaFileTrovaprezziXml";
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* file xml idealo*/
|
||
/************************************************/
|
||
/************************************************/
|
||
function creaFileIdealoXmlPopup() {
|
||
$("#selFileIdealo").modal("show");
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
|
||
}
|
||
|
||
function creaFileIdealoXml() {
|
||
var f = document.main;
|
||
$("#selFileIdealo").modal("hide");
|
||
setTimeout(function () {
|
||
Swal.fire({
|
||
title: "Creazione File Idealo Xml",
|
||
text: "Verra' generato il nuovo file " + $("#fileNameIdealo").val() + " in base ai criteri di ricerca selezionati. Vuoi Continuare?",
|
||
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");
|
||
f.cmd.value = "creaFileIdealoXml";
|
||
theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
//
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT brevi
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importArticoliBrevi() {
|
||
var f = document.main;
|
||
|
||
if ($("#fileNameOnServer_1").val() != "") {
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import BREVI. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importArticoliBrevi";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
} else {
|
||
alert("Caricare il file XML brevi.")
|
||
}
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT runner
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importRunner() {
|
||
var f = document.main;
|
||
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Runner. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importRunner";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
$("#flgTipoImportRunner").val($("#flgTipoImportRunnerC").val());
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
/***************************************************/
|
||
/***************************************************/
|
||
/**IMPORT bestit
|
||
/***************************************************/
|
||
/***************************************************/
|
||
function importBestit() {
|
||
var f = document.main;
|
||
|
||
$("#importCC").modal("hide");
|
||
setTimeout(function () {
|
||
{
|
||
if (confirm("Import Bestit. Vuoi Continuare?")) {
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "importBestit";
|
||
f.act.value = "";
|
||
f.action = f.actionPage.value;
|
||
$("#flgTipoImportBestit").val($("#flgTipoImportBestitC").val());
|
||
Ab.submitAj('main');
|
||
}
|
||
}
|
||
|
||
}, 500);
|
||
|
||
|
||
}
|
||
|
||
////////////////////////////////////////////
|
||
// copiaMetaDescription
|
||
////////////////////////////////////////////
|
||
function copiaMetaDescription() {
|
||
var lang = $("#currentLang").val();
|
||
$("#metaDescription_" + lang).val($("#metaDescriptionAuto").val());
|
||
|
||
}
|
||
|
||
////////////////////////////////////////////
|
||
// copiaNomeUrl
|
||
////////////////////////////////////////////
|
||
function copiaNomeUrl() {
|
||
var lang = $("#currentLang").val();
|
||
$("#nomeSeo").val($("#descrizioneMarca").val() + " " + $("#nome").val());
|
||
|
||
}
|
||
////////////////////////////////////////////
|
||
// copiaTitleAutomatico
|
||
////////////////////////////////////////////
|
||
function copiaTitleAutomatico() {
|
||
var lang = $("#currentLang").val();
|
||
$("#seoTitle_" + lang).val($("#seoTitleAuto").val());
|
||
}
|
||
////////////////////////////////////////////
|
||
// copiaH1Atomatico
|
||
////////////////////////////////////////////
|
||
function copiaH1Automatico() {
|
||
var lang = $("#currentLang").val();
|
||
$("#tagH1_" + lang).val($("#tagH1Auto").val());
|
||
}
|
||
////////////////////////////////////////////
|
||
// copiaH2Atomatico
|
||
////////////////////////////////////////////
|
||
function copiaH2Automatico() {
|
||
var lang = $("#currentLang").val();
|
||
$("#tagH2_" + lang).val($("#tagH2Auto").val());
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* avvia index now su dettaglio e CR
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function inviaIndexNow() {
|
||
|
||
Swal.fire({
|
||
title: "Index Now",
|
||
text: "Verra' inviato il link in tutte le lingue disponibili al motore IndexNow di Bing. Vuoi Continuare?",
|
||
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("inviaIndexNow");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
function inviaIndexNowCR() {
|
||
|
||
Swal.fire({
|
||
title: "Index Now",
|
||
text: "Verra' inviato il link in tutte le lingue disponibili al motore IndexNow di Bing- in base ai criteri di ricerca (fino ad un massimo di urlQuota definito su attivita'). Vuoi Continuare?",
|
||
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("inviaIndexNowCR");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
/*********************************************/
|
||
/*********************************************/
|
||
/* amazon csv*/
|
||
/*********************************************/
|
||
/*********************************************/
|
||
function creaFileCvsAmazonOld() {
|
||
var f = document.main;
|
||
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "creaFileCvsAmazon";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
}
|
||
|
||
}
|
||
|
||
function creaFileCvsAmazon() {
|
||
var f = document.main;
|
||
(async () => {
|
||
const {
|
||
value: l_flgTipoExport
|
||
} = await Swal.fire({
|
||
title: 'Scegli tipo export Amazon',
|
||
input: 'select',
|
||
inputOptions: {
|
||
0: 'Export base',
|
||
1: 'Export Prezzo Quantita',
|
||
},
|
||
inputPlaceholder: 'Seleziona Export',
|
||
showCancelButton: true
|
||
|
||
})
|
||
|
||
if (l_flgTipoExport) {
|
||
// Swal.fire(`You selected: ${l_flgTipoExport}`);
|
||
//alert(l_flgTipoExport)
|
||
$("#flgTipoExportAmazon").val(l_flgTipoExport);
|
||
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "creaFileCvsAmazon";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.fetch(f.actionPage.value, $("#main").serialize(), "fileDownload", null, 1);
|
||
|
||
}
|
||
}
|
||
|
||
})()
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amz catalogo per trovare asin /
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzCatalogItem() {
|
||
Swal.fire({
|
||
title: "Verifica Catalogo Amazon",
|
||
text: "Verra' interrogato il catalogo amazon per veder se c'e' gia' e carico il codice asin. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("amzCatalogItem");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
function amzCatalogItemCR1(id) {
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzCatalogItemCR1";
|
||
$("#id_articoloCR").val(id);
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amz update./
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzUpdateOffer() {
|
||
Swal.fire({
|
||
title: "Pubblica su Amazon",
|
||
text: "Verra' creata/aggiornata l'offerta con sku=ean e asin amazon. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("amzUpdateOffer");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amz update auto./
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzUpdateOfferAuto() {
|
||
Swal.fire({
|
||
title: "Pubblica su Amazon in Automatico",
|
||
text: "Verra' creata/aggiornata l'offerta con sku=ean e asin amazon. Tento l'inserimento automatico!!!. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("amzUpdateOfferAuto");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amz remove./
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzRemoveOffer() {
|
||
Swal.fire({
|
||
title: "Rimuovi l'offerta da ebay",
|
||
text: "Verra' rimossa l'offerta dell'articolo, senza cancellare l'articolo. Vuoi Continuare?",
|
||
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());
|
||
//$("#id_listino").val(l_id_listino);
|
||
//$("#flgReport").val("S");
|
||
$("#cmd").val("amzRemoveOffer");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
/************************************************/
|
||
/* avvia thread che allinea qta e prezzi su amz
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function startAllineaAmz() {
|
||
|
||
Swal.fire({
|
||
title: "Start Thread allinea prezzi Amazon",
|
||
text: "Verra' avviato il thread che allinea le quantita' e i prezzi amazon. Vuoi Continuare?",
|
||
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("startAllineaAmz");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
/************************************************/
|
||
/* avvia thread che publlica in automatico su amz
|
||
/************************************************/
|
||
/************************************************/
|
||
function startUpdateOfferAmzPopup() {
|
||
|
||
$("#selTipoPrezzoAmz").modal("show");
|
||
$("#btnAmzUpdateOfferAutoCR").hide();
|
||
$("#btnStartUpdateOfferAmz").show();
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
}
|
||
|
||
function startUpdateOfferAmz() {
|
||
|
||
$("#flgPriceTypeAmzCR").val($("#flgPriceTypeAmzPopup").val());
|
||
$("#selTipoPrezzoAmz").modal("hide");
|
||
Swal.fire({
|
||
title: "Start Thread Pubblica Offerte Amazon",
|
||
text: "Verra' avviato il thread che pubblica/aggiorna le offerte su Amazon. Vuoi Continuare?",
|
||
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("startUpdateOfferAmz");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amazon pubblica articolo da CR
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzUpdateOfferAutoCRPopup(id) {
|
||
|
||
$("#id_articoloCR").val(id);
|
||
$("#selTipoPrezzoAmz").modal("show");
|
||
$("#btnAmzUpdateOfferAutoCR").show();
|
||
$("#btnStartUpdateOfferAmz").hide();
|
||
setTimeout(function () {
|
||
{
|
||
//Ab.setFocus("dataFatturazione");
|
||
|
||
}
|
||
|
||
}, 500);
|
||
}
|
||
|
||
function amzUpdateOfferAutoCR() {
|
||
{
|
||
|
||
$("#flgPriceTypeAmzCR").val($("#flgPriceTypeAmzPopup").val());
|
||
$("#selTipoPrezzoAmz").modal("hide");
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
{
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzUpdateOfferAutoCR";
|
||
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amazon delete item da CR
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function amzDeleteItemCR(id) {
|
||
|
||
|
||
Swal.fire({
|
||
title: "Rimozione Offerta Amazon",
|
||
text: "Verra' rimossa l'offerta da Amazon. 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("amzDeleteItemCR");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
$("#id_articoloCR").val(id);
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
|
||
}
|
||
|
||
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amazon delete item
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function amzDeleteItem() {
|
||
Swal.fire({
|
||
title: "Rimozione Offerta Amazon",
|
||
text: "Verra' rimossa l'offerta da Amazon. 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("amzDeleteItem");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amazon post pricing
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzPostPricingCR() {
|
||
Swal.fire({
|
||
title: "Caricamento Prezzi Amazon",
|
||
text: "Verranno caricati i prezzi Amazon in base alla ricerca. 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) {
|
||
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostPricingCR";
|
||
$("#id_articoloCR").val("");
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
|
||
function amzPostPricingCR1(id) {
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostPricingCR1";
|
||
$("#id_articoloCR").val(id);
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
|
||
|
||
}
|
||
|
||
function amzPostPricing() {
|
||
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostPricing";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
}
|
||
/************************************************/
|
||
/************************************************/
|
||
/* amazon post pricing amzPostItemsOffersBatch
|
||
/************************************************/
|
||
/************************************************/
|
||
function amzPostItemsOffersBatchCR() {
|
||
Swal.fire({
|
||
title: "Caricamento Prezzi Amazon",
|
||
text: "Verranno caricati i prezzi Amazon in base alla ricerca. 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) {
|
||
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostItemsOffersBatchCR";
|
||
$("#id_articoloCR").val("");
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|
||
|
||
|
||
function amzPostItemsOffersBatchCR1(id) {
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostItemsOffersBatchCR1";
|
||
$("#id_articoloCR").val(id);
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
|
||
|
||
}
|
||
|
||
function amzPostItemsOffersBatch() {
|
||
|
||
var f = document.main;
|
||
//if (f.flgSimulazione.value == "1" || (f.flgSimulazione.value == "0" && confirm("Export Bartolini (solo fatture emesse): simulazione non attivata. Vuoi Continuare?")))
|
||
|
||
f.action = f.actionPage.value;
|
||
//FACCIO IL SUBMIT
|
||
f.cmd.value = "amzPostItemsOffersBatch";
|
||
//alert(f.cmd.value);
|
||
//theAction = f.actionPage.value + "?" + $("#main").serialize();
|
||
Ab.submitAj('main');
|
||
}
|
||
/************************************************/
|
||
/* avvia thread amzPostItemsOffersBatch amz
|
||
/************************************************/
|
||
/************************************************/
|
||
|
||
function startThreadPostItemOfferAmz() {
|
||
|
||
Swal.fire({
|
||
title: "Start Thread Prezzi Competitivi Amazon",
|
||
text: "Verra' avviato il thread che ricerca i prezzi competitivi si Amazon. Vuoi Continuare?",
|
||
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("startThreadPostItemOfferAmz");
|
||
$("#act", "#main").val("");
|
||
$("#cmd2").val("");
|
||
$("#act2").val("");
|
||
//$("#pageNumber").val("1");
|
||
Ab.submitAj('main');
|
||
} else if (result.isDenied) {
|
||
//Swal.fire('Changes are not saved', '', 'info')
|
||
}
|
||
})
|
||
|
||
}
|