www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
32
decompiled-libs/www/acxent-common-1.0.1/AggAbiCab.java
Normal file
32
decompiled-libs/www/acxent-common-1.0.1/AggAbiCab.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import it.acxent.anag.AbiCab;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
|
||||
public class AggAbiCab extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggAbiCab bean = new AggAbiCab();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "ctexpress";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
ResParm rp = new AbiCab(apTarget).importAbiCab("/Users/acolzi/Downloads/banche.csv");
|
||||
System.out.println(rp.getMsg());
|
||||
}
|
||||
}
|
||||
50
decompiled-libs/www/acxent-common-1.0.1/AggDocFiglio.java
Normal file
50
decompiled-libs/www/acxent-common-1.0.1/AggDocFiglio.java
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import it.acxent.contab.Documento;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
|
||||
public class AggDocFiglio extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggDocFiglio bean = new AggDocFiglio();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
System.out.println("calcolo tot record....");
|
||||
Vectumerator vec = new Documento(apTarget).findAll();
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
int updRec = 0;
|
||||
while (vec.hasMoreElements()) {
|
||||
Documento row = (Documento)vec.nextElement();
|
||||
if (row.getId_documentoFiglio() != 0L)
|
||||
updRec++;
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " " + i);
|
||||
}
|
||||
System.out.println("--- fine ---");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
import it.acxent.anag.MagFisico;
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.contab.Movimento;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.RigaDocumentoP;
|
||||
import it.acxent.contab.RigaDocumentoPCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AggiornaMagMovimento extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggiornaMagMovimento bean = new AggiornaMagMovimento();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
int i = 0, j = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String db = "guidoreni";
|
||||
boolean step1 = true, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
long l_id_articolo = 0L;
|
||||
ResParm rp = new ResParm(true);
|
||||
int pagerow = 1000;
|
||||
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("START: " + start.toString());
|
||||
if (step1) {
|
||||
System.out.println("Delete All Movimento");
|
||||
Movimento mov = new Movimento(apTarget);
|
||||
String sqlDeleteMov = "delete from MOVIMENTO ";
|
||||
if (l_id_articolo > 0L)
|
||||
sqlDeleteMov = sqlDeleteMov + " where id_articolo=" + sqlDeleteMov;
|
||||
mov.delete(sqlDeleteMov);
|
||||
i = 0;
|
||||
System.out.println("Import All Movimento");
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
long tot = rd.findAllPerRiordinoMagazzinoTot(l_id_articolo);
|
||||
System.out.println("tot record: " + tot);
|
||||
while ((long)j < tot / (long)pagerow + 1L) {
|
||||
j++;
|
||||
Vectumerator vec = rd.findAllPerRiordinoMagazzino(l_id_articolo, j, pagerow);
|
||||
while (vec.hasMoreElements()) {
|
||||
rd = (RigaDocumento)vec.nextElement();
|
||||
rp = RigaDocumento.aggiornaMovimento(rd);
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.print("Tot: " + tot + " - Pag: " + j + " - Pag. Lette: " + j * pagerow);
|
||||
}
|
||||
}
|
||||
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("start 2: " + stop.toString());
|
||||
if (step2) {
|
||||
i = 0;
|
||||
j = 0;
|
||||
RigaDocumentoP rdp = new RigaDocumentoP(apTarget);
|
||||
Vectumerator vec = rdp.findAll();
|
||||
long tot = (long)vec.getTotNumberOfRecords();
|
||||
System.out.println("Riga documento P: tot record: " + vec.getTotNumberOfRecords());
|
||||
while ((long)j < tot / (long)pagerow + 1L) {
|
||||
j++;
|
||||
vec = rdp.findByCR(new RigaDocumentoPCR(), j, pagerow);
|
||||
while (vec.hasMoreElements()) {
|
||||
RigaDocumentoP row = (RigaDocumentoP)vec.nextElement();
|
||||
if (row.getRigaDocumentoPrelevata().getDocumento().getTipoDocumento()
|
||||
.getFlgTipologia() == 3L) {
|
||||
Movimento mov = new Movimento(apTarget);
|
||||
rp = mov.deleteP(row.getId_rigaDocumentoPrelevata());
|
||||
mov.setId_articolo(row.getRigaDocumentoPrelevata().getId_articolo());
|
||||
mov.setId_articoloVariante(row.getRigaDocumentoPrelevata().getId_articoloVariante());
|
||||
mov.setId_articoloTaglia(row.getRigaDocumentoPrelevata().getId_articoloTaglia());
|
||||
mov.setId_clifor(row.getRigaDocumentoPrelevata().getDocumento().getId_clifor());
|
||||
MagFisico mf = new MagFisico(apTarget);
|
||||
mf.findMagazzinoOrdinato();
|
||||
mov.setId_magFisico(mf.getId_magFisico());
|
||||
mov.setId_rigaDocumento(row.getId_rigaDocumento());
|
||||
mov.setNr(-1.0D * row.getQuantitaPrelevata());
|
||||
rp = mov.save();
|
||||
} else {
|
||||
System.out.println("!!! " + row.getRigaDocumentoPrelevata().getDocumento().getNumeroDocumentoCompleto());
|
||||
row.superDelete();
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("start 3: " + stop.toString());
|
||||
if (step3) {
|
||||
i = 0;
|
||||
j = 0;
|
||||
Articolo art = new Articolo(apTarget);
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setFlgQta(1L);
|
||||
CR.setQtaDa(1L);
|
||||
CR.setQtaA(99999999L);
|
||||
Vectumerator<Articolo> vec = art.findByCR(CR, 0, 0);
|
||||
long tot = (long)vec.getTotNumberOfRecords();
|
||||
Movimento mov = new Movimento(apTarget);
|
||||
System.out.println("Articolio: tot record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
System.out.println(row.getNome());
|
||||
if (row.getFlgUsaVarianti() == 1L) {
|
||||
ArticoloVariante av = new ArticoloVariante(apTarget);
|
||||
Vectumerator vecAv = av.findById_articolo(row.getId_articolo(), 0, 0, -1L, -1L);
|
||||
while (vecAv.hasMoreElements()) {
|
||||
ArticoloVariante rowAV = (ArticoloVariante)vecAv.nextElement();
|
||||
Movimento.aggiornaDispo(apTarget, rowAV.getId_articolo(), rowAV.getId_articoloVariante(), 0L, 1L);
|
||||
}
|
||||
} else {
|
||||
Movimento.aggiornaDispo(apTarget, row.getId_articolo(), 0L, 0L, 1L);
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("start 4: " + stop.toString());
|
||||
if (step4) {
|
||||
i = 0;
|
||||
j = 0;
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
Vectumerator vec = rd.findRigheDocumentoPrelevateDaStornare();
|
||||
long tot = (long)vec.getTotNumberOfRecords();
|
||||
Movimento mov = new Movimento(apTarget);
|
||||
System.out.println("Righe documento ordine da stornare: tot record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||
row.aggiornaMovimentoPareggioRigaPrelevata();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
if (step5) {
|
||||
i = 0;
|
||||
j = 0;
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
Vectumerator vec = rd.findRigheDocumentoPrelevateDaStornare();
|
||||
long tot = (long)vec.getTotNumberOfRecords();
|
||||
Movimento mov = new Movimento(apTarget);
|
||||
System.out.println("Righe documento ordine da stornare: tot record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||
row.aggiornaMovimentoPareggioRigaPrelevata();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("STOP: " + start.toString());
|
||||
System.out.println("DURATA: " + (double)(stop.getTime() - start.getTime()) / 60000.0D + " minuti");
|
||||
System.out.println("Fine");
|
||||
System.out.println(rp.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AggiornaMagRigaDocumento extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggiornaMagRigaDocumento bean = new AggiornaMagRigaDocumento();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
int i = 0, j = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String db = "ravinale";
|
||||
boolean step1 = true, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
long l_id_articolo = 0L;
|
||||
ResParm rp = new ResParm(true);
|
||||
int pagerow = 1000;
|
||||
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("START: " + start.toString());
|
||||
if (step1) {
|
||||
i = 0;
|
||||
System.out.println("Import All Movimento");
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
Vectumerator<RigaDocumento> vec = rd.findByDocumento(51L, -1L, "", 0, 0, 0);
|
||||
Documento documento = new Documento(apTarget);
|
||||
documento.findByPrimaryKey(51L);
|
||||
System.out.println("tot record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
rd = (RigaDocumento)vec.nextElement();
|
||||
System.out.println(rd.getArticoloVariante().getCodiceVariante() + " " + rd.getArticoloVariante().getCodiceVariante() + " " + rd.getArticoloVariante().getQuantitaEffettivaAv());
|
||||
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D) {
|
||||
rp = Documento.addRigaDocumento(documento, rd);
|
||||
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D)
|
||||
System.out.println("" +
|
||||
rd.getArticoloVariante().getQuantitaEffettivaAv() + " " + rd.getArticoloVariante().getQuantitaEffettivaAv());
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("STOP: " + start.toString());
|
||||
System.out.println("DURATA: " + (double)(stop.getTime() - start.getTime()) / 60000.0D + " minuti");
|
||||
System.out.println("Fine");
|
||||
System.out.println(rp.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
77
decompiled-libs/www/acxent-common-1.0.1/AggiornaRDMOV.java
Normal file
77
decompiled-libs/www/acxent-common-1.0.1/AggiornaRDMOV.java
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import it.acxent.contab.RigaDocumento;
|
||||
import it.acxent.contab.RigaDocumentoCR;
|
||||
import it.acxent.contab.RigaDocumentoP;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AggiornaRDMOV extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggiornaRDMOV bean = new AggiornaRDMOV();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
int i = 0, j = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String db = "guidoreni14";
|
||||
boolean step1 = false, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
long l_id_articolo = 0L;
|
||||
ResParm rp = new ResParm(true);
|
||||
int pagerow = 1000;
|
||||
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("START: " + start.toString());
|
||||
if (step1) {
|
||||
System.out.println("CICLO RIGA DOCUMENTO");
|
||||
i = 0;
|
||||
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||
RigaDocumentoCR CR = new RigaDocumentoCR(apTarget);
|
||||
int nrighe = 100000;
|
||||
int recordCancellati = 0;
|
||||
int npag = 1;
|
||||
Vectumerator<RigaDocumento> vec;
|
||||
while ((vec = rd.findByCR(CR, npag, nrighe)).hasMoreElements()) {
|
||||
npag++;
|
||||
while (vec.hasMoreElements()) {
|
||||
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||
rp = row.saveMagSuRIgaDocumento();
|
||||
if (!rp.getStatus())
|
||||
System.out.println(rp.getMsg());
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " PAG. " + i + " / " + npag);
|
||||
}
|
||||
}
|
||||
}
|
||||
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("STOP: " + start.toString());
|
||||
System.out.println("DURATA: " + (double)(stop.getTime() - start.getTime()) / 60000.0D + " minuti");
|
||||
start = stop;
|
||||
if (step2) {
|
||||
RigaDocumentoP rdp = new RigaDocumentoP(apTarget);
|
||||
rdp.aggiustaOrdiniSuRD();
|
||||
}
|
||||
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||
System.out.println("STOP: " + start.toString());
|
||||
System.out.println("DURATA: " + (double)(stop.getTime() - start.getTime()) / 60000.0D + " minuti");
|
||||
System.out.println("Fine");
|
||||
System.out.println(rp.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.art.ArticoloUsato;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class AggiustaArticoloUsato extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
AggiustaArticoloUsato bean = new AggiustaArticoloUsato();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "tf19";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setFlgOrderBy(1L);
|
||||
CR.setFlgUsato(99L);
|
||||
CR.setFlgEscludiWeb(-1L);
|
||||
long currentidAU = 0L;
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
ArticoloUsato au = new ArticoloUsato(apTarget);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
boolean daInvertire = false;
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
Vectumerator<ArticoloUsato> vecAU = au.findByArticoloOrdineManuale(row.getId_articolo());
|
||||
currentidAU = 0L;
|
||||
daInvertire = false;
|
||||
while (vecAU.hasMoreElements()) {
|
||||
ArticoloUsato rowAU = (ArticoloUsato)vecAU.nextElement();
|
||||
if (rowAU.getId_articoloUsato() > currentidAU) {
|
||||
currentidAU = rowAU.getId_articoloUsato();
|
||||
continue;
|
||||
}
|
||||
System.out.println("DA INVERTIRE articolo: " + row.getId_articolo() + " " + row.getCodice());
|
||||
daInvertire = true;
|
||||
break;
|
||||
}
|
||||
if (daInvertire) {
|
||||
vecAU.moveFirst();
|
||||
while (vecAU.hasMoreElements()) {
|
||||
ArticoloUsato rowAU2 = (ArticoloUsato)vecAU.nextElement();
|
||||
ArticoloUsato rowNew = new ArticoloUsato(apTarget);
|
||||
rowNew.findByPrimaryKey(rowAU2.getId_articoloUsato());
|
||||
rowNew.setDBState(0);
|
||||
rowNew.setId_articoloUsato(0L);
|
||||
rowNew.save();
|
||||
rowAU2.delete();
|
||||
}
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / " + i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ArrotondaArticoli extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ArrotondaArticoli bean = new ArrotondaArticoli();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setId_iva((long)bean.getParm("CODICE_IVA_STD_VEND").getNumeroInt());
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("ciclo articoli");
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
row.arrotondaPrezzoPubblicoConIva();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ArticoliPulisciImmagini extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ArticoliPulisciImmagini bean = new ArticoliPulisciImmagini();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "tf19xxxxxx";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setFlgEscludiWeb(0L);
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
row.deleteImmaginiSporche();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / " + i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ArticoliSistemaCodiciAlternativi extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ArticoliSistemaCodiciAlternativi bean = new ArticoliSistemaCodiciAlternativi();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("ciclo articoli sistema codici alternativi");
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
String codiciAltDB = row.getCodiciAlternativi();
|
||||
row.aggiornaCodiciAlternativi(true);
|
||||
if (!codiciAltDB.equals(row.getCodiciAlternativi()))
|
||||
System.out.println("\n" + row.getCodice() + " " + codiciAltDB + " --> " + row.getCodiciAlternativi());
|
||||
if (row.getCodiciAlternativi().isEmpty()) {
|
||||
ResParm rp = row.delete();
|
||||
System.out.println("\n" + row.getCodice() + " cancellato: " + rp.getStatus());
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + "/" + i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
91
decompiled-libs/www/acxent-common-1.0.1/ArticoliTipoAcc.java
Normal file
91
decompiled-libs/www/acxent-common-1.0.1/ArticoliTipoAcc.java
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ArticoliTipoAcc extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ArticoliTipoAcc bean = new ArticoliTipoAcc();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
long l_id_tipoAcc = 196L;
|
||||
long l_id_tipoAccOrig = 214L;
|
||||
long l_id_tipoAccCompat = 229L;
|
||||
temp = getCi().readLine("id_tipo accessorio root (" + l_id_tipoAcc + "):");
|
||||
if (!temp.isEmpty())
|
||||
l_id_tipoAcc = Long.valueOf(temp);
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
ArticoloCR CR = new ArticoloCR(apTarget);
|
||||
CR.setId_tipo(l_id_tipoAcc);
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
if (row.getTipo().getId_tipoPadre() == l_id_tipoAccCompat) {
|
||||
row.setId_tipoAccessorio(2L);
|
||||
} else {
|
||||
row.setId_tipoAccessorio(5L);
|
||||
}
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ArticoliUnisciEan extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ArticoliUnisciEan bean = new ArticoliUnisciEan();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
bean.unisciArticoliByCodiceEan();
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
142
decompiled-libs/www/acxent-common-1.0.1/CCArticoliEAN.java
Normal file
142
decompiled-libs/www/acxent-common-1.0.1/CCArticoliEAN.java
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class CCArticoliEAN extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
CCArticoliEAN bean = new CCArticoliEAN();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "ccxx";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli con ean duplicati... li cancello.....");
|
||||
String idArticoli = "82982,82864,82860,82865,82984,82985,82988,82987,82989,82990,82991,82994,82995,82577,82997,82998,83000,83002,82571,83004,82573,83005,83006,82666,83007,82675,83008,83009,83010,83011,83012,83013,83014,83015,83016,83017,83020,82674,83022,83023,83025,83026,83027,83028,83029,83030,83032,83033,83034,83037,83038,83039,83040,83041,83042,83043,83045,82603,83046,83047,83048,82678,83049,83050,83051,83052,83053,82673,83054,83056,83057,83058,83059,83060,83061,83064,83065,83066,83068,83070,83071,83072,83073,83074,83088,83091,84673,83094,83095,83096,83097,83098,82602,83099,83100,83364,83101,82830,85396,82833,82836,82828,85400,83104,83105,83106,85395,85401,85391,85388,83112,83114,83115,84828,84829,84832,82641,83131,82834,83133";
|
||||
StringTokenizer st = new StringTokenizer(idArticoli, ",");
|
||||
long noEs = 0L, escg = 0L;
|
||||
StringBuilder s_noEs = new StringBuilder();
|
||||
StringBuilder s_escg = new StringBuilder();
|
||||
StringBuilder s_ebay = new StringBuilder();
|
||||
Articolo row = new Articolo(apTarget);
|
||||
Articolo art = new Articolo(apTarget);
|
||||
ArticoloCR CR = new ArticoloCR(apTarget);
|
||||
while (st.hasMoreTokens()) {
|
||||
long l_id_articolo = Long.parseLong(st.nextToken());
|
||||
row.findByPrimaryKey(l_id_articolo);
|
||||
if (row.getId_articolo() > 0L)
|
||||
if (row.getCodiciAlternativi().indexOf("ES_") >= 0) {
|
||||
if (row.getCodiciAlternativi().indexOf("CG_") >= 0) {
|
||||
System.out.println("da cancellare ma sie esprinet che cgross... controllare: flgvis:" +
|
||||
row.getFlgEscludiWeb() + " " + row.getCodice());
|
||||
escg++;
|
||||
s_escg.append(row.getId_articolo());
|
||||
s_escg.append(",");
|
||||
if (!row.getCodiceEan().isEmpty()) {
|
||||
CR.setCodiceEan(row.getCodiceEan());
|
||||
Vectumerator<Articolo> vect = art.findByCR(CR, 0, 0);
|
||||
while (vect.hasMoreElements()) {
|
||||
Articolo articolo = (Articolo)vect.nextElement();
|
||||
if (articolo.getFlgEscludiWeb() > 0L)
|
||||
articolo.delete();
|
||||
}
|
||||
}
|
||||
} else if (row.isEbayPubblicato()) {
|
||||
System.out.println("da cancellare ma su ebay......");
|
||||
s_ebay.append(row.getId_articolo());
|
||||
s_ebay.append(",");
|
||||
} else {
|
||||
System.out.println("Cancello: flgvis:" + row.getFlgEscludiWeb() + " " + row.getCodice());
|
||||
row.delete();
|
||||
}
|
||||
} else {
|
||||
noEs++;
|
||||
s_noEs.append(row.getId_articolo());
|
||||
s_noEs.append(",");
|
||||
if (!row.getCodiceEan().isEmpty()) {
|
||||
CR.setCodiceEan(row.getCodiceEan());
|
||||
Vectumerator<Articolo> vect = art.findByCR(CR, 0, 0);
|
||||
while (vect.hasMoreElements()) {
|
||||
Articolo articolo = (Articolo)vect.nextElement();
|
||||
if (articolo.getFlgEscludiWeb() > 0L) {
|
||||
articolo.delete();
|
||||
System.out.println("*");
|
||||
continue;
|
||||
}
|
||||
if (articolo.getCodiciAlternativi().indexOf("ES_") >= 0) {
|
||||
if (row.isEbayPubblicato()) {
|
||||
System.out.println("no es .. trovato es su ebay......");
|
||||
s_ebay.append(row.getId_articolo());
|
||||
s_ebay.append(",");
|
||||
continue;
|
||||
}
|
||||
System.out.println("*X " + articolo.getCodice());
|
||||
ResParm rp = articolo.delete();
|
||||
if (!rp.getStatus())
|
||||
System.out.println("ERR " + rp.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("\n-----" + noEs + " no esprinet:\n" + s_noEs.toString());
|
||||
System.out.println("\n-----" + escg + " es+cg:\n" + s_escg.toString());
|
||||
System.out.println("\n-----ebay:\n" + s_ebay.toString());
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class CancellaArticoliNonTrovati extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
CancellaArticoliNonTrovati bean = new CancellaArticoliNonTrovati();
|
||||
long numArtNonTrovati = 30L;
|
||||
if (args.length >= 1)
|
||||
numArtNonTrovati = (long)Long.valueOf(args[0]).intValue();
|
||||
System.out.println(numArtNonTrovati);
|
||||
bean.doImport(numArtNonTrovati);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport(long numArtNonTrovati) {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
bean.cancellaArticoliVecchiCC(numArtNonTrovati);
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
decompiled-libs/www/acxent-common-1.0.1/ClearImgArt.java
Normal file
54
decompiled-libs/www/acxent-common-1.0.1/ClearImgArt.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ClearImgArt extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ClearImgArt bean = new ClearImgArt();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, null, "root", "root", 1, 10, 300));
|
||||
ApplParmFull apTarget8 = new ApplParmFull(new ApplParm(17, "//" + hostname + ":3308/" + db, null, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
ResParm rp = Articolo.clearImg(bean);
|
||||
System.out.println(rp.getMsg());
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
decompiled-libs/www/acxent-common-1.0.1/CrontabDbcomune.java
Normal file
31
decompiled-libs/www/acxent-common-1.0.1/CrontabDbcomune.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import it.acxent.common.CrontabInterface;
|
||||
import it.acxent.common.Parm;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
|
||||
public class CrontabDbcomune implements CrontabInterface {
|
||||
public ResParm crontabJob(ApplParmFull ap) {
|
||||
ResParm rp = new ResParm(true);
|
||||
StringBuffer msg = new StringBuffer("\n################# Inizio crontab Giornaliera ACXENTDBCOMUNE (" +
|
||||
DBAdapter.getNow().toString() + ")\n#################");
|
||||
long t0 = System.currentTimeMillis();
|
||||
Parm parm = new Parm(ap);
|
||||
rp = parm.svuotaCartellaTmp();
|
||||
msg.append(rp.getMsg());
|
||||
msg.append("\n################# Fine crontab Giornaliera ACXENTDBCOMUNE (" + DBAdapter.getNow().toString() + ")\n#################");
|
||||
long tn = System.currentTimeMillis();
|
||||
long duration = (tn - t0) / 60000L;
|
||||
msg.append("Durata aggiornamento: " + duration + " minuti.");
|
||||
rp.setMsg(msg.toString());
|
||||
return rp;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApplParm ap = new ApplParm(3, "//localhost/coavedb2", "root", "root");
|
||||
ResParm rp = new CrontabDbcomune().crontabJob(new ApplParmFull(ap));
|
||||
System.out.println(rp.getMsg());
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class DelArticoliEan14 extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
DelArticoliEan14 bean = new DelArticoliEan14();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setFlgEscludiWeb(0L);
|
||||
Vectumerator vec = bean.findArticoliEan14();
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
row.delete();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / " + i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
decompiled-libs/www/acxent-common-1.0.1/ExportCliforCsv.java
Normal file
68
decompiled-libs/www/acxent-common-1.0.1/ExportCliforCsv.java
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import it.acxent.anag.Clifor;
|
||||
import it.acxent.anag.CliforCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class ExportCliforCsv extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ExportCliforCsv bean = new ExportCliforCsv();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni14";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
Clifor clifor = new Clifor(apTarget);
|
||||
CliforCR CR = new CliforCR(apTarget);
|
||||
CR.setFlgTipo("C");
|
||||
System.out.println("creo csv cliente");
|
||||
clifor.creaFileCvs(CR);
|
||||
System.out.println("Creato file " + CR.getFileName());
|
||||
System.out.println("creo csv fornitore");
|
||||
CR.setFlgTipo("F");
|
||||
clifor.creaFileCvs(CR);
|
||||
System.out.println("Creato file " + CR.getFileName());
|
||||
System.out.println("fine");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
104
decompiled-libs/www/acxent-common-1.0.1/ImportArticoliXls.java
Normal file
104
decompiled-libs/www/acxent-common-1.0.1/ImportArticoliXls.java
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
import it.acxent.anag.Iva;
|
||||
import it.acxent.anag.ListinoArticolo;
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
|
||||
public class ImportArticoliXls extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
ImportArticoliXls bean = new ImportArticoliXls();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String currentLine = "";
|
||||
String hostname = "83.149.159.155";
|
||||
String db = "guidoreni14";
|
||||
String fileCsv = "/Users/acolzi/Documents/_f3/work/guidoreni/importArticoliXls/4464-DT.csv";
|
||||
boolean importArticoli = false;
|
||||
String temp = "";
|
||||
temp = getCi().readLine("importArticoli(" + importArticoli + "):");
|
||||
if (!temp.isEmpty())
|
||||
importArticoli = temp.equals("y");
|
||||
ApplParmFull ap = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
ap.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
int numBanche = 0, numClienti = 0;
|
||||
if (importArticoli) {
|
||||
i = 0;
|
||||
System.out.println("\nimportArticoli");
|
||||
Articolo articolo = new Articolo(ap);
|
||||
BufferedReader reader = new BufferedReader(new FileReader(fileCsv));
|
||||
if (reader != null) {
|
||||
int numbToken = 0;
|
||||
int colcodice = 0, coldescrizione = 1, colid_tipo = 8, colprice = 6, colmarca = 9, coldescTecnica = 5;
|
||||
StringBuffer currentArticolo = new StringBuffer();
|
||||
for (int j = 0; j < 1; j++)
|
||||
reader.readLine();
|
||||
while ((currentLine = reader.readLine()) != null) {
|
||||
StringTokenizer st = new StringTokenizer(currentLine, ";");
|
||||
String codice = st.getToken(colcodice);
|
||||
String descrizione = st.getToken(coldescrizione);
|
||||
String id_tipo = st.getToken(colid_tipo);
|
||||
String price = st.getToken(colprice);
|
||||
String marca = st.getToken(colmarca);
|
||||
String descTecnica = st.getToken(coldescTecnica);
|
||||
articolo = new Articolo(ap);
|
||||
articolo.findArticoloByCodice(codice);
|
||||
if (articolo.getDBState() == 0) {
|
||||
articolo.setCodice(codice);
|
||||
articolo.setNome(descrizione);
|
||||
articolo.setId_tipo(Long.valueOf(id_tipo).longValue());
|
||||
articolo.setId_marca(Long.valueOf(marca).longValue());
|
||||
articolo.setId_tipoAccessorio(5L);
|
||||
articolo.setId_iva(6L);
|
||||
articolo.setDescTxtLang("descrizione", "it", descrizione);
|
||||
articolo.setDescTxtLang("descrizioneTecnica", "it", descTecnica);
|
||||
ResParm rp = articolo.superSave();
|
||||
if (rp.getStatus()) {
|
||||
ListinoArticolo listinoArticoloBase = articolo.getListinoArticoloBase();
|
||||
listinoArticoloBase.setId_articolo(articolo.getId_articolo());
|
||||
listinoArticoloBase.setId_listino(articolo.getListinoBase().getId_listino());
|
||||
listinoArticoloBase.setPrezzoLA(Iva.scorporaIva(Double.parseDouble(price.replaceAll(",", ".")), 22.0D));
|
||||
rp = listinoArticoloBase.save();
|
||||
} else {
|
||||
System.out.println(rp.getMsg());
|
||||
}
|
||||
} else {
|
||||
ResParm rp = new ResParm(true);
|
||||
System.out.println(codice);
|
||||
if (rp.getStatus()) {
|
||||
ListinoArticolo listinoArticoloBase = articolo.getListinoArticoloBase();
|
||||
listinoArticoloBase.setId_articolo(articolo.getId_articolo());
|
||||
listinoArticoloBase.setId_listino(articolo.getListinoBase().getId_listino());
|
||||
listinoArticoloBase.setPrezzoLA(Iva.scorporaIva(Double.parseDouble(price.replaceAll(",", ".")), 22.0D));
|
||||
rp = listinoArticoloBase.save();
|
||||
} else {
|
||||
System.out.println(rp.getMsg());
|
||||
}
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / ");
|
||||
}
|
||||
}
|
||||
System.out.println("fine ciclo \n\n\n\n\n\n\n\n\n\n\n" + msg.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(currentLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Manifest-Version: 1.0
|
||||
Archiver-Version: Plexus Archiver
|
||||
Created-By: Apache Maven 3.8.7
|
||||
Built-By: jenkins
|
||||
Build-Jdk: 17.0.17
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Tue Jul 08 00:00:32 CEST 2025
|
||||
artifactId=acxent-common
|
||||
groupId=it.acxent
|
||||
version=1.0.1
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>acxent-common</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<description>core 43</description>
|
||||
<name>Acxent Common DB</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-toolchains-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>toolchain</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<toolchains>
|
||||
<jdk>
|
||||
<version>11</version>
|
||||
</jdk>
|
||||
</toolchains>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>github-repo</id>
|
||||
<name>GitHub Repository</name>
|
||||
<url>https://maven.pkg.github.com/acolzi/repo</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>github-repo</id>
|
||||
<name>GitHub acolzi Apache Maven Packages</name>
|
||||
<url>https://maven.pkg.github.com/acolzi/repo</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.stripe</groupId>
|
||||
<artifactId>stripe-java</artifactId>
|
||||
<version>22.29.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>acxent-bank</artifactId>
|
||||
<version>1.0.1</version>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>acxent-checkvat</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.api-client</groupId>
|
||||
<artifactId>google-api-client</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ifok.image</groupId>
|
||||
<artifactId>image4j</artifactId>
|
||||
<version>0.7.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>ebaysdk-calls</artifactId>
|
||||
<version>0.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>ebaysdk-core</artifactId>
|
||||
<version>0.0.3</version>
|
||||
</dependency>
|
||||
<!-- dipendenze ebay sdk 1.8-->
|
||||
<dependency>
|
||||
<groupId>javax.xml.ws</groupId>
|
||||
<artifactId>jaxws-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.ws</groupId>
|
||||
<artifactId>jaxws-rt</artifactId>
|
||||
<version>2.3.3</version>
|
||||
</dependency>
|
||||
<!-- fine dipendenze ebay sdk 1.8-->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>acxent-skebby</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.acxent</groupId>
|
||||
<artifactId>acxent-core</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
import it.acxent.art.AmzFeaturedPrice;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaAmzFeatPrice extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaAmzFeatPrice bean = new SalvaAmzFeatPrice();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost:3308";
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
AmzFeaturedPrice afp = new AmzFeaturedPrice(apTarget);
|
||||
afp.findByPrimaryKey(2L);
|
||||
afp.save();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
decompiled-libs/www/acxent-common-1.0.1/SalvaArticoli.java
Normal file
81
decompiled-libs/www/acxent-common-1.0.1/SalvaArticoli.java
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaArticoli extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaArticoli bean = new SalvaArticoli();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "10.0.0.5";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
ArticoloCR CR = new ArticoloCR();
|
||||
CR.setId_tipo(52L);
|
||||
Vectumerator<Articolo> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
if (row.getFlgControlloCostoAggArt() == 0L) {
|
||||
System.out.println(row.getCodice() + " " + row.getCodice());
|
||||
row.save();
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / " + i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
import it.acxent.anag.Listino;
|
||||
import it.acxent.anag.ListinoArticolo;
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaArticoliPerListino extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaArticoliPerListino bean = new SalvaArticoliPerListino();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "www.lanificiozanieri.eu";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Articolo bean = new Articolo(apTarget);
|
||||
System.out.println("ciclo articoli");
|
||||
Vectumerator<Articolo> vec = bean.findAll();
|
||||
Listino lis = Listino.dammiListinoBase(apTarget);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Articolo row = (Articolo)vec.nextElement();
|
||||
ListinoArticolo la = new ListinoArticolo(apTarget);
|
||||
la.findByArticoloListino(row.getId_articolo(), lis.getId_listino());
|
||||
la.setId_articolo(row.getId_articolo());
|
||||
la.setId_listino(lis.getId_listino());
|
||||
la.setPrezzoOffertaLA(row.getImportListinoPrezzoOfferta());
|
||||
la.setDataScadenzaOffertaLA(row.getImportListinoDataScadenzaOfferta());
|
||||
la.setAbbuonoPrezzoPubblicoLA(row.getImportListinoAbbuonoPrezzoPubblico());
|
||||
la.setPercLA(row.getImportListinoPercSconto());
|
||||
la.setDataCambiamentoPrezzoLA(row.getImportListinoDataCambiamentoPrezzo());
|
||||
la.setAbbuonoPrezzoPubblicoLA(row.getImportAbbuonoPrezzoPubblico());
|
||||
la.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.art.ArticoloVarianteCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaArticoliVariante extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaArticoliVariante bean = new SalvaArticoliVariante();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "ravinale";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
ArticoloVariante bean = new ArticoloVariante(apTarget);
|
||||
System.out.println("ciclo articoli varianti");
|
||||
ArticoloVarianteCR CR = new ArticoloVarianteCR();
|
||||
CR.setFlgEscludiWeb(0L);
|
||||
Vectumerator<ArticoloVariante> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
ArticoloVariante row = (ArticoloVariante)vec.nextElement();
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
decompiled-libs/www/acxent-common-1.0.1/SalvaDtess.java
Normal file
81
decompiled-libs/www/acxent-common-1.0.1/SalvaDtess.java
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.DocumentoCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaDtess extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaDtess bean = new SalvaDtess();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "tex";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Documento bean = new Documento(apTarget);
|
||||
System.out.println("ciclo Documento");
|
||||
DocumentoCR CR = new DocumentoCR();
|
||||
CR.setId_tipoDocumento(24L);
|
||||
Vectumerator<Documento> vec = bean.findByCR(CR, 0, 0);
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Documento row = (Documento)vec.nextElement();
|
||||
System.out.print(row.getStatoLavorazione() + " ---> ");
|
||||
row.setFlgStatoLavorazione(0L);
|
||||
row.save();
|
||||
System.out.println(row.getStatoLavorazione());
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
79
decompiled-libs/www/acxent-common-1.0.1/SalvaTessuti.java
Normal file
79
decompiled-libs/www/acxent-common-1.0.1/SalvaTessuti.java
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.tex.anag.ArticoloTessuto;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaTessuti extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaTessuti bean = new SalvaTessuti();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "tf19";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
ArticoloTessuto bean = new ArticoloTessuto(apTarget);
|
||||
System.out.println("ciclo tessuti");
|
||||
Vectumerator vec = bean.findAll();
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
ArticoloTessuto row = (ArticoloTessuto)vec.nextElement();
|
||||
if (row.getCodiceAT().length() < 4) {
|
||||
row.setCodiceAT(DBAdapter.zeroLeft(row.getCodiceAT(), 4));
|
||||
row.superSave();
|
||||
}
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
80
decompiled-libs/www/acxent-common-1.0.1/SalvaTipi.java
Normal file
80
decompiled-libs/www/acxent-common-1.0.1/SalvaTipi.java
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
import it.acxent.art.Tipo;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.net.URLEncoder;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaTipi extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaTipi bean = new SalvaTipi();
|
||||
System.out.println(URLEncoder.encode("e:/public"));
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Tipo bean = new Tipo(apTarget);
|
||||
bean.update("UPDATE ARTICOLO SET flgEscludiWebArt=-1");
|
||||
System.out.println("ciclo tipi ");
|
||||
Vectumerator vec = bean.findAll();
|
||||
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||
while (vec.hasMoreElements()) {
|
||||
Tipo row = (Tipo)vec.nextElement();
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
System.out.println("\n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
decompiled-libs/www/acxent-common-1.0.1/SaveDocumento.java
Normal file
54
decompiled-libs/www/acxent-common-1.0.1/SaveDocumento.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.DocumentoCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Timer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
|
||||
public class SaveDocumento extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SaveDocumento bean = new SaveDocumento();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "ncc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost:3308";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(17, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
DocumentoCR CR = new DocumentoCR();
|
||||
Vectumerator<Documento> vec = new Documento(apTarget).findByCR(CR, 0, 0);
|
||||
System.out.println("TOT RECORD: " + vec.getTotNumberOfRecords());
|
||||
Timer timer = new Timer();
|
||||
timer.start();
|
||||
while (vec.hasMoreElements()) {
|
||||
Documento row = (Documento)vec.nextElement();
|
||||
row.superSave();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " /" + i + " " + vec.getTotNumberOfRecords());
|
||||
}
|
||||
timer.stop();
|
||||
System.out.println(timer.getDurata());
|
||||
System.out.println("\n\n ------------- Fine ---------------");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
69
decompiled-libs/www/acxent-common-1.0.1/TestExport.java
Normal file
69
decompiled-libs/www/acxent-common-1.0.1/TestExport.java
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import it.acxent.common.DescTxtLang;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class TestExport extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
TestExport bean = new TestExport();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "guidoreni";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
String dbTarget = "gaias";
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apSource = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||
apSource.setDebug(false);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + dbTarget, "root", "root", 1, 10, 300));
|
||||
apSource.setDebug(false);
|
||||
try {
|
||||
DescTxtLang bean = new DescTxtLang(apSource);
|
||||
DescTxtLang beant = new DescTxtLang(apTarget);
|
||||
ResParm rp = beant.xmlImport("/Users/acolzi/test.xml");
|
||||
System.out.println(rp.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||
st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
78
decompiled-libs/www/acxent-common-1.0.1/TestMysql8.java
Normal file
78
decompiled-libs/www/acxent-common-1.0.1/TestMysql8.java
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import it.acxent.contab.Documento;
|
||||
import it.acxent.contab.DocumentoCR;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class TestMysql8 extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
TestMysql8 bean = new TestMysql8();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "cc";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget57 = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "cc", "root", "root", 1, 10, 300));
|
||||
ApplParmFull apTarget8 = new ApplParmFull(new ApplParm(17, "//" + hostname + ":3308/" + db, db, "root", "root", 1, 10, 300));
|
||||
apTarget57.setDebug(false);
|
||||
apTarget8.setDebug(false);
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Documento bean = new Documento(apTarget57);
|
||||
bean.findByPrimaryKey(2306L);
|
||||
System.out.println(bean.getDescRecordHeader());
|
||||
System.out.println(bean.getDescRecordLine());
|
||||
System.out.println("" + bean.getId_documento() + " " + bean.getId_documento());
|
||||
ResParm rp = bean.save();
|
||||
System.out.println(rp.getMsg());
|
||||
Vectumerator<Documento> vec = bean.findByCR(new DocumentoCR(), 1, 10);
|
||||
System.out.println(bean.getDescRecordHeader());
|
||||
while (vec.hasMoreElements()) {
|
||||
Documento row = (Documento)vec.nextElement();
|
||||
System.out.println(row.getDescRecordLine());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
95
decompiled-libs/www/acxent-common-1.0.1/TestReflection.java
Normal file
95
decompiled-libs/www/acxent-common-1.0.1/TestReflection.java
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import it.acxent.cc.Attivita;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.util.DbConsole;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Date;
|
||||
import java.sql.Time;
|
||||
|
||||
public class TestReflection extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
new TestReflection().test();
|
||||
}
|
||||
|
||||
private static boolean isNotEmpty(Object valueUpd, Class<?> tipo) {
|
||||
boolean ret = false;
|
||||
if (valueUpd != null) {
|
||||
String sclass = valueUpd.getClass().getName();
|
||||
if (sclass.indexOf("Long") > 0 || sclass.indexOf("Double") > 0 || sclass.indexOf("String") > 0 || sclass.indexOf("Date") > 0 ||
|
||||
sclass.indexOf("Time") > 0)
|
||||
if (tipo.getName() == "long") {
|
||||
if ((Long)valueUpd == 0L || (Long)valueUpd == -1L) {
|
||||
ret = false;
|
||||
} else {
|
||||
ret = true;
|
||||
}
|
||||
} else if (tipo.getName() == "double") {
|
||||
if ((Double)valueUpd == 0.0D) {
|
||||
ret = false;
|
||||
} else {
|
||||
ret = true;
|
||||
}
|
||||
} else if (tipo.getName().indexOf("String") > 0) {
|
||||
if (((String)valueUpd).equals("") || ((String)valueUpd).isEmpty()) {
|
||||
ret = false;
|
||||
} else {
|
||||
ret = true;
|
||||
}
|
||||
} else if (tipo.getName().indexOf("Date") > 0) {
|
||||
Date data = (Date)valueUpd;
|
||||
if (data == null) {
|
||||
ret = false;
|
||||
} else {
|
||||
ret = true;
|
||||
}
|
||||
} else if (tipo.getName().indexOf("Time") > 0) {
|
||||
if ((Time)valueUpd == null) {
|
||||
ret = false;
|
||||
} else {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static Object getFunctionName(String functionName, Class<?> tipo, CRAdapter thiss) {
|
||||
Object value = null;
|
||||
try {
|
||||
Method method = thiss.getClass().getMethod(functionName);
|
||||
value = method.invoke(thiss);
|
||||
} catch (SecurityException e) {
|
||||
|
||||
} catch (NoSuchMethodException e) {
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
} catch (InvocationTargetException e) {}
|
||||
return value;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
String db = "fotoeventi4";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost:3308";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParm ap = new ApplParm(17, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300);
|
||||
ApplParmFull apTarget = new ApplParmFull(ap);
|
||||
apTarget.setDebug(false);
|
||||
Attivita attivita = new Attivita(apTarget);
|
||||
DBAdapter.checkSerializable(attivita);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
package it.acxent.anag;
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
AblDBCom_2_329_1_250523
|
||||
25-05-2022 OrderedRowids e AblServlet.setOrderedIdOnSession per gesione avanti indietro per qualsiasi ricerca (SpeseDetraiviliSvlt)
|
||||
25-05-2023 8xmille + fix getAttach
|
||||
16-05-2023 face + news visibili
|
||||
25-03-2023 AMAZON... allineamento.. .manca publish
|
||||
23-02-2023 aggiunto dati scontrino felettronica. Magazzino tessuti e filati ...
|
||||
17-02-2023 fix articolo.findbycr codicialternativi senza spezzettare i token
|
||||
22-01-2023 cc
|
||||
18-11-2022 icecat, bulk update e bartolini
|
||||
14-07-2022 social login google + blacklist mailer cc
|
||||
17-06-2022 implementazione import runner.it framework cc
|
||||
02-05-2022 nazione con importo minimo per carrello + articolo con sconto troppo alto
|
||||
29-03-2022 Trovaprezzi trust program
|
||||
17-03-2022 Trovaprezzi
|
||||
15-03-2022 CartSvlt gestione listaTipoPagmaneto con personalizzazione per il cliente... CliforTipoPagamento...
|
||||
28-02-2022 registro iva OSS
|
||||
21-02-2022 report documenti e servizi (molli). salvato report righe documento che non so....
|
||||
18-02-2022 articolo... desc search adesso contiene anche le caratteristiche...
|
||||
09-02-2022 Contrassegno ravinale e gestione costo contrassegno su tipo pagamento...
|
||||
06-02-2022 Marca tagOfferta. Corretto auto offerte. aggiunto gestione promo su marca tramite tagOfferta
|
||||
04-02-2022 Articolo.getLingCcInfo(CR) per mail info.....
|
||||
29-01-2022 Salvataggio documento e riga documento con controllo emsta.Articolo gestito correttamente aggiornamento percentuale effettiva di ricarico
|
||||
19-01-2022 CC crea sitemap tramite crontab
|
||||
14-01-2022 getImportLinkFornitoreEan...
|
||||
14-11-2021 CC gestione iva cee extracee corretta (da verificare con vivarelli)
|
||||
8-07-2021 ean su variante, sconto offerta framework CC, iva regime margine, abilita articolo_fornitore su fornitore
|
||||
13-06-2021 descPayment su cart... framweork cc
|
||||
07-06-2021 gestione costo spedizione con percentile
|
||||
17-03-2021 gestione kit framework cc + invio ip e timestamp su mail framework cc
|
||||
12-02-2021 risitemato gestione lang... non ancora ottimale perché dipende ta classe jsp.Ab e da _V4/_inc_lang.jsp
|
||||
18-01-2021 cc in linea e funzionante. Ultima cosa mail da documento e bcc su mail dal sito
|
||||
27-06-2020 implemEntazione attivita cc
|
||||
15-11-2018 catalogo articolo con scelta risoluzione
|
||||
23-10-2018 aggiunto parametro per esplicitare campo codice in stampa della riga senza articolo in db (atelier). Nuovo campo codiceIdentificativoFE su clifor per fattura elettronica
|
||||
13-10-2018 stampa catalogo articoli con filtro su quantità. corretto ricerca per quantità fino a variante. da fare fino a taglie
|
||||
10-09-2018 CORRETTO CONTROLLO PROTOCOLLO DOCUMENTO
|
||||
13-09-2018 corretto getFlgUdm su riga documento
|
||||
31-07-2018 corretto taglib banner con rewriterule ad,Banner.abl,go,,@id e convertStringToLink su f3.jar
|
||||
11-05-2018 aggiunto gestione blog e corretto baco per altri file (templatemsg nonfunzionava più)
|
||||
13-12-2017 aggiunto ordinamento righe documenti in stampa e edit
|
||||
08-11-2017 duplica articolo, aggiornamenti V4
|
||||
02-10-2017 catalogo prodotti + gestione taglie!!!
|
||||
14-06-2017 aggiustato magazzino su articolo variante. reso quantitaW inutile.... da togliere???
|
||||
14-02-2017 corretto creazione scadenze. Messo vincoli se sono state generate distinte riba. MUI IMPORTANTE
|
||||
22-11-2016 listino con 3 sconti + altro atelier
|
||||
10-11-2016 corretto baco listino base
|
||||
12-10-2016 banner con w e h stringhe
|
||||
07-09-2016 nuovo listino. eseguire sql fino a 144, eseguire salvaarticoloperlistino, rinominare dir immagini varianti in _imgArt/_var/
|
||||
14-07-2016 aggiustamento findwebByarticolocr su articolo variante. Xpay
|
||||
24-06-2016 riba + documento.sendmail corretto
|
||||
13-06-2016 aggiustato per propagazione codice utente. Report movimenti compatto
|
||||
10-05-2016 documentosvl aggiustato invio mail per CR.Corretto ordinamento fatture (per data riferimento solo per fatt. e nc del fornitore)
|
||||
12-04-2016 nuova addrigadocumento. lista documento ordinata per datariferimento se fattura fornitore
|
||||
05-04-2016 Nazione + zona + documento + imgusr
|
||||
23-02-2016 bannerlisttag
|
||||
28-01-2016 articolofornitore.findById_articoloFornitore
|
||||
27-01-2016 corretto stampa slip. log separati
|
||||
28-10-2015 tolto gestione pagerow su prenotazione perchè dava fastidio a cassa che su dettaglio non ha salto pagina
|
||||
27-10-2015 calcolaQuantita su articolo variante
|
||||
20-10-2015 numero righe documento su prenotazione corretto
|
||||
20-10-2015 corretto nuvoletta con lista articoli variante Movimento.findSaldiArticoloVarianteTagliaByCR
|
||||
13-10-2015 allineamento per guidoreni. Corretto lista documento pagamento su refresh documento
|
||||
27-07-2015 report pdf pagamento corretto (numeri fornitori). Ordinamento documento pagamento dipendente da attivo/passivo
|
||||
23-07-2015 super su documento
|
||||
30-06-2015 banner tag css
|
||||
24-06-2015 newssvlt _getTimeline
|
||||
24-06-2015 corretto aggiornamento stato prenotazione (forse)
|
||||
23-05-2015 corretto errore salvataggio documento nell'impostazione del pagamento
|
||||
15-06-2015 corretto errore salvataggio riga documento nella creazione dei figli. Da verificare le qta prenotazioni in caso di scarico parziale
|
||||
12-06-2015 controllo errori guidoreni
|
||||
11-06-2015 stampe documento pagamento
|
||||
05-06-2015 corretto documento pagamento
|
||||
01-06-2015 riferimento su tipodocumento e creazione documentopdf solo se necessario
|
||||
22-05-2015 AGGIUSTATO CONTROLLO EMSTA DOCUMENTI
|
||||
18-05-2015 attivata gestione stampa provvisoria nel caso di blocco salvataggio documento dopo la stampa, modificata gestione pagamenti: inserito tipo di pagamento (acconto/saldo)
|
||||
11-05-2015 corretto sms sender
|
||||
05-05-2015 corretto aggiornamento flgDispo su cancellazione riga documento
|
||||
28-04-2015 corretto preleva documento: rifatto cancella movimenti:cancella solo i movimenti relativi ai magazzini movimentati. ottimizzato metodo Documento.addRigaDocumentoDaPrelevare
|
||||
24-04-2015 corretto aggiornamento stato prenotazione su modifica e cancella righe prenotazione
|
||||
10-04-2015 corretto chiamate listaRigheOrdini e figli su DocumentoSvlt. Corretto aggiornamento dispo si cancellazione riga
|
||||
08-04-2015 correzione flgEmettiFatturaDaScontrino e stampe fattura
|
||||
23-03-2015 nuova versione stampa documenti
|
||||
19-03-2015 corretto impegno + varie
|
||||
12-03-2015 agg. vari. corretto quantitamagazzinohtml (salvataggio)
|
||||
10-03-2015 correzione aggiornadispo per azzeramento quantitàhtml
|
||||
05-03-2015 ShowTemplateMsgWww ripristinato per tuttofoto
|
||||
03-03-2015 gestione scadenza pwd
|
||||
23-02-2015 banca e swift
|
||||
17-02-2015 correzione gestione divieto di salvataggio se stampata. Prima data disponibile documento da xx a emessa. corretto datastampa doc su stampe massive
|
||||
09-02-2015 CaratteristicaArticolo.getVal(lang)
|
||||
07-01-2015 articolo.creaFileCvs corretto imprecisione csv
|
||||
06-01-2015 alcune modifiche per regime margine tf + inizio pagamenti per coave
|
||||
16-12-2014 gestione prenotazioni fast
|
||||
11-12-2014 scale image : aggiunto watermark con immagine
|
||||
03-12-2014 ottimizzata ricerca articoli e stringa magazzino
|
||||
28-11-2014 aggiunto flag su articoloVariante per l'aggiornamento di zanieri
|
||||
27-11-2014 gestione invio mail news agli utenti abilitati tramite il flag flgNews e lista di visualizzazione invii utenti
|
||||
26-11-2014 associazione users clifor + flgNews su users e associativa NEWS_USERS
|
||||
25-11-2014 invio fattura tramite link offuscato
|
||||
17-11-2014 allineamento con updateCart su f3.jar
|
||||
14-11-2014 newsletter corretto baco, modificato campo indirizzo, email unique + abbuono su articolo solo per visualizzazione
|
||||
13-11-2014 guidoreni gestione slip con contatore slip stampate su rigadocumento + data documento su movimento
|
||||
07-11-2014 gestione mailNewsletter
|
||||
29-10-2014 aggiunto orderby su news
|
||||
09-10-2014 campo mail in coda messaggi
|
||||
25-09-2014 aggiornamento templatemsg
|
||||
31-07-2014 Aggiornamnento interfaccia CartItemInterface
|
||||
24-07-2014 corretto ordine lista taglie per sito web
|
||||
22-07-2014 modriga tolto autoadd
|
||||
17-07-2014 testato magazzino e documento con magazzino in movimento e senza magazzino. Manca cassa e gestione magazzino taglie
|
||||
03-07-2014 gestione parametro usa magazzino su articolo, articolvariante e riga documento
|
||||
02-07-2014 corretto bug gestione tipologia fornitore (tolta tabella TIPOLOGIA_FORNITORE e gestita con CLIFOR_TIPO_CLIFOR)
|
||||
24-06-2014 fix ricerca clifor x regione atelier
|
||||
09-05-2014 magazzino nuovo:
|
||||
aggiunto flgInterno su mag_fisico
|
||||
aggiunto flgInternoPartenza e Arrivo su causale magazzino: verificare le nuovi causali magazzino
|
||||
aggiunto tipologie articoli dove mettiamo le unità di misura. Aggiunta combo su articolo.
|
||||
|
||||
|
||||
28-03-2014 news aggiornate
|
||||
13-03-2014 agg. vari atelier + inizio magazzino 2
|
||||
24-02-2014 campi dinamici su cosa messaggi
|
||||
17-02-2014 nuova gestione stati prenotazione + aggiornamento nuove pagine di amministrazione
|
||||
10-12-2013 taglib vetrina findrandomarticolo aggiunto escliudiweb
|
||||
03-12-2013 modificato flgDocumentoVerificato su clifor e aggiunte costanti
|
||||
28-11-2013 nuova versione news
|
||||
11-11-2013 nuova gestione listini. Da testare guidoreni. Nuova gestione news (lingue+ v3)
|
||||
28-10-2013 logon utente www controllo partita iva. left join disponibilità su articolo.findser
|
||||
16-10-2013 findFigli con select .. in(select..) molto lenta con mysql5.5. Ottimizzato isUnDocumentoFiglio.
|
||||
15-10-2013 da prenotazione a cassa verificato + gestione acconto!!!
|
||||
01-10-2013 aggiornamento articolo.findv con union per gestione tagle. Manca findSer con union!!!
|
||||
30-09-2013 AGGIORNAMENTI VARI mail fabio. gestione taglie.
|
||||
30-07-2013 AGGIORNAMENTI VARI... RIPARAZIONI + STRINGCASE.
|
||||
27-07-2013 modificato Documento->applicaListinoByClifor per ricalcolare il prezzo offerta sull'amministrazione.
|
||||
26-07-2013 nuova gestione legami righe fatture.
|
||||
03-07-2013 logRecord + varie.
|
||||
01-07-2013 corretto creaDocumentofiglio: qta su doc padre.
|
||||
30-06-2013 corretto creaDocumentofiglio: metteva qta=0..
|
||||
28-06-2013 modifiche varie fabio su cassa nuova
|
||||
18-06-2013 modifiche su nuova cassa + varie
|
||||
13-06-2013 aggiunto filtro per operatore su lista documenti
|
||||
13-06-2013 cambiato orientamento stampa report giornaliero in orizzontale
|
||||
13-06-2013 aggiunte colonne ntel e operatore su report giornaliero e fatto raggruppamento per tipologia
|
||||
13-06-2013 inserita notaBarcode su creazione documenti figli
|
||||
13-06-2013 cambiato ordinamento lista articoli cassa
|
||||
13-06-2013 stampa su scontrino aliquota iva non standard
|
||||
10-06-2013 chiusura cassa + ifvetrina
|
||||
07-06-2013 gestione cassa verificato +varie shopping www
|
||||
04-06-2013 gestione cassa.... da verificare
|
||||
28-05-2013 indici tipo + correzioni varie
|
||||
25-05-2013 corretto creazione doc figli (gestione disponibilità nel caso di movimentazione magazzino). Lista prenotazioni default aperte
|
||||
24-05-2013 gestione lingue su tipo pagamento. flgRitiroNegozio su documento e flgAblìilita negozio e corriere su tipo pagamento
|
||||
14-05-2013 gestione lingue su articolo variante.. correzioni
|
||||
13-05-2013 gestione lingue su caratteristiche e liste
|
||||
09-05-2013 allineamento nuovo carrello f3.jar Abl_14_39_24_090513
|
||||
08-05-2013 tolto definitivamente nominativo da clifor
|
||||
06-05-2013 CatalogoSvlt. Gestito caso in cui sul dettaglio voglio comunque vedere l'articolo (passo act=articolo)
|
||||
28-04-2013 tipo con immagini. Desc in lingua su tipo e articolo
|
||||
23-04-2013 tipo con descrizioni in lingua
|
||||
15-04-2013
|
||||
27-03-2013 aggiornamenti wwwguidoreni tolto telefono da intestazione fattura
|
||||
14-02-2013 aggiornamenti wwwguidoreni + tipo con ggArticoloEscludiweb
|
||||
06-02-2013 flgNascondi su tipo documento + campi agg. su clifor
|
||||
29-01-2013 aggiornamento www guidoreni. articoli non dispon. su web
|
||||
24-01-2013 aggiornamento www guidoreni
|
||||
07-12-2012 coda messaggi addimginterface
|
||||
30-11-2012 crea doc figlio funziona solo da document che hanno scaricato a quelli che non hanno scaricato. Da gestire ordini web
|
||||
15-11-2012 ecom.. aggiornamento ricerca prenotazioni
|
||||
12-11-2012 ecom.. aggiornamento carrello e correzione listini su cassa
|
||||
12-11-2012 ecom.. aggiornamento tipo accessori
|
||||
16-10-2012 allineamento nuova versione f3.jar
|
||||
28-09-2012 modifiche www e coave
|
||||
24-07-2012 banner testuali
|
||||
24-07-2012 correzioni guidoreni. stampa zebra. gestione ricerca compatibilità
|
||||
29-06-2012 varie correzioni guidoreni
|
||||
12-04-2012 clifor.getNominativoCompleto
|
||||
05-04-2012 corretto ricerche su categorie e liste dovuto a _it
|
||||
15-04-2012 corretto code messaggi. Corretto gestione immagini su articoli. Find articoli searchtxt anche su marca
|
||||
22-02-2012 aggiunto deleteForce su documenti
|
||||
13-02-2012 varie correzioni documenti per guidoreni
|
||||
10-02-2012 CORRETTO CODA MESSAGGI(GESTIONE TIMESTAMP PRIMA DI UNO SHOW BEAN). MAIUSCOLE AUTOMATICHE SU CLIFOR
|
||||
03-02-2012 aggiunto getTotale su RigaRegistroIva
|
||||
13-01-2012 coda messaggi con numero immagini quasi libero..
|
||||
10-01-2012 data pagamento documento
|
||||
29-12-2011 varie correzioni e aggiornamenti per guidoreni
|
||||
02-12-2011 varie correzioni tra cui legame documento padre su riga documento
|
||||
15-11-2011 corretto calcolo iva per valori in testata
|
||||
02-11-2011 getStringValueCase asis per allegati
|
||||
02-11-2011 tolto toUpperCase su Clifor.getCognome. Dipende giustamente da getStringValueCase
|
||||
31-10-2011 corretto ottimizzazione ricerca coda messaggi per sql server
|
||||
06-10-2011 Iva. aggiunto id_ivaDoc su documenti. Aggiornato fattura professionista
|
||||
16-09-2011 Iva. rinominati parametri standard iva. distinziona c/acq e c/vendita
|
||||
16-09-2011 ArticoloFornitore.getCostoIvato corretto arrotondamenti per 21%
|
||||
08-09-2011 corretto tot record articoli, eliminazione disponibilita se =0 (caso scarico), gestione reverse charge+varie
|
||||
03-08-2011 flgNoListino + corretto errori cash e prenotazioni
|
||||
13-07-2011 aggiunti CodaMessaggi.findByEmailTemplateMsg
|
||||
13-07-2011 corretto CodaMessaggi.sendMsg.\n
|
||||
17-06-2011 aggiunto getVersionLog e getSoftwareVersionLog\n
|
||||
|
||||
17-06-2011 controlo contatori con anno e prog iniziale
|
||||
|
||||
03-06-2011 corretto intestazioni fatture (getId_clifor() >0)
|
||||
|
||||
26-05-2011 imei riparazione cancellazione logica articoli altre
|
||||
correzioni
|
||||
|
||||
25-05-2011 spostato cracodamsg su clifor creazione coda da file di
|
||||
email (su templatemsg) 1_34 corretto ricerca coda messaggi
|
||||
ottimizzata per ms-sql
|
||||
|
||||
24-05-2011 aggiustamento coda messaggi per ms-sql
|
||||
|
||||
16-05-2011 corretto ricerca articolo (findtot)
|
||||
|
||||
11-05-2011 report movimenti + messaggi movimenti su carta tim
|
||||
(nascosto preche' fatto sui documenti), fix ricerca movimenti ricerca
|
||||
movimenti per anno tolto rettangoli default stampa fattura3
|
||||
|
||||
07-05-2011 aggiunto creazione cvs in articolo.findbycr . sparito dopo
|
||||
ottimizzazione
|
||||
|
||||
04-05-2011 coda messaggi con openMailtag
|
||||
|
||||
27-04-2010 ottimizzazione ricerca articoli e movimenti aggiustato
|
||||
invio sms corretto carico massivo 1_26 corretto presso
|
||||
nell'intestazione documenti
|
||||
|
||||
20-04-2011 gestione allegati clienti, documenti, articolo, + tipi
|
||||
allegati
|
||||
|
||||
25-03-2011 alegato articolo in ordine alfabetico
|
||||
|
||||
09-03-2011 corretto random banner
|
||||
|
||||
07-03-2011 AGGIUNTO GESTIONE BANNER
|
||||
|
||||
23-02-2011 ottimizzata ricerca documento.findtotrecord. sul mac non
|
||||
funzionave ed effetivamente era una ciofeca
|
||||
|
||||
23-02-2011 baco enorme sulla cassa. mi scorporava l'iva
|
||||
|
||||
22-02-2011 aggiornamento tipo, logo documenti, carico articoli non in
|
||||
magazzino considerando il valore su tipo, varie guidoreni
|
||||
|
||||
28-01-2011 aggiornamento clifor decriciozne comune, cap comune ecc
|
||||
ecc AGGIORNAMENTO DESTINAZIONI DIEVERSI COME SOPRA CODA MESSAGGI
|
||||
OTTIMIZZAZIONE RICERCA
|
||||
|
||||
10-01-2011 ultime modifiche prenotazioni guidoreni
|
||||
|
|
@ -0,0 +1,233 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class AbiCab extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1460974609869L;
|
||||
|
||||
private long id_abiCab;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String agenzia;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String cap;
|
||||
|
||||
private String abi;
|
||||
|
||||
private String cab;
|
||||
|
||||
private String bic;
|
||||
|
||||
private String codiceAlt;
|
||||
|
||||
private String localita;
|
||||
|
||||
private String provincia;
|
||||
|
||||
public AbiCab(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public AbiCab() {}
|
||||
|
||||
public void setId_abiCab(long newId_abiCab) {
|
||||
this.id_abiCab = newId_abiCab;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setAgenzia(String newAgenzia) {
|
||||
this.agenzia = newAgenzia;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setCap(String newCapZona) {
|
||||
this.cap = newCapZona;
|
||||
}
|
||||
|
||||
public void setAbi(String newAbi) {
|
||||
this.abi = newAbi;
|
||||
}
|
||||
|
||||
public void setCab(String newCab) {
|
||||
this.cab = newCab;
|
||||
}
|
||||
|
||||
public void setBic(String newBic) {
|
||||
this.bic = newBic;
|
||||
}
|
||||
|
||||
public void setCodiceAlt(String newCodiceAlt) {
|
||||
this.codiceAlt = newCodiceAlt;
|
||||
}
|
||||
|
||||
public long getId_abiCab() {
|
||||
return this.id_abiCab;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getAgenzia() {
|
||||
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return (this.cap == null) ? "" : this.cap.trim();
|
||||
}
|
||||
|
||||
public String getAbi() {
|
||||
return (this.abi == null) ? "" : this.abi.trim();
|
||||
}
|
||||
|
||||
public String getCab() {
|
||||
return (this.cab == null) ? "" : this.cab.trim();
|
||||
}
|
||||
|
||||
public String getBic() {
|
||||
return (this.bic == null) ? "" : this.bic.trim();
|
||||
}
|
||||
|
||||
public String getCodiceAlt() {
|
||||
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<AbiCab> findByCR(AbiCabCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from ABI_CAB AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByAbiCab(String l_abi, String l_cab) {
|
||||
String s_Sql_Find = "select A.* from ABI_CAB AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.abi='" + l_abi + "'");
|
||||
wc.addWc("A.cab='" + l_cab + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm importAbiCab(String fileName) {
|
||||
ResParm rp = new ResParm(true);
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(fileName));
|
||||
if (reader != null) {
|
||||
reader.readLine();
|
||||
String currentLine;
|
||||
while ((currentLine = reader.readLine()) != null) {
|
||||
StringTokenizer st = new StringTokenizer(currentLine, ";", '"');
|
||||
String abi = st.getToken(0);
|
||||
String cab = st.getToken(1);
|
||||
String istituto = st.getToken(2);
|
||||
String sportello = st.getToken(3);
|
||||
String indirizzo = st.getToken(4);
|
||||
String localita = st.getToken(5);
|
||||
String cap = st.getToken(6);
|
||||
String prov = st.getToken(7);
|
||||
AbiCab bean = new AbiCab(getApFull());
|
||||
bean.findByAbiCab(abi, cab);
|
||||
bean.setAbi(abi);
|
||||
bean.setCab(cab);
|
||||
bean.setDescrizione(istituto);
|
||||
bean.setAgenzia(sportello);
|
||||
bean.setIndirizzo(indirizzo);
|
||||
bean.setLocalita(localita);
|
||||
bean.setCap(cap);
|
||||
bean.setProvincia(prov);
|
||||
rp = bean.save();
|
||||
if (!rp.getStatus())
|
||||
break;
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println(i);
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
rp.setMsg("Inserite o aggiornate " + i + " records.");
|
||||
} else {
|
||||
rp.setMsg("ERRORE! " + rp.getMsg() + "\nRecord numero " + i);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg(e);
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public String getLocalita() {
|
||||
return (this.localita == null) ? "" : this.localita.trim();
|
||||
}
|
||||
|
||||
public void setLocalita(String localita) {
|
||||
this.localita = localita;
|
||||
}
|
||||
|
||||
public String getProvincia() {
|
||||
return (this.provincia == null) ? "" : this.provincia.trim();
|
||||
}
|
||||
|
||||
public void setProvincia(String provincia) {
|
||||
this.provincia = provincia;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class AbiCabCR extends CRAdapter {
|
||||
private long id_abiCab;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String agenzia;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String capZona;
|
||||
|
||||
private String abi;
|
||||
|
||||
private String cab;
|
||||
|
||||
private String bic;
|
||||
|
||||
private String codiceAlt;
|
||||
|
||||
public AbiCabCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public AbiCabCR() {}
|
||||
|
||||
public void setId_abiCab(long newId_abiCab) {
|
||||
this.id_abiCab = newId_abiCab;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setAgenzia(String newAgenzia) {
|
||||
this.agenzia = newAgenzia;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setCapZona(String newCapZona) {
|
||||
this.capZona = newCapZona;
|
||||
}
|
||||
|
||||
public void setAbi(String newAbi) {
|
||||
this.abi = newAbi;
|
||||
}
|
||||
|
||||
public void setCab(String newCab) {
|
||||
this.cab = newCab;
|
||||
}
|
||||
|
||||
public void setBic(String newBic) {
|
||||
this.bic = newBic;
|
||||
}
|
||||
|
||||
public void setCodiceAlt(String newCodiceAlt) {
|
||||
this.codiceAlt = newCodiceAlt;
|
||||
}
|
||||
|
||||
public long getId_abiCab() {
|
||||
return this.id_abiCab;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getAgenzia() {
|
||||
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getCapZona() {
|
||||
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||
}
|
||||
|
||||
public String getAbi() {
|
||||
return (this.abi == null) ? "" : this.abi.trim();
|
||||
}
|
||||
|
||||
public String getCab() {
|
||||
return (this.cab == null) ? "" : this.cab.trim();
|
||||
}
|
||||
|
||||
public String getBic() {
|
||||
return (this.bic == null) ? "" : this.bic.trim();
|
||||
}
|
||||
|
||||
public String getCodiceAlt() {
|
||||
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class AllegatoClifor extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 8911811275285647807L;
|
||||
|
||||
private long id_allegatoClifor;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoAllegatoClifor;
|
||||
|
||||
private String nomeFile;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoAllegatoClifor tipoAllegatoClifor;
|
||||
|
||||
private String descrizioneAllegato;
|
||||
|
||||
private long flgDefault;
|
||||
|
||||
public AllegatoClifor(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public AllegatoClifor() {}
|
||||
|
||||
public void setId_allegatoClifor(long newId_allegatoClifor) {
|
||||
this.id_allegatoClifor = newId_allegatoClifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_tipoAllegatoClifor(long newId_tipoAllegatoClifor) {
|
||||
this.id_tipoAllegatoClifor = newId_tipoAllegatoClifor;
|
||||
setTipoAllegatoClifor(null);
|
||||
}
|
||||
|
||||
public void setNomeFile(String newNomeFile) {
|
||||
this.nomeFile = newNomeFile;
|
||||
}
|
||||
|
||||
public long getId_allegatoClifor() {
|
||||
return this.id_allegatoClifor;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_tipoAllegatoClifor() {
|
||||
return this.id_tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public String getNomeFile() {
|
||||
return (this.nomeFile == null) ? "" : this.nomeFile.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setTipoAllegatoClifor(TipoAllegatoClifor newTipoAllegatoClifor) {
|
||||
this.tipoAllegatoClifor = newTipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public TipoAllegatoClifor getTipoAllegatoClifor() {
|
||||
this.tipoAllegatoClifor = (TipoAllegatoClifor)getSecondaryObject(this.tipoAllegatoClifor, TipoAllegatoClifor.class,
|
||||
getId_tipoAllegatoClifor());
|
||||
return this.tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {
|
||||
new File(getPathAllegato() + getPathAllegato()).delete();
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(AllegatoCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from ALLEGATO_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByCliforNomeFile(long l_id_clifor, String l_id_nomeFile) {
|
||||
String s_Sql_Find = "select A.* from ALLEGATO_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("A.nomeFile='" + l_id_nomeFile + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByCliforTipo(long l_id_clifor, long l_id_tipoAllegatoClifor, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from ALLEGATO_CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.nomeFile";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
if (l_id_tipoAllegatoClifor > 0L)
|
||||
wc.addWc("A.id_tipoAllegatoClifor=" + l_id_tipoAllegatoClifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getNomeFileSuDisco() {
|
||||
return "" + getId_clifor() + "_" + getId_clifor();
|
||||
}
|
||||
|
||||
public String getDescrizioneAllegato() {
|
||||
return (this.descrizioneAllegato == null) ? "" : this.descrizioneAllegato;
|
||||
}
|
||||
|
||||
public void setDescrizioneAllegato(String descrizioneAllegato) {
|
||||
this.descrizioneAllegato = descrizioneAllegato;
|
||||
}
|
||||
|
||||
protected int getStringValueCase(String l_colomnName) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getFlgDefault() {
|
||||
return this.flgDefault;
|
||||
}
|
||||
|
||||
public void setFlgDefault(long flgDefault) {
|
||||
this.flgDefault = flgDefault;
|
||||
}
|
||||
|
||||
public void findByCliforDefault(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from ALLEGATO_CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.nomeFile";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor = " + l_id_clifor);
|
||||
wc.addWc("A.flgDefault = 1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws SQLException {
|
||||
if (getFlgDefault() == 1L) {
|
||||
AllegatoClifor ac = new AllegatoClifor(getApFull());
|
||||
Vectumerator<AllegatoClifor> vec = new Vectumerator();
|
||||
vec = ac.findByCliforTipo(getId_clifor(), 0L, 0, 0);
|
||||
while (vec.hasMoreElements()) {
|
||||
ac = (AllegatoClifor)vec.nextElement();
|
||||
ac.setFlgDefault(0L);
|
||||
ac.save();
|
||||
}
|
||||
}
|
||||
super.prepareSave(ps);
|
||||
}
|
||||
|
||||
public String getNomeFileCompletoSuDisco() {
|
||||
return getPathAllegato() + getPathAllegato();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class AllegatoCliforCR extends CRAdapter {
|
||||
private long id_allegatoClifor;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoAllegatoClifor;
|
||||
|
||||
private String nomeFile;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoAllegatoClifor tipoAllegatoClifor;
|
||||
|
||||
public AllegatoCliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public AllegatoCliforCR() {}
|
||||
|
||||
public void setId_allegatoClifor(long newId_allegatoClifor) {
|
||||
this.id_allegatoClifor = newId_allegatoClifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_tipoAllegatoClifor(long newId_tipoAllegatoClifor) {
|
||||
this.id_tipoAllegatoClifor = newId_tipoAllegatoClifor;
|
||||
setTipoAllegatoClifor(null);
|
||||
}
|
||||
|
||||
public void setNomeFile(String newNomeFile) {
|
||||
this.nomeFile = newNomeFile;
|
||||
}
|
||||
|
||||
public long getId_allegatoClifor() {
|
||||
return this.id_allegatoClifor;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_tipoAllegatoClifor() {
|
||||
return this.id_tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public String getNomeFile() {
|
||||
return (this.nomeFile == null) ? "" : this.nomeFile.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setTipoAllegatoClifor(TipoAllegatoClifor newTipoAllegatoClifor) {
|
||||
this.tipoAllegatoClifor = newTipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public TipoAllegatoClifor getTipoAllegatoClifor() {
|
||||
this.tipoAllegatoClifor = (TipoAllegatoClifor)getSecondaryObject(this.tipoAllegatoClifor, TipoAllegatoClifor.class,
|
||||
|
||||
getId_tipoAllegatoClifor());
|
||||
return this.tipoAllegatoClifor;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Aspetto extends _AnagAdapter implements Serializable {
|
||||
private long id_aspetto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public Aspetto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Aspetto() {}
|
||||
|
||||
public void setId_aspetto(long newId_aspetto) {
|
||||
this.id_aspetto = newId_aspetto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_aspetto() {
|
||||
return this.id_aspetto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(AspettoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from ASPETTO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class AspettoCR extends CRAdapter {
|
||||
private long id_aspetto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public AspettoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public AspettoCR() {}
|
||||
|
||||
public void setId_aspetto(long newId_aspetto) {
|
||||
this.id_aspetto = newId_aspetto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_aspetto() {
|
||||
return this.id_aspetto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,460 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Banca extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1423651664351L;
|
||||
|
||||
private long id_banca;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String iban;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String telefono;
|
||||
|
||||
private String email;
|
||||
|
||||
private String abi;
|
||||
|
||||
private String capZona;
|
||||
|
||||
private double importoRiba;
|
||||
|
||||
private Comune comune;
|
||||
|
||||
private String codiceAlt;
|
||||
|
||||
private String agenzia;
|
||||
|
||||
private String cab;
|
||||
|
||||
private String bic;
|
||||
|
||||
private String numeroConto;
|
||||
|
||||
private long ordine;
|
||||
|
||||
private long flgDefaultBonifico;
|
||||
|
||||
private long flgVisualizzaPresentazione;
|
||||
|
||||
public Banca(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Banca() {}
|
||||
|
||||
public void setId_banca(long newId_banca) {
|
||||
this.id_banca = newId_banca;
|
||||
}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIban(String newIban) {
|
||||
this.iban = newIban;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setTelefono(String newTelefono) {
|
||||
this.telefono = newTelefono;
|
||||
}
|
||||
|
||||
public void setEmail(String newEmail) {
|
||||
this.email = newEmail;
|
||||
}
|
||||
|
||||
public void setBic(String newBic) {
|
||||
this.bic = newBic;
|
||||
}
|
||||
|
||||
public void setCapZona(String newCapZona) {
|
||||
this.capZona = newCapZona;
|
||||
}
|
||||
|
||||
public long getId_banca() {
|
||||
return this.id_banca;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIban() {
|
||||
return (this.iban == null) ? "" : this.iban.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return (this.email == null) ? "" : this.email.trim();
|
||||
}
|
||||
|
||||
public String getBic() {
|
||||
return (this.bic == null) ? "" : this.bic.trim();
|
||||
}
|
||||
|
||||
public String getCapZona() {
|
||||
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||
}
|
||||
|
||||
public void setComune(Comune newComune) {
|
||||
this.comune = newComune;
|
||||
}
|
||||
|
||||
public Comune getComune() {
|
||||
this.comune = (Comune)getSecondaryObject(this.comune, Comune.class, getId_comune());
|
||||
return this.comune;
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Banca> findByCR(BancaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getCodiceAlt() {
|
||||
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||
}
|
||||
|
||||
public void setCodiceAlt(String codieAlt) {
|
||||
this.codiceAlt = codieAlt;
|
||||
}
|
||||
|
||||
public String getAgenzia() {
|
||||
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||
}
|
||||
|
||||
public void setAgenzia(String agenzia) {
|
||||
this.agenzia = agenzia;
|
||||
}
|
||||
|
||||
public String getAbi() {
|
||||
if (this.abi == null &&
|
||||
getIban().length() >= 11)
|
||||
this.abi = getIban().substring(6, 11);
|
||||
return (this.abi == null) ? "" : this.abi.trim();
|
||||
}
|
||||
|
||||
public void setAbi(String abi) {
|
||||
this.abi = abi;
|
||||
}
|
||||
|
||||
public String getCab() {
|
||||
if (this.cab == null &&
|
||||
getIban().length() >= 15)
|
||||
this.cab = getIban().substring(11, 15);
|
||||
return (this.cab == null) ? "" : this.cab.trim();
|
||||
}
|
||||
|
||||
public void setCab(String cab) {
|
||||
this.cab = cab;
|
||||
}
|
||||
|
||||
public String getNumeroConto() {
|
||||
return (this.numeroConto == null) ? "" : this.numeroConto.trim();
|
||||
}
|
||||
|
||||
public void setNumeroConto(String numeroConto) {
|
||||
this.numeroConto = numeroConto;
|
||||
}
|
||||
|
||||
public void findByCodiceAlt(String codiceAlt) {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.codiceAlt='" + codiceAlt + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getConto() {
|
||||
if (getIban().length() > 16)
|
||||
return getIban().substring(16, getIban().length());
|
||||
return "";
|
||||
}
|
||||
|
||||
public long getOrdine() {
|
||||
return this.ordine;
|
||||
}
|
||||
|
||||
public void setOrdine(long ordine) {
|
||||
this.ordine = ordine;
|
||||
}
|
||||
|
||||
public Vectumerator<Banca> findByOrdine() {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm settaOrdineMeno() {
|
||||
ResParm rp = new ResParm(true);
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findPrecedenteByOrdine(getOrdine());
|
||||
if (banca.getDBState() == 1) {
|
||||
long l_ordine = banca.getOrdine();
|
||||
banca.setOrdine(getOrdine());
|
||||
rp = banca.save();
|
||||
setOrdine(l_ordine);
|
||||
rp.append(save());
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public ResParm settaOrdinePiu() {
|
||||
ResParm rp = new ResParm(true);
|
||||
Banca banca = new Banca(getApFull());
|
||||
banca.findSuccessivoByOrdine(getOrdine());
|
||||
if (banca.getDBState() == 1) {
|
||||
long l_ordine = banca.getOrdine();
|
||||
banca.setOrdine(getOrdine());
|
||||
rp = banca.save();
|
||||
setOrdine(l_ordine);
|
||||
rp.append(save());
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public double getImportoRiba() {
|
||||
return this.importoRiba;
|
||||
}
|
||||
|
||||
public void setImportoRiba(double importoRiba) {
|
||||
this.importoRiba = importoRiba;
|
||||
}
|
||||
|
||||
public void findPrecedenteByOrdine(long l_ordine) {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine desc";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.ordine<" + l_ordine);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findSuccessivoByOrdine(long l_ordine) {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine asc";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.ordine>" + l_ordine);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public long getFlgDefaultBonifico() {
|
||||
return this.flgDefaultBonifico;
|
||||
}
|
||||
|
||||
public void setFlgDefaultBonifico(long flgDefaultBonifico) {
|
||||
this.flgDefaultBonifico = flgDefaultBonifico;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getFlgDefaultBonifico() == 1L);
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public void findBancaDefault() {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgDefaultBonifico=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected ResParm resetDefaultBancaBonifico() {
|
||||
String sql = "update BANCA set flgDefaultBonifico = null";
|
||||
return update(sql);
|
||||
}
|
||||
|
||||
public long getFlgVisualizzaPresentazione() {
|
||||
return this.flgVisualizzaPresentazione;
|
||||
}
|
||||
|
||||
public void setFlgVisualizzaPresentazione(long flgVisualizzaPresentazione) {
|
||||
this.flgVisualizzaPresentazione = flgVisualizzaPresentazione;
|
||||
}
|
||||
|
||||
public ResParm resetPresentazioneRibaAuto() {
|
||||
String sql = "update BANCA set flgVisualizzaPresentazione = 0,ordine = 0";
|
||||
return update(sql);
|
||||
}
|
||||
|
||||
public Vectumerator<Banca> findByOrdineVisibili() {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgVisualizzaPresentazione=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Banca> findNonVisibili() {
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("(A.flgVisualizzaPresentazione is null or A.flgVisualizzaPresentazione =0)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm addBancaAPresentazioneRibaAuto() {
|
||||
if (getId_banca() > 0L) {
|
||||
setFlgVisualizzaPresentazione(1L);
|
||||
setOrdine(getMaxOrdine() + 1L);
|
||||
return save();
|
||||
}
|
||||
return new ResParm(false, "ERRORE! Non puoi aggiungere una banca nulla alla presentazione riba!");
|
||||
}
|
||||
|
||||
public ResParm rimuoviBancaAPresentazioneRibaAuto() {
|
||||
if (getId_banca() > 0L) {
|
||||
setFlgVisualizzaPresentazione(0L);
|
||||
setOrdine(0L);
|
||||
return save();
|
||||
}
|
||||
return new ResParm(false, "ERRORE! Non puoi togliere una banca nulla alla presentazione riba!");
|
||||
}
|
||||
|
||||
public long getMaxOrdine() {
|
||||
String s_Sql_Find = "select max(A.ordine) as _max from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine asc";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return (long)getMax(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return -1L;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneScript() {
|
||||
return DBAdapter.prepareScriptString(getDescrizione());
|
||||
}
|
||||
|
||||
public String getBancheDefaultBonificoDesc() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String s_Sql_Find = "select A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgDefaultBonifico=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator<Banca> vec = findRows(stmt);
|
||||
while (vec.hasMoreElements()) {
|
||||
Banca row = (Banca)vec.nextElement();
|
||||
sb.append(row.getDescrizione());
|
||||
sb.append(" ");
|
||||
sb.append(row.getIban());
|
||||
if (vec.hasMoreElements())
|
||||
sb.append(" - ");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class BancaCR extends CRAdapter {
|
||||
private long id_banca;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String iban;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String telefono;
|
||||
|
||||
private String email;
|
||||
|
||||
private String bic;
|
||||
|
||||
private String capZona;
|
||||
|
||||
private Comune comune;
|
||||
|
||||
public BancaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public BancaCR() {}
|
||||
|
||||
public void setId_banca(long newId_banca) {
|
||||
this.id_banca = newId_banca;
|
||||
}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIban(String newIban) {
|
||||
this.iban = newIban;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setTelefono(String newTelefono) {
|
||||
this.telefono = newTelefono;
|
||||
}
|
||||
|
||||
public void setEmail(String newEmail) {
|
||||
this.email = newEmail;
|
||||
}
|
||||
|
||||
public void setBic(String newBic) {
|
||||
this.bic = newBic;
|
||||
}
|
||||
|
||||
public void setCapZona(String newCapZona) {
|
||||
this.capZona = newCapZona;
|
||||
}
|
||||
|
||||
public long getId_banca() {
|
||||
return this.id_banca;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIban() {
|
||||
return (this.iban == null) ? "" : this.iban.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return (this.email == null) ? "" : this.email.trim();
|
||||
}
|
||||
|
||||
public String getBic() {
|
||||
return (this.bic == null) ? "" : this.bic.trim();
|
||||
}
|
||||
|
||||
public String getCapZona() {
|
||||
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||
}
|
||||
|
||||
public void setComune(Comune newComune) {
|
||||
this.comune = newComune;
|
||||
}
|
||||
|
||||
public Comune getComune() {
|
||||
this.comune = (Comune)getSecondaryObject(this.comune, Comune.class,
|
||||
|
||||
getId_comune());
|
||||
return this.comune;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CausaleTrasporto extends _AnagAdapter implements Serializable {
|
||||
private long id_causaleTrasporto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public CausaleTrasporto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CausaleTrasporto() {}
|
||||
|
||||
public void setId_causaleTrasporto(long newId_causaleMagazzino) {
|
||||
this.id_causaleTrasporto = newId_causaleMagazzino;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_causaleTrasporto() {
|
||||
return this.id_causaleTrasporto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(CausaleTrasportoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CAUSALE_TRASPORTO AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class CausaleTrasportoCR extends CRAdapter {
|
||||
private long id_causaleTrasporto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public CausaleTrasportoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CausaleTrasportoCR() {}
|
||||
|
||||
public void setId_causaleTrasporto(long newId_causaleMagazzino) {
|
||||
this.id_causaleTrasporto = newId_causaleMagazzino;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_causaleTrasporto() {
|
||||
return this.id_causaleTrasporto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.Vectumerator;
|
||||
|
||||
public class Cliente extends Clifor {
|
||||
private static final long serialVersionUID = 486912705000890691L;
|
||||
|
||||
private long id_cliente;
|
||||
|
||||
public Cliente() {}
|
||||
|
||||
public Cliente(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getTableBeanName() {
|
||||
return "CLIFOR";
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "C";
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(ClienteCR CR, int pageNumber, int pageRows) {
|
||||
return findByCR(CR, pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public long getId_cliente() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_cliente(long id_cliente) {
|
||||
setId_clifor(id_cliente);
|
||||
}
|
||||
|
||||
protected String sqlStringfindAll() {
|
||||
return "select * from CLIFOR where id_clifor>1 and flgTipo='C' order by cognome, nome";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
|
||||
public class ClienteCR extends CliforCR {
|
||||
private long id_cliente;
|
||||
|
||||
public ClienteCR() {}
|
||||
|
||||
public ClienteCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "C";
|
||||
}
|
||||
|
||||
public long getId_cliente() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_cliente(long id_cliente) {
|
||||
setId_clifor(id_cliente);
|
||||
}
|
||||
}
|
||||
2741
decompiled-libs/www/acxent-common-1.0.1/it/acxent/anag/Clifor.java
Normal file
2741
decompiled-libs/www/acxent-common-1.0.1/it/acxent/anag/Clifor.java
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,737 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import java.sql.Date;
|
||||
|
||||
public class CliforCR extends CRAdapter {
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private String codiceAlt;
|
||||
|
||||
private long flgValido;
|
||||
|
||||
private String flgTipo;
|
||||
|
||||
private long flgAzienda = -1L;
|
||||
|
||||
private String cognome;
|
||||
|
||||
private String contatto;
|
||||
|
||||
private String nome;
|
||||
|
||||
private String testoMessaggio;
|
||||
|
||||
private String numeroCivico;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private long id_nazione;
|
||||
|
||||
private Date dataNascita;
|
||||
|
||||
private String codFisc;
|
||||
|
||||
private String pIva;
|
||||
|
||||
private String eMail;
|
||||
|
||||
private String fax;
|
||||
|
||||
private String telefono;
|
||||
|
||||
private String nota;
|
||||
|
||||
private String imgTmst;
|
||||
|
||||
private long flgPrivComunicazione;
|
||||
|
||||
private long flgPrivSensibili;
|
||||
|
||||
private long flgPrivTrattamento;
|
||||
|
||||
private long flgSesso;
|
||||
|
||||
private String indirizzoSped;
|
||||
|
||||
private String numeroCivicoSped;
|
||||
|
||||
private String presso;
|
||||
|
||||
private long id_nazioneSped;
|
||||
|
||||
private long id_comuneSped;
|
||||
|
||||
private Date dataRegistrazioneDI;
|
||||
|
||||
private String dichiarazioneIntento;
|
||||
|
||||
private String flgCF;
|
||||
|
||||
private long flgArt8;
|
||||
|
||||
private long flgTipologiaClifor;
|
||||
|
||||
private TipoPagamento tipoPagamento;
|
||||
|
||||
private Comune comune;
|
||||
|
||||
private Nazione nazione;
|
||||
|
||||
private Nazione nazioneSped;
|
||||
|
||||
private Comune comuneSped;
|
||||
|
||||
private long id_cliforEscludi;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private long flgMlCreata = 0L;
|
||||
|
||||
private String mailingListEmail;
|
||||
|
||||
private long flgMl = -1L;
|
||||
|
||||
private String searchTxt2;
|
||||
|
||||
private String numeroDocumento;
|
||||
|
||||
private Date DataScadenzaDocumento;
|
||||
|
||||
private double percProvvigione;
|
||||
|
||||
private long flgNascondiWeb = -1L;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String descrizioneComune;
|
||||
|
||||
private String provinciaComune;
|
||||
|
||||
private Clifor agente;
|
||||
|
||||
private long id_agente;
|
||||
|
||||
private long id_respCommerciale;
|
||||
|
||||
private Clifor respCommerciale;
|
||||
|
||||
private long id_tipoClifor;
|
||||
|
||||
private long flgPA = -1L;
|
||||
|
||||
private long flgSplitPayment = -1L;
|
||||
|
||||
private long flgTaxFree = -1L;
|
||||
|
||||
private long id_usersResponsabile;
|
||||
|
||||
private Users usersResponsabile;
|
||||
|
||||
private long flgStatoConfermaDati = -1L;
|
||||
|
||||
private long id_usersAttivita;
|
||||
|
||||
private Users usersAttivita;
|
||||
|
||||
private long flgEscludi = -1L;
|
||||
|
||||
public CliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforCR() {}
|
||||
|
||||
public void setId_clifor(long newId_cliFor) {
|
||||
this.id_clifor = newId_cliFor;
|
||||
}
|
||||
|
||||
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||
this.id_tipoPagamento = newId_tipoPagamento;
|
||||
setTipoPagamento(null);
|
||||
}
|
||||
|
||||
public void setCodiceAlt(String newCodiceAlt) {
|
||||
this.codiceAlt = newCodiceAlt;
|
||||
}
|
||||
|
||||
public void setFlgValido(long newFlgValido) {
|
||||
this.flgValido = newFlgValido;
|
||||
}
|
||||
|
||||
public void setFlgTipo(String newFlgTipo) {
|
||||
this.flgTipo = newFlgTipo;
|
||||
}
|
||||
|
||||
public void setFlgAzienda(long newFlgAzienda) {
|
||||
this.flgAzienda = newFlgAzienda;
|
||||
}
|
||||
|
||||
public void setCognome(String newCognome) {
|
||||
this.cognome = newCognome;
|
||||
}
|
||||
|
||||
public void setContatto(String newContatto) {
|
||||
this.contatto = newContatto;
|
||||
}
|
||||
|
||||
public void setNome(String newNome) {
|
||||
this.nome = newNome;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setNumeroCivico(String newNumeroCivico) {
|
||||
this.numeroCivico = newNumeroCivico;
|
||||
}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setId_nazione(long newId_nazione) {
|
||||
this.id_nazione = newId_nazione;
|
||||
setNazione(null);
|
||||
}
|
||||
|
||||
public void setDataNascita(Date newDataNascita) {
|
||||
this.dataNascita = newDataNascita;
|
||||
}
|
||||
|
||||
public void setCodFisc(String newCodFisc) {
|
||||
this.codFisc = newCodFisc;
|
||||
}
|
||||
|
||||
public void setPIva(String newPIva) {
|
||||
this.pIva = newPIva;
|
||||
}
|
||||
|
||||
public void setEMail(String newEMail) {
|
||||
this.eMail = newEMail;
|
||||
}
|
||||
|
||||
public void setFax(String newFax) {
|
||||
this.fax = newFax;
|
||||
}
|
||||
|
||||
public void setTelefono(String newTelefono) {
|
||||
this.telefono = newTelefono;
|
||||
}
|
||||
|
||||
public void setNota(String newNota) {
|
||||
this.nota = newNota;
|
||||
}
|
||||
|
||||
public void setImgTmst(String newImgTmst) {
|
||||
this.imgTmst = newImgTmst;
|
||||
}
|
||||
|
||||
public void setFlgPrivComunicazione(long newFlgPrivComunicazione) {
|
||||
this.flgPrivComunicazione = newFlgPrivComunicazione;
|
||||
}
|
||||
|
||||
public void setFlgPrivSensibili(long newFlgPrivSensibili) {
|
||||
this.flgPrivSensibili = newFlgPrivSensibili;
|
||||
}
|
||||
|
||||
public void setFlgPrivTrattamento(long newFlgPrivTrattamento) {
|
||||
this.flgPrivTrattamento = newFlgPrivTrattamento;
|
||||
}
|
||||
|
||||
public void setFlgSesso(long newFlgSesso) {
|
||||
this.flgSesso = newFlgSesso;
|
||||
}
|
||||
|
||||
public void setIndirizzoSped(String newIndirizzoSped) {
|
||||
this.indirizzoSped = newIndirizzoSped;
|
||||
}
|
||||
|
||||
public void setNumeroCivicoSped(String newNumeroCivicoSped) {
|
||||
this.numeroCivicoSped = newNumeroCivicoSped;
|
||||
}
|
||||
|
||||
public void setPresso(String newPresso) {
|
||||
this.presso = newPresso;
|
||||
}
|
||||
|
||||
public void setId_nazioneSped(long newId_nazioneSped) {
|
||||
this.id_nazioneSped = newId_nazioneSped;
|
||||
setNazione(null);
|
||||
}
|
||||
|
||||
public void setId_comuneSped(long newId_comuneSped) {
|
||||
this.id_comuneSped = newId_comuneSped;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setDataRegistrazioneDI(Date newDataRegistrazioneDI) {
|
||||
this.dataRegistrazioneDI = newDataRegistrazioneDI;
|
||||
}
|
||||
|
||||
public void setDichiarazioneIntento(String newDichiarazioneIntento) {
|
||||
this.dichiarazioneIntento = newDichiarazioneIntento;
|
||||
}
|
||||
|
||||
public void setFlgArt8(long newFlgArt8) {
|
||||
this.flgArt8 = newFlgArt8;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public String getCodiceAlt() {
|
||||
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||
}
|
||||
|
||||
public long getFlgValido() {
|
||||
return this.flgValido;
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return (this.flgTipo == null) ? "" : this.flgTipo.trim();
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return Clifor.getTipo(getFlgTipo());
|
||||
}
|
||||
|
||||
public long getFlgAzienda() {
|
||||
return this.flgAzienda;
|
||||
}
|
||||
|
||||
public String getCognome() {
|
||||
return (this.cognome == null) ? "" : this.cognome.trim();
|
||||
}
|
||||
|
||||
public String getContatto() {
|
||||
return (this.contatto == null) ? "" : this.contatto.trim();
|
||||
}
|
||||
|
||||
public String getNome() {
|
||||
return (this.nome == null) ? "" : this.nome.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivico() {
|
||||
return (this.numeroCivico == null) ? "" : this.numeroCivico.trim();
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public long getId_nazione() {
|
||||
return this.id_nazione;
|
||||
}
|
||||
|
||||
public Date getDataNascita() {
|
||||
return this.dataNascita;
|
||||
}
|
||||
|
||||
public String getCodFisc() {
|
||||
return (this.codFisc == null) ? "" : this.codFisc.trim();
|
||||
}
|
||||
|
||||
public String getPIva() {
|
||||
return (this.pIva == null) ? "" : this.pIva.trim();
|
||||
}
|
||||
|
||||
public String getEMail() {
|
||||
return (this.eMail == null) ? "" : this.eMail.trim();
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return (this.fax == null) ? "" : this.fax.trim();
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||
}
|
||||
|
||||
public String getNota() {
|
||||
return (this.nota == null) ? "" : this.nota.trim();
|
||||
}
|
||||
|
||||
public String getImgTmst() {
|
||||
return (this.imgTmst == null) ? "" : this.imgTmst.trim();
|
||||
}
|
||||
|
||||
public long getFlgPrivComunicazione() {
|
||||
return this.flgPrivComunicazione;
|
||||
}
|
||||
|
||||
public long getFlgPrivSensibili() {
|
||||
return this.flgPrivSensibili;
|
||||
}
|
||||
|
||||
public long getFlgPrivTrattamento() {
|
||||
return this.flgPrivTrattamento;
|
||||
}
|
||||
|
||||
public long getFlgSesso() {
|
||||
return this.flgSesso;
|
||||
}
|
||||
|
||||
public String getIndirizzoSped() {
|
||||
return (this.indirizzoSped == null) ? "" : this.indirizzoSped.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivicoSped() {
|
||||
return (this.numeroCivicoSped == null) ? "" : this.numeroCivicoSped.trim();
|
||||
}
|
||||
|
||||
public String getPresso() {
|
||||
return (this.presso == null) ? "" : this.presso.trim();
|
||||
}
|
||||
|
||||
public long getId_nazioneSped() {
|
||||
return this.id_nazioneSped;
|
||||
}
|
||||
|
||||
public long getId_comuneSped() {
|
||||
return this.id_comuneSped;
|
||||
}
|
||||
|
||||
public Date getDataRegistrazioneDI() {
|
||||
return this.dataRegistrazioneDI;
|
||||
}
|
||||
|
||||
public String getDichiarazioneIntento() {
|
||||
return (this.dichiarazioneIntento == null) ? "" : this.dichiarazioneIntento.trim();
|
||||
}
|
||||
|
||||
public long getFlgArt8() {
|
||||
return this.flgArt8;
|
||||
}
|
||||
|
||||
public void setTipoPagamento(TipoPagamento newTipoPagamento) {
|
||||
this.tipoPagamento = newTipoPagamento;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamento() {
|
||||
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class, getId_tipoPagamento());
|
||||
return this.tipoPagamento;
|
||||
}
|
||||
|
||||
public void setComune(Comune newComune) {
|
||||
this.comune = newComune;
|
||||
}
|
||||
|
||||
public Comune getComune() {
|
||||
this.comune = (Comune)getSecondaryObject(this.comune, Comune.class, getId_comune());
|
||||
return this.comune;
|
||||
}
|
||||
|
||||
public void setNazione(Nazione newNazione) {
|
||||
this.nazione = newNazione;
|
||||
}
|
||||
|
||||
public Nazione getNazione() {
|
||||
this.nazione = (Nazione)getSecondaryObject(this.nazione, Nazione.class, getId_nazione());
|
||||
return this.nazione;
|
||||
}
|
||||
|
||||
public void setNazioneSped(Nazione newNazione) {
|
||||
this.nazioneSped = newNazione;
|
||||
}
|
||||
|
||||
public Nazione getNazioneSped() {
|
||||
this.nazioneSped = (Nazione)getSecondaryObject(this.nazioneSped, Nazione.class, getId_nazioneSped());
|
||||
return this.nazioneSped;
|
||||
}
|
||||
|
||||
public void setComuneSped(Comune newComune) {
|
||||
this.comuneSped = newComune;
|
||||
}
|
||||
|
||||
public Comune getComuneSped() {
|
||||
this.comuneSped = (Comune)getSecondaryObject(this.comuneSped, Comune.class, getId_comuneSped());
|
||||
return this.comuneSped;
|
||||
}
|
||||
|
||||
public String getFlgCF() {
|
||||
return (this.flgCF == null) ? AB_EMPTY_STRING : this.flgCF;
|
||||
}
|
||||
|
||||
public String getCF() {
|
||||
if (getFlgCF().equals("C"))
|
||||
return "Cliente";
|
||||
if (getFlgCF().equals("F"))
|
||||
return "Fornitore";
|
||||
return AB_EMPTY_STRING;
|
||||
}
|
||||
|
||||
public void setFlgCF(String flgCF) {
|
||||
this.flgCF = flgCF;
|
||||
setFlgTipo(flgCF);
|
||||
}
|
||||
|
||||
public long getId_cliforEscludi() {
|
||||
return this.id_cliforEscludi;
|
||||
}
|
||||
|
||||
public void setId_cliforEscludi(long id_cliforEscludi) {
|
||||
this.id_cliforEscludi = id_cliforEscludi;
|
||||
}
|
||||
|
||||
public String getTestoMessaggio() {
|
||||
return (this.testoMessaggio == null) ? AB_EMPTY_STRING : this.testoMessaggio.trim();
|
||||
}
|
||||
|
||||
public void setTestoMessaggio(String testoMessaggio) {
|
||||
this.testoMessaggio = testoMessaggio;
|
||||
}
|
||||
|
||||
public long getFlgMlCreata() {
|
||||
return this.flgMlCreata;
|
||||
}
|
||||
|
||||
public void setFlgMlCreata(long flgMlCreata) {
|
||||
this.flgMlCreata = flgMlCreata;
|
||||
}
|
||||
|
||||
public String getMailingListEmail() {
|
||||
return this.mailingListEmail;
|
||||
}
|
||||
|
||||
public void setMailingListEmail(String mailingListEmail) {
|
||||
this.mailingListEmail = mailingListEmail;
|
||||
}
|
||||
|
||||
public long getFlgMl() {
|
||||
return this.flgMl;
|
||||
}
|
||||
|
||||
public void setFlgMl(long flgMl) {
|
||||
this.flgMl = flgMl;
|
||||
}
|
||||
|
||||
public String getSearchTxt2() {
|
||||
return (this.searchTxt2 == null) ? AB_EMPTY_STRING : this.searchTxt2;
|
||||
}
|
||||
|
||||
public void setSearchTxt2(String searchText2) {
|
||||
this.searchTxt2 = searchText2;
|
||||
}
|
||||
|
||||
public String getNumeroDocumento() {
|
||||
return this.numeroDocumento;
|
||||
}
|
||||
|
||||
public void setNumeroDocumento(String numeroDocumento) {
|
||||
this.numeroDocumento = numeroDocumento;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaDocumento() {
|
||||
return this.DataScadenzaDocumento;
|
||||
}
|
||||
|
||||
public void setDataScadenzaDocumento(Date dataScadenzaDocumento) {
|
||||
this.DataScadenzaDocumento = dataScadenzaDocumento;
|
||||
}
|
||||
|
||||
public double getPercProvvigione() {
|
||||
return this.percProvvigione;
|
||||
}
|
||||
|
||||
public void setPercProvvigione(double percProvvigione) {
|
||||
this.percProvvigione = percProvvigione;
|
||||
}
|
||||
|
||||
public long getFlgNascondiWeb() {
|
||||
return this.flgNascondiWeb;
|
||||
}
|
||||
|
||||
public void setFlgNascondiWeb(long flgVisibileWeb) {
|
||||
this.flgNascondiWeb = flgVisibileWeb;
|
||||
}
|
||||
|
||||
public long getFlgTipologiaClifor() {
|
||||
return this.flgTipologiaClifor;
|
||||
}
|
||||
|
||||
public void setFlgTipologiaClifor(long flgTipologiaClifor) {
|
||||
this.flgTipologiaClifor = flgTipologiaClifor;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return (this.fileName == null) ? AB_EMPTY_STRING : this.fileName.trim();
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getpIva() {
|
||||
return this.pIva;
|
||||
}
|
||||
|
||||
public void setpIva(String pIva) {
|
||||
this.pIva = pIva;
|
||||
}
|
||||
|
||||
public String geteMail() {
|
||||
return this.eMail;
|
||||
}
|
||||
|
||||
public void seteMail(String eMail) {
|
||||
this.eMail = eMail;
|
||||
}
|
||||
|
||||
public String getDescrizioneComune() {
|
||||
return (this.descrizioneComune == null) ? AB_EMPTY_STRING : this.descrizioneComune;
|
||||
}
|
||||
|
||||
public void setDescrizioneComune(String descrizioneComune) {
|
||||
this.descrizioneComune = descrizioneComune;
|
||||
}
|
||||
|
||||
public String getProvinciaComune() {
|
||||
return (this.provinciaComune == null) ? AB_EMPTY_STRING : this.provinciaComune;
|
||||
}
|
||||
|
||||
public void setProvinciaComune(String provinciaComune) {
|
||||
this.provinciaComune = provinciaComune;
|
||||
}
|
||||
|
||||
public Clifor getAgente() {
|
||||
this.agente = (Clifor)getSecondaryObject(this.agente, Clifor.class, getId_agente());
|
||||
return this.agente;
|
||||
}
|
||||
|
||||
public long getId_agente() {
|
||||
return this.id_agente;
|
||||
}
|
||||
|
||||
public long getId_respCommerciale() {
|
||||
return this.id_respCommerciale;
|
||||
}
|
||||
|
||||
public Clifor getRespCommerciale() {
|
||||
this.respCommerciale = (Clifor)getSecondaryObject(this.respCommerciale, Clifor.class, getId_respCommerciale());
|
||||
return this.respCommerciale;
|
||||
}
|
||||
|
||||
public void setAgente(Clifor agente) {
|
||||
this.agente = agente;
|
||||
}
|
||||
|
||||
public void setId_agente(long id_agente) {
|
||||
this.id_agente = id_agente;
|
||||
}
|
||||
|
||||
public void setId_respCommerciale(long id_respCommerciale) {
|
||||
this.id_respCommerciale = id_respCommerciale;
|
||||
}
|
||||
|
||||
public void setRespCommerciale(Clifor respCommerciale) {
|
||||
this.respCommerciale = respCommerciale;
|
||||
}
|
||||
|
||||
public long getId_tipoClifor() {
|
||||
return this.id_tipoClifor;
|
||||
}
|
||||
|
||||
public void setId_tipoClifor(long id_tipoClifor) {
|
||||
this.id_tipoClifor = id_tipoClifor;
|
||||
}
|
||||
|
||||
public long getFlgPA() {
|
||||
return this.flgPA;
|
||||
}
|
||||
|
||||
public void setFlgPA(long flgPA) {
|
||||
this.flgPA = flgPA;
|
||||
}
|
||||
|
||||
public long getFlgSplitPayment() {
|
||||
return this.flgSplitPayment;
|
||||
}
|
||||
|
||||
public void setFlgSplitPayment(long flgSplitPayment) {
|
||||
this.flgSplitPayment = flgSplitPayment;
|
||||
}
|
||||
|
||||
public long getFlgTaxFree() {
|
||||
return this.flgTaxFree;
|
||||
}
|
||||
|
||||
public void setFlgTaxFree(long flgTaxFree) {
|
||||
this.flgTaxFree = flgTaxFree;
|
||||
}
|
||||
|
||||
public long getId_usersResponsabile() {
|
||||
return this.id_usersResponsabile;
|
||||
}
|
||||
|
||||
public Users getUsersResponsabile() {
|
||||
this.usersResponsabile = (Users)getSecondaryObject((DBAdapter)this.usersResponsabile, Users.class, getId_usersResponsabile());
|
||||
return this.usersResponsabile;
|
||||
}
|
||||
|
||||
public void setId_usersResponsabile(long id_usersResponsabile) {
|
||||
this.id_usersResponsabile = id_usersResponsabile;
|
||||
setUsersResponsabile(null);
|
||||
}
|
||||
|
||||
public void setUsersResponsabile(Users usersResponsabile) {
|
||||
this.usersResponsabile = usersResponsabile;
|
||||
}
|
||||
|
||||
public long getFlgStatoConfermaDati() {
|
||||
return this.flgStatoConfermaDati;
|
||||
}
|
||||
|
||||
public void setFlgStatoConfermaDati(long flgStatoConfermaDati) {
|
||||
this.flgStatoConfermaDati = flgStatoConfermaDati;
|
||||
}
|
||||
|
||||
public static final String getStatoConfermaDati(long l_flgStatoConfermaDati) {
|
||||
return Clifor.getStatoConfermaDati(l_flgStatoConfermaDati);
|
||||
}
|
||||
|
||||
public final String getStatoConfermaDati() {
|
||||
return getStatoConfermaDati(getFlgStatoConfermaDati());
|
||||
}
|
||||
|
||||
public long getId_usersAttivita() {
|
||||
return this.id_usersAttivita;
|
||||
}
|
||||
|
||||
public Users getUsersAttivita() {
|
||||
this.usersAttivita = (Users)getSecondaryObject((DBAdapter)this.usersAttivita, Users.class, getId_usersAttivita());
|
||||
return this.usersAttivita;
|
||||
}
|
||||
|
||||
public void setId_usersAttivita(long id_usersAttivita) {
|
||||
this.id_usersAttivita = id_usersAttivita;
|
||||
setUsersAttivita(null);
|
||||
}
|
||||
|
||||
public void setUsersAttivita(Users usersAttivita) {
|
||||
this.usersAttivita = usersAttivita;
|
||||
}
|
||||
|
||||
public long getFlgEscludi() {
|
||||
return this.flgEscludi;
|
||||
}
|
||||
|
||||
public void setFlgEscludi(long flgEscludi) {
|
||||
this.flgEscludi = flgEscludi;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Date;
|
||||
|
||||
public interface CliforInterface {
|
||||
void setId_clifor(long paramLong);
|
||||
|
||||
void setId_tipoPagamento(long paramLong);
|
||||
|
||||
void setCodiceAlt(String paramString);
|
||||
|
||||
void setFlgValido(long paramLong);
|
||||
|
||||
void setFlgTipo(String paramString);
|
||||
|
||||
void setFlgAzienda(long paramLong);
|
||||
|
||||
void setCognome(String paramString);
|
||||
|
||||
void setContatto(String paramString);
|
||||
|
||||
void setNome(String paramString);
|
||||
|
||||
void setIndirizzo(String paramString);
|
||||
|
||||
void setNumeroCivico(String paramString);
|
||||
|
||||
void setId_comune(long paramLong);
|
||||
|
||||
void setId_nazione(String paramString);
|
||||
|
||||
void setDataNascita(Date paramDate);
|
||||
|
||||
void setCodFisc(String paramString);
|
||||
|
||||
void setPIva(String paramString);
|
||||
|
||||
void setEMail(String paramString);
|
||||
|
||||
void setFax(String paramString);
|
||||
|
||||
void setTelefono(String paramString);
|
||||
|
||||
void setNota(String paramString);
|
||||
|
||||
void setImgTmst(String paramString);
|
||||
|
||||
void setFlgPrivComunicazione(long paramLong);
|
||||
|
||||
void setFlgPrivSensibili(long paramLong);
|
||||
|
||||
void setFlgPrivTrattamento(long paramLong);
|
||||
|
||||
void setFlgSesso(long paramLong);
|
||||
|
||||
void setWww(String paramString);
|
||||
|
||||
void setDataRegistrazioneDI(Date paramDate);
|
||||
|
||||
void setDichiarazioneIntento(String paramString);
|
||||
|
||||
void setFlgArt8(long paramLong);
|
||||
|
||||
long getId_clifor();
|
||||
|
||||
long getId_tipoPagamento();
|
||||
|
||||
String getCodiceAlt();
|
||||
|
||||
long getFlgValido();
|
||||
|
||||
String getFlgTipo();
|
||||
|
||||
String getTipo();
|
||||
|
||||
long getFlgAzienda();
|
||||
|
||||
String getDescrizioneCompleta();
|
||||
|
||||
String getCognomeNome();
|
||||
|
||||
String getContatto();
|
||||
|
||||
String getNome();
|
||||
|
||||
String getIndirizzo();
|
||||
|
||||
String getIndirizzoCompleto();
|
||||
|
||||
String getIndirizzoCompletoHtml();
|
||||
|
||||
String getNumeroCivico();
|
||||
|
||||
long getId_comune();
|
||||
|
||||
String getId_nazione();
|
||||
|
||||
Date getDataNascita();
|
||||
|
||||
String getCodFisc();
|
||||
|
||||
String getPIva();
|
||||
|
||||
String getEMail();
|
||||
|
||||
String getFax();
|
||||
|
||||
String getTelefono();
|
||||
|
||||
String getNota();
|
||||
|
||||
String getImgTmst();
|
||||
|
||||
long getFlgPrivComunicazione();
|
||||
|
||||
long getFlgPrivSensibili();
|
||||
|
||||
long getFlgPrivTrattamento();
|
||||
|
||||
long getFlgSesso();
|
||||
|
||||
String getWww();
|
||||
|
||||
Date getDataRegistrazioneDI();
|
||||
|
||||
String getDichiarazioneIntento();
|
||||
|
||||
long getFlgArt8();
|
||||
|
||||
void setTipoPagamento(TipoPagamento paramTipoPagamento);
|
||||
|
||||
TipoPagamento getTipoPagamento();
|
||||
|
||||
void setComune(Comune paramComune);
|
||||
|
||||
Comune getComune();
|
||||
|
||||
void setNazione(Nazione paramNazione);
|
||||
|
||||
Nazione getNazione();
|
||||
|
||||
void findByCF(String paramString1, String paramString2);
|
||||
|
||||
void findByPIva(String paramString1, String paramString2);
|
||||
|
||||
String getCodFiscCalc();
|
||||
|
||||
boolean isCodFiscDuplicated();
|
||||
|
||||
boolean isPIvaDuplicated();
|
||||
|
||||
boolean isPIvaCodfiscDuplicated();
|
||||
|
||||
boolean isCodFiscOk();
|
||||
|
||||
long getId_comuneNascita();
|
||||
|
||||
void setId_comuneNascita(long paramLong);
|
||||
|
||||
Comune getComuneNascita();
|
||||
|
||||
void setComuneNascita(Comune paramComune);
|
||||
|
||||
String getSesso();
|
||||
|
||||
Vectumerator findUsers(int paramInt1, int paramInt2);
|
||||
|
||||
String getCognome();
|
||||
|
||||
String getIban();
|
||||
|
||||
void setIban(String paramString);
|
||||
|
||||
String getAbi();
|
||||
|
||||
String getCab();
|
||||
|
||||
String getConto();
|
||||
|
||||
String getCapZona();
|
||||
|
||||
void setCapZona(String paramString);
|
||||
|
||||
Vectumerator getDestinazioniDiverse();
|
||||
|
||||
ResParm addDestinazioneDiversa(DestinazioneDiversa paramDestinazioneDiversa);
|
||||
|
||||
ResParm delDestinazioneDiversa(DestinazioneDiversa paramDestinazioneDiversa);
|
||||
|
||||
String getCellulare();
|
||||
|
||||
void setCellulare(String paramString);
|
||||
|
||||
String getBancaDesc();
|
||||
|
||||
void setBancaDesc(String paramString);
|
||||
|
||||
String getBancaCompleto();
|
||||
|
||||
long getId_listino();
|
||||
|
||||
void setId_listino(long paramLong);
|
||||
|
||||
Listino getListino();
|
||||
|
||||
void setListino(Listino paramListino);
|
||||
|
||||
long getCloseCommand();
|
||||
|
||||
void setCloseCommand(long paramLong);
|
||||
|
||||
Clifor getCliforDup();
|
||||
|
||||
void setId_cliforDup(long paramLong);
|
||||
|
||||
long getId_cliforDup();
|
||||
|
||||
void setCliforDup(Clifor paramClifor);
|
||||
|
||||
Vectumerator getContratti();
|
||||
|
||||
ResParm addContratto(Contratto paramContratto);
|
||||
|
||||
ResParm delContratto(Contratto paramContratto);
|
||||
|
||||
ResParm creaMailingListCR(CliforCR paramCliforCR);
|
||||
|
||||
void resetMailingListFileCR();
|
||||
|
||||
boolean addToMailingListFileCR();
|
||||
|
||||
String getMailingMailCR();
|
||||
|
||||
long getFlgMl();
|
||||
|
||||
void setFlgMl(long paramLong);
|
||||
|
||||
Vectumerator findByCR(CliforCR paramCliforCR, int paramInt1, int paramInt2);
|
||||
|
||||
String getDescrizioneComune();
|
||||
|
||||
void setDescrizioneComune(String paramString);
|
||||
|
||||
String getProvinciaComune();
|
||||
|
||||
void setProvinciaComune(String paramString);
|
||||
|
||||
String getCapComune();
|
||||
|
||||
void setCapComune(String paramString);
|
||||
|
||||
String getPathAllegato();
|
||||
|
||||
Vectumerator getAllegati(long paramLong);
|
||||
|
||||
ResParm addAllegato(AllegatoClifor paramAllegatoClifor);
|
||||
|
||||
ResParm delAllegato(AllegatoClifor paramAllegatoClifor);
|
||||
|
||||
void creaCodaMessaggi(CliforCR paramCliforCR, long paramLong);
|
||||
|
||||
long getFlgRC();
|
||||
|
||||
void setFlgRC(long paramLong);
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CliforLog extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1698338319657L;
|
||||
|
||||
private long id_cliforLog;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private Date dataCliforlog;
|
||||
|
||||
private String descrizioneCliforlog;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private Users users;
|
||||
|
||||
public CliforLog(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforLog() {}
|
||||
|
||||
public void setId_cliforLog(long newId_cliforLog) {
|
||||
this.id_cliforLog = newId_cliforLog;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_users(long newId_users) {
|
||||
this.id_users = newId_users;
|
||||
setUsers(null);
|
||||
}
|
||||
|
||||
public void setDataCliforlog(Date newDataCliforlog) {
|
||||
this.dataCliforlog = newDataCliforlog;
|
||||
}
|
||||
|
||||
public void setDescrizioneCliforlog(String newDescrizioneCliforlog) {
|
||||
this.descrizioneCliforlog = newDescrizioneCliforlog;
|
||||
}
|
||||
|
||||
public long getId_cliforLog() {
|
||||
return this.id_cliforLog;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
public Date getDataCliforlog() {
|
||||
return this.dataCliforlog;
|
||||
}
|
||||
|
||||
public String getDescrizioneCliforlog() {
|
||||
return (this.descrizioneCliforlog == null) ? "" : this.descrizioneCliforlog.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setUsers(Users newUsers) {
|
||||
this.users = newUsers;
|
||||
}
|
||||
|
||||
public Users getUsers() {
|
||||
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class, getId_users());
|
||||
return this.users;
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<CliforLog> findByCR(CliforLogCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_LOG AS A";
|
||||
String s_Sql_Order = " order by A.lastUpdTmst desc";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<CliforLog> findByClifor(long l_id_clifor, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_LOG AS A";
|
||||
String s_Sql_Order = " order by A.lastUpdTmst desc";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getDBState() == 0)
|
||||
setDataCliforlog(getToday());
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public ResParm save(long l_flgStatoConfermaDatiDb) {
|
||||
setDescrizioneCliforlog(Clifor.getStatoConfermaDati(l_flgStatoConfermaDatiDb) + "-->" + Clifor.getStatoConfermaDati(l_flgStatoConfermaDatiDb) + ": " + getClifor().getStatoConfermaDati());
|
||||
return save();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class CliforLogCR extends CRAdapter {
|
||||
private long id_cliforLog;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private Timestamp tsCliforlog;
|
||||
|
||||
private Date dataCliforlog;
|
||||
|
||||
private String descrizioneCliforlog;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private Users users;
|
||||
|
||||
public CliforLogCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforLogCR() {}
|
||||
|
||||
public void setId_cliforLog(long newId_cliforLog) {
|
||||
this.id_cliforLog = newId_cliforLog;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_users(long newId_users) {
|
||||
this.id_users = newId_users;
|
||||
setUsers(null);
|
||||
}
|
||||
|
||||
public void setTsCliforlog(Timestamp newTsCliforlog) {
|
||||
this.tsCliforlog = newTsCliforlog;
|
||||
}
|
||||
|
||||
public void setDataCliforlog(Date newDataCliforlog) {
|
||||
this.dataCliforlog = newDataCliforlog;
|
||||
}
|
||||
|
||||
public void setDescrizioneCliforlog(String newDescrizioneCliforlog) {
|
||||
this.descrizioneCliforlog = newDescrizioneCliforlog;
|
||||
}
|
||||
|
||||
public long getId_cliforLog() {
|
||||
return this.id_cliforLog;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
public Timestamp getTsCliforlog() {
|
||||
return this.tsCliforlog;
|
||||
}
|
||||
|
||||
public Date getDataCliforlog() {
|
||||
return this.dataCliforlog;
|
||||
}
|
||||
|
||||
public String getDescrizioneCliforlog() {
|
||||
return (this.descrizioneCliforlog == null) ? "" : this.descrizioneCliforlog.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setUsers(Users newUsers) {
|
||||
this.users = newUsers;
|
||||
}
|
||||
|
||||
public Users getUsers() {
|
||||
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class,
|
||||
|
||||
getId_users());
|
||||
return this.users;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CliforTipoClifor extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = -2647000200627619105L;
|
||||
|
||||
private long id_cliforTipoClifor;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoClifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoClifor tipoClifor;
|
||||
|
||||
private double percProvvigione;
|
||||
|
||||
public CliforTipoClifor(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public boolean isTipologiaCliforByClifor(long l_id_clifor, long l_id_tipoClifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A ";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
if (l_id_tipoClifor != 0L)
|
||||
wc.addWc("A.id_tipoClifor=" + l_id_tipoClifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public CliforTipoClifor() {}
|
||||
|
||||
public void setId_tipoClifor(long newId_tipoClifor) {
|
||||
this.id_tipoClifor = newId_tipoClifor;
|
||||
}
|
||||
|
||||
public long getId_tipoClifor() {
|
||||
return this.id_tipoClifor;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(CliforTipoCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A INNER JOIN TIPO_CLIFOR AS B ON A.id_tipoClifor = B.id_tipoClifor ";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
if (CR.getId_clifor() != 0L)
|
||||
wc.addWc("A.id_clifor=" + CR.getId_clifor());
|
||||
if (!CR.getFlgTipoClifor().isEmpty())
|
||||
wc.addWc("B.flgTipo='" + CR.getFlgTipoClifor() + "' ");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getId_cliforTipoClifor() {
|
||||
return this.id_cliforTipoClifor;
|
||||
}
|
||||
|
||||
public void setId_cliforTipoClifor(long id_cliforTipoClifor) {
|
||||
this.id_cliforTipoClifor = id_cliforTipoClifor;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long id_clifor) {
|
||||
this.id_clifor = id_clifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor clifor) {
|
||||
this.clifor = clifor;
|
||||
}
|
||||
|
||||
public TipoClifor getTipoClifor() {
|
||||
this.tipoClifor = (TipoClifor)getSecondaryObject(this.tipoClifor, TipoClifor.class, getId_tipoClifor());
|
||||
return this.tipoClifor;
|
||||
}
|
||||
|
||||
public void setTipoClifor(TipoClifor tipoClifor) {
|
||||
this.tipoClifor = tipoClifor;
|
||||
}
|
||||
|
||||
public boolean isRespondabileCommercialeByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("( B.flgTipologia=3)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public double getPercProvvigione() {
|
||||
return this.percProvvigione;
|
||||
}
|
||||
|
||||
public void setPercProvvigione(double percProvvigione) {
|
||||
this.percProvvigione = percProvvigione;
|
||||
}
|
||||
|
||||
public void findByCliforTipologia(long l_id_clifor, long l_flgTipologiaClifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
if (l_flgTipologiaClifor == 0L) {
|
||||
wc.addWc("(B.flgTipologia is null or B.flgTipologia=0)");
|
||||
} else if (l_flgTipologiaClifor > 0L) {
|
||||
wc.addWc("B.flgTipologia=" + l_flgTipologiaClifor);
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAgenteByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("(B.flgTipologia=1)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isProgettistaByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("(B.flgTipologia=2)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAgenteORespondabileCommercialeByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||
String s_Sql_Order = " ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("(B.flgTipologia=1 or B.flgTipologia=3)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CliforTipoCliforCR extends CRAdapter implements Serializable {
|
||||
private long id_cliforTipoClifor;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoClifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoClifor tipoClifor;
|
||||
|
||||
private String flgTipoClifor;
|
||||
|
||||
public CliforTipoCliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforTipoCliforCR() {}
|
||||
|
||||
public void setId_tipoClifor(long newId_causaleMagazzino) {
|
||||
this.id_tipoClifor = newId_causaleMagazzino;
|
||||
}
|
||||
|
||||
public long getId_tipoClifor() {
|
||||
return this.id_tipoClifor;
|
||||
}
|
||||
|
||||
public long getId_cliforTipoClifor() {
|
||||
return this.id_cliforTipoClifor;
|
||||
}
|
||||
|
||||
public void setId_cliforTipoClifor(long id_cliforTipoClifor) {
|
||||
this.id_cliforTipoClifor = id_cliforTipoClifor;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long id_clifor) {
|
||||
this.id_clifor = id_clifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor clifor) {
|
||||
this.clifor = clifor;
|
||||
}
|
||||
|
||||
public TipoClifor getTipoClifor() {
|
||||
this.tipoClifor = (TipoClifor)getSecondaryObject(this.tipoClifor, TipoClifor.class,
|
||||
getId_tipoClifor());
|
||||
return this.tipoClifor;
|
||||
}
|
||||
|
||||
public void setTipoClifor(TipoClifor tipoClifor) {
|
||||
this.tipoClifor = tipoClifor;
|
||||
}
|
||||
|
||||
public String getFlgTipoClifor() {
|
||||
return this.flgTipoClifor;
|
||||
}
|
||||
|
||||
public void setFlgTipoClifor(String flgTipoClifor) {
|
||||
this.flgTipoClifor = flgTipoClifor;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CliforTipoPagamento extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1647264568430L;
|
||||
|
||||
private long id_cliforTipoPagamento;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoPagamento tipoPagamento;
|
||||
|
||||
public CliforTipoPagamento(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforTipoPagamento() {}
|
||||
|
||||
public void setId_cliforTipoPagamento(long newId_cliforTipoPagamento) {
|
||||
this.id_cliforTipoPagamento = newId_cliforTipoPagamento;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||
this.id_tipoPagamento = newId_tipoPagamento;
|
||||
setTipoPagamento(null);
|
||||
}
|
||||
|
||||
public long getId_cliforTipoPagamento() {
|
||||
return this.id_cliforTipoPagamento;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setTipoPagamento(TipoPagamento newTipoPagamento) {
|
||||
this.tipoPagamento = newTipoPagamento;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamento() {
|
||||
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class,
|
||||
|
||||
getId_tipoPagamento());
|
||||
return this.tipoPagamento;
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<CliforTipoPagamento> findByCR(CliforTipoPagamentoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_PAGAMENTO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<CliforTipoPagamento> findByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CLIFOR_TIPO_PAGAMENTO AS A inner join TIPO_PAGAMENTO AS B on A.id_tipoPagamento=B.id_tipoPagamento";
|
||||
String s_Sql_Order = " order by descrizione_it";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
return super.save();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class CliforTipoPagamentoCR extends CRAdapter {
|
||||
private long id_cliforTipoPagamento;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private TipoPagamento tipoPagamento;
|
||||
|
||||
public CliforTipoPagamentoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforTipoPagamentoCR() {}
|
||||
|
||||
public void setId_cliforTipoPagamento(long newId_cliforTipoPagamento) {
|
||||
this.id_cliforTipoPagamento = newId_cliforTipoPagamento;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||
this.id_tipoPagamento = newId_tipoPagamento;
|
||||
setTipoPagamento(null);
|
||||
}
|
||||
|
||||
public long getId_cliforTipoPagamento() {
|
||||
return this.id_cliforTipoPagamento;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setTipoPagamento(TipoPagamento newTipoPagamento) {
|
||||
this.tipoPagamento = newTipoPagamento;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamento() {
|
||||
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class,
|
||||
|
||||
getId_tipoPagamento());
|
||||
return this.tipoPagamento;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import it.acxent.anag.json.JsonComune;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Vector;
|
||||
|
||||
public class Comune extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = -8455737960994074428L;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private String id_regione;
|
||||
|
||||
private String codice;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String provincia;
|
||||
|
||||
private String cap;
|
||||
|
||||
private String codiceComune;
|
||||
|
||||
private String codiceZona;
|
||||
|
||||
private Regione regione;
|
||||
|
||||
private long id_zona;
|
||||
|
||||
private Zona zona;
|
||||
|
||||
private String codiceTarga;
|
||||
|
||||
public Comune(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Comune() {}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
}
|
||||
|
||||
public void setId_regione(String newId_regione) {
|
||||
this.id_regione = newId_regione;
|
||||
setRegione(null);
|
||||
}
|
||||
|
||||
public void setCodice(String newCodice) {
|
||||
this.codice = newCodice;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setProvincia(String newProvincia) {
|
||||
this.provincia = newProvincia;
|
||||
}
|
||||
|
||||
public void setCap(String newCap) {
|
||||
this.cap = newCap;
|
||||
}
|
||||
|
||||
public void setCodiceComune(String newCodiceComune) {
|
||||
this.codiceComune = newCodiceComune;
|
||||
}
|
||||
|
||||
public void setCodiceZona(String newCodiceZona) {
|
||||
this.codiceZona = newCodiceZona;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getId_regione() {
|
||||
return (this.id_regione == null) ? "" : this.id_regione.trim();
|
||||
}
|
||||
|
||||
public String getCodice() {
|
||||
return (this.codice == null) ? "" : this.codice.trim();
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getProvincia() {
|
||||
return (this.provincia == null) ? "" : this.provincia.trim();
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return (this.cap == null) ? "" : this.cap.trim();
|
||||
}
|
||||
|
||||
public String getCodiceComune() {
|
||||
return (this.codiceComune == null) ? "" : this.codiceComune.trim();
|
||||
}
|
||||
|
||||
public String getCodiceZona() {
|
||||
return (this.codiceZona == null) ? "" : this.codiceZona.trim();
|
||||
}
|
||||
|
||||
public void setRegione(Regione newRegione) {
|
||||
this.regione = newRegione;
|
||||
}
|
||||
|
||||
public Regione getRegione() {
|
||||
this.regione = (Regione)getSecondaryObject(this.regione, Regione.class, getId_regione());
|
||||
return this.regione;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(ComuneCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
if (CR.getFlgOrderBy() == 1L)
|
||||
s_Sql_Order = " order by A.lastUpdTmst";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty())
|
||||
wc.addWc("(A.descrizione like '%" + prepareSqlString(CR.getSearchTxt()) + "%' or A.codice like '%" +
|
||||
prepareSqlString(CR.getSearchTxt()) + "%')");
|
||||
if (!CR.getDescrizioneS().trim().isEmpty())
|
||||
wc.addWc("(A.descrizione like '%" + CR.getDescrizioneS() + "%' or A.codice like '%" + CR.getDescrizioneS() + "%')");
|
||||
if (!CR.getId_regioneS().isEmpty())
|
||||
wc.addWc("A.id_regione='" + CR.getId_regioneS() + "'");
|
||||
if (CR.getLastUpdTmst() != null)
|
||||
wc.addWc("A.lastUpdTmst>?");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
if (CR.getLastUpdTmst() != null)
|
||||
stmt.setTimestamp(1, CR.getLastUpdTmst());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
return getCodice() + " " + getCodice();
|
||||
}
|
||||
|
||||
public Vectumerator findByProv(String l_provincia) {
|
||||
String s_Sql_Find = "select A.descrizione from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.provincia='" + l_provincia + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Comune> findByProvCom(String l_provincia, String l_comuneDesc) {
|
||||
String s_Sql_Find = "select A.* from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.provincia='" + l_provincia + "'");
|
||||
wc.addWc("A.descrizione='" + l_comuneDesc + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByCap(String l_cap) {
|
||||
String s_Sql_Find = "select A.* from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.cap='" + l_cap + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findByCodice(String l_codice) {
|
||||
String s_Sql_Find = "select A.* from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.codice='" + l_codice + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findProvince() {
|
||||
String s_Sql_Find = "select A.provincia from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getId_zona() {
|
||||
return this.id_zona;
|
||||
}
|
||||
|
||||
public void setId_zona(long id_zona) {
|
||||
this.id_zona = id_zona;
|
||||
setZona(null);
|
||||
}
|
||||
|
||||
public Zona getZona() {
|
||||
return this.zona;
|
||||
}
|
||||
|
||||
public void setZona(Zona zona) {
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
public String getJson(long l_tmst, int nPage) {
|
||||
int pageRow = 40;
|
||||
Comune bean = new Comune(getApFull());
|
||||
ComuneCR CR = new ComuneCR(getApFull());
|
||||
Vector<JsonComune> vecJ = new Vector<>();
|
||||
if (l_tmst > 0L)
|
||||
CR.setLastUpdTmst(new Timestamp(l_tmst));
|
||||
CR.setFlgOrderBy(1L);
|
||||
Vectumerator<Comune> vec = bean.findByCR(CR, nPage, pageRow);
|
||||
while (vec.hasMoreElements()) {
|
||||
Comune row = (Comune)vec.nextElement();
|
||||
JsonComune jrow = new JsonComune();
|
||||
jrow.setId_comune(row.getId_comune());
|
||||
jrow.setDescrizione(row.getDescrizione());
|
||||
jrow.setLastUpdTmst(row.getLastUpdTmst().getTime());
|
||||
vecJ.add(jrow);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String res = gson.toJson(vecJ);
|
||||
return res;
|
||||
}
|
||||
|
||||
public String getCodiceTarga() {
|
||||
return (this.codiceTarga == null) ? "" : this.codiceTarga.trim();
|
||||
}
|
||||
|
||||
public void setCodiceTarga(String codiceTarga) {
|
||||
this.codiceTarga = codiceTarga;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class ComuneCR extends CRAdapter {
|
||||
private long id_comune;
|
||||
|
||||
private String id_regioneS;
|
||||
|
||||
private String codice;
|
||||
|
||||
private String descrizioneS;
|
||||
|
||||
private String provincia;
|
||||
|
||||
private String cap;
|
||||
|
||||
private String codiceComune;
|
||||
|
||||
private String codiceZona;
|
||||
|
||||
private long lastUpdId_user;
|
||||
|
||||
private Timestamp lastUpdTmst;
|
||||
|
||||
private Regione regione;
|
||||
|
||||
public ComuneCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ComuneCR() {}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
}
|
||||
|
||||
public void setId_regioneS(String newId_regione) {
|
||||
this.id_regioneS = newId_regione;
|
||||
setRegione(null);
|
||||
}
|
||||
|
||||
public void setCodice(String newCodice) {
|
||||
this.codice = newCodice;
|
||||
}
|
||||
|
||||
public void setDescrizioneS(String newDescrizione) {
|
||||
this.descrizioneS = newDescrizione;
|
||||
}
|
||||
|
||||
public void setProvincia(String newProvincia) {
|
||||
this.provincia = newProvincia;
|
||||
}
|
||||
|
||||
public void setCap(String newCap) {
|
||||
this.cap = newCap;
|
||||
}
|
||||
|
||||
public void setCodiceComune(String newCodiceComune) {
|
||||
this.codiceComune = newCodiceComune;
|
||||
}
|
||||
|
||||
public void setCodiceZona(String newCodiceZona) {
|
||||
this.codiceZona = newCodiceZona;
|
||||
}
|
||||
|
||||
public void setLastUpdId_user(long newLastUpdId_user) {
|
||||
this.lastUpdId_user = newLastUpdId_user;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
|
||||
this.lastUpdTmst = newLastUpdTmst;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getId_regioneS() {
|
||||
return (this.id_regioneS == null) ? "" : this.id_regioneS.trim();
|
||||
}
|
||||
|
||||
public String getCodice() {
|
||||
return (this.codice == null) ? "" : this.codice.trim();
|
||||
}
|
||||
|
||||
public String getDescrizioneS() {
|
||||
return (this.descrizioneS == null) ? "" : this.descrizioneS.trim();
|
||||
}
|
||||
|
||||
public String getProvincia() {
|
||||
return (this.provincia == null) ? "" : this.provincia.trim();
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return (this.cap == null) ? "" : this.cap.trim();
|
||||
}
|
||||
|
||||
public String getCodiceComune() {
|
||||
return (this.codiceComune == null) ? "" : this.codiceComune.trim();
|
||||
}
|
||||
|
||||
public String getCodiceZona() {
|
||||
return (this.codiceZona == null) ? "" : this.codiceZona.trim();
|
||||
}
|
||||
|
||||
public long getLastUpdId_user() {
|
||||
return this.lastUpdId_user;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
|
||||
public void setRegione(Regione newRegione) {
|
||||
this.regione = newRegione;
|
||||
}
|
||||
|
||||
public Regione getRegione() {
|
||||
this.regione = (Regione)getSecondaryObject(this.regione, Regione.class,
|
||||
|
||||
getId_regioneS());
|
||||
return this.regione;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Contatore extends _AnagAdapter implements Serializable {
|
||||
public static final int TIPO_ANNUALE = 1;
|
||||
|
||||
private long id_contatore;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private long flgControllo;
|
||||
|
||||
private long annoIniziale;
|
||||
|
||||
private long progIniziale;
|
||||
|
||||
public static final int TIPO_MAGAZZINO = 3;
|
||||
|
||||
public static final int TIPO_CONTABILE = 2;
|
||||
|
||||
public Contatore(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Contatore() {}
|
||||
|
||||
public void setId_contatore(long newId_contatore) {
|
||||
this.id_contatore = newId_contatore;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setFlgTipo(long newFlgTipo) {
|
||||
this.flgTipo = newFlgTipo;
|
||||
}
|
||||
|
||||
public void setFlgControllo(long newFlgControllo) {
|
||||
this.flgControllo = newFlgControllo;
|
||||
}
|
||||
|
||||
public long getId_contatore() {
|
||||
return this.id_contatore;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
public long getFlgControllo() {
|
||||
return this.flgControllo;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(ContatoreCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CONTATORE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTipo(long l_flgTipo) {
|
||||
switch ((int)l_flgTipo) {
|
||||
case 1:
|
||||
return "Annuale";
|
||||
case 2:
|
||||
return "Contabile";
|
||||
case 3:
|
||||
return "Magazzino";
|
||||
}
|
||||
return "????";
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return getTipo(getFlgTipo());
|
||||
}
|
||||
|
||||
public String getControllo() {
|
||||
return (getFlgControllo() == 0L) ? "No" : "Si";
|
||||
}
|
||||
|
||||
public long getAnnoIniziale() {
|
||||
if (getFlgControllo() == 0L)
|
||||
return 0L;
|
||||
return this.annoIniziale;
|
||||
}
|
||||
|
||||
public void setAnnoIniziale(long annoIniziale) {
|
||||
this.annoIniziale = annoIniziale;
|
||||
}
|
||||
|
||||
public long getProgIniziale() {
|
||||
if (getFlgControllo() == 0L)
|
||||
return 0L;
|
||||
return this.progIniziale;
|
||||
}
|
||||
|
||||
public void setProgIniziale(long progIniziale) {
|
||||
this.progIniziale = progIniziale;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class ContatoreCR extends CRAdapter {
|
||||
private long id_contatore;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private long flgControllo;
|
||||
|
||||
private Timestamp lastUpdTmst;
|
||||
|
||||
private long lastUpdId_user;
|
||||
|
||||
public ContatoreCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ContatoreCR() {}
|
||||
|
||||
public void setId_contatore(long newId_contatore) {
|
||||
this.id_contatore = newId_contatore;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setFlgTipo(long newFlgTipo) {
|
||||
this.flgTipo = newFlgTipo;
|
||||
}
|
||||
|
||||
public void setFlgControllo(long newFlgControllo) {
|
||||
this.flgControllo = newFlgControllo;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
|
||||
this.lastUpdTmst = newLastUpdTmst;
|
||||
}
|
||||
|
||||
public void setLastUpdId_user(long newLastUpdId_user) {
|
||||
this.lastUpdId_user = newLastUpdId_user;
|
||||
}
|
||||
|
||||
public long getId_contatore() {
|
||||
return this.id_contatore;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
public long getFlgControllo() {
|
||||
return this.flgControllo;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
|
||||
public long getLastUpdId_user() {
|
||||
return this.lastUpdId_user;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Contatto extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1489591448348L;
|
||||
|
||||
private long id_contatto;
|
||||
|
||||
private String descrizioneC;
|
||||
|
||||
private String nomeC;
|
||||
|
||||
private String telefonoC;
|
||||
|
||||
private String emailC;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private long flgContattoDefault;
|
||||
|
||||
public Contatto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Contatto() {}
|
||||
|
||||
public void setId_contatto(long newId_contatto) {
|
||||
this.id_contatto = newId_contatto;
|
||||
}
|
||||
|
||||
public void setDescrizioneC(String newDescrizione) {
|
||||
this.descrizioneC = newDescrizione;
|
||||
}
|
||||
|
||||
public void setNomeC(String newNome) {
|
||||
this.nomeC = newNome;
|
||||
}
|
||||
|
||||
public void setTelefonoC(String newTelefono) {
|
||||
this.telefonoC = newTelefono;
|
||||
}
|
||||
|
||||
public void setEmailC(String newEmail) {
|
||||
this.emailC = newEmail;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public long getId_contatto() {
|
||||
return this.id_contatto;
|
||||
}
|
||||
|
||||
public String getDescrizioneC() {
|
||||
return (this.descrizioneC == null) ? "" : this.descrizioneC.trim();
|
||||
}
|
||||
|
||||
public String getNomeC() {
|
||||
return (this.nomeC == null) ? "" : this.nomeC.trim();
|
||||
}
|
||||
|
||||
public String getTelefonoC() {
|
||||
return (this.telefonoC == null) ? "" : this.telefonoC.trim();
|
||||
}
|
||||
|
||||
public String getEmailC() {
|
||||
return (this.emailC == null) ? "" : this.emailC.trim();
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Contatto> findByCR(ContattoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CONTATTO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getFlgContattoDefault() {
|
||||
return this.flgContattoDefault;
|
||||
}
|
||||
|
||||
public void setFlgContattoDefault(long flgContattoDefault) {
|
||||
this.flgContattoDefault = flgContattoDefault;
|
||||
}
|
||||
|
||||
public Vectumerator<Contatto> findByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from CONTATTO AS A";
|
||||
String s_Sql_Order = " order by A.descrizioneC\t";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getFlgContattoDefault() == 1L)
|
||||
update("update CONTATTO SET flgContattoDefault=0 where id_clifor=" + getId_clifor());
|
||||
return super.save();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class ContattoCR extends CRAdapter {
|
||||
private long id_contatto;
|
||||
|
||||
private String descrizioneC;
|
||||
|
||||
private String nomeC;
|
||||
|
||||
private String telefonoC;
|
||||
|
||||
private String emailC;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private long flgContattoDefault;
|
||||
|
||||
public ContattoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ContattoCR() {}
|
||||
|
||||
public void setId_contatto(long newId_contatto) {
|
||||
this.id_contatto = newId_contatto;
|
||||
}
|
||||
|
||||
public void setDescrizioneC(String newDescrizione) {
|
||||
this.descrizioneC = newDescrizione;
|
||||
}
|
||||
|
||||
public void setNomeC(String newNome) {
|
||||
this.nomeC = newNome;
|
||||
}
|
||||
|
||||
public void setTelefonoC(String newTelefono) {
|
||||
this.telefonoC = newTelefono;
|
||||
}
|
||||
|
||||
public void setEmailC(String newEmail) {
|
||||
this.emailC = newEmail;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public long getId_contatto() {
|
||||
return this.id_contatto;
|
||||
}
|
||||
|
||||
public String getDescrizioneC() {
|
||||
return (this.descrizioneC == null) ? "" : this.descrizioneC.trim();
|
||||
}
|
||||
|
||||
public String getNomeC() {
|
||||
return (this.nomeC == null) ? "" : this.nomeC.trim();
|
||||
}
|
||||
|
||||
public String getTelefonoC() {
|
||||
return (this.telefonoC == null) ? "" : this.telefonoC.trim();
|
||||
}
|
||||
|
||||
public String getEmailC() {
|
||||
return (this.emailC == null) ? "" : this.emailC.trim();
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public long getFlgContattoDefault() {
|
||||
return this.flgContattoDefault;
|
||||
}
|
||||
|
||||
public void setFlgContattoDefault(long flgContattoDefault) {
|
||||
this.flgContattoDefault = flgContattoDefault;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.mail.MailMessage;
|
||||
import it.acxent.newsletter.CodaMessaggi;
|
||||
import it.acxent.newsletter.TemplateMsg;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class Contratto extends _AnagAdapter implements Serializable {
|
||||
private long id_contratto;
|
||||
|
||||
private long id_tipoContratto;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private String telefoniAssociati;
|
||||
|
||||
private Date dataInizioContratto;
|
||||
|
||||
private Date dataInvioAvvisoSms;
|
||||
|
||||
private long flgStato;
|
||||
|
||||
private TipoContratto tipoContratto;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String logContratto;
|
||||
|
||||
private String notaContratto;
|
||||
|
||||
private Date dataScadenzaContratto;
|
||||
|
||||
public static final long ST_ATTIVO = 1L;
|
||||
|
||||
public static final long ST_NON_ATTIVO = 0L;
|
||||
|
||||
public Contratto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Contratto() {}
|
||||
|
||||
public void setId_contratto(long newId_contratto) {
|
||||
this.id_contratto = newId_contratto;
|
||||
}
|
||||
|
||||
public void setId_tipoContratto(long newId_tipoContratto) {
|
||||
this.id_tipoContratto = newId_tipoContratto;
|
||||
setTipoContratto(null);
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setDataInizioContratto(Date newDataInizioContratto) {
|
||||
this.dataInizioContratto = newDataInizioContratto;
|
||||
}
|
||||
|
||||
public void setDataScadenzaContratto(Date newDataScadenzaContratto) {
|
||||
this.dataScadenzaContratto = newDataScadenzaContratto;
|
||||
}
|
||||
|
||||
public void setFlgStato(long newFlgStato) {
|
||||
this.flgStato = newFlgStato;
|
||||
}
|
||||
|
||||
public long getId_contratto() {
|
||||
return this.id_contratto;
|
||||
}
|
||||
|
||||
public long getId_tipoContratto() {
|
||||
return this.id_tipoContratto;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
public Date getDataInizioContratto() {
|
||||
return this.dataInizioContratto;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaContratto() {
|
||||
return this.dataScadenzaContratto;
|
||||
}
|
||||
|
||||
public long getFlgStato() {
|
||||
return this.flgStato;
|
||||
}
|
||||
|
||||
public void setTipoContratto(TipoContratto newTipoContratto) {
|
||||
this.tipoContratto = newTipoContratto;
|
||||
}
|
||||
|
||||
public TipoContratto getTipoContratto() {
|
||||
this.tipoContratto = (TipoContratto)getSecondaryObject(this.tipoContratto, TipoContratto.class,
|
||||
getId_tipoContratto());
|
||||
return this.tipoContratto;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public ResParm creaCodaMessaggiSms(ContrattoCR CR) {
|
||||
ResParm rp = new ResParm();
|
||||
Vectumerator vec = findByCR(CR, 0, 0);
|
||||
int numMsg = 0;
|
||||
while (vec.hasMoreElements()) {
|
||||
TemplateMsg tm = new TemplateMsg(getApFull());
|
||||
tm.findByPrimaryKey(CR.getId_templateMsg());
|
||||
Contratto row = (Contratto)vec.nextElement();
|
||||
rp = row.creaCodaMessaggio();
|
||||
if (rp.getStatus())
|
||||
numMsg++;
|
||||
}
|
||||
rp.setMsg("Numero messaggi in coda: " + numMsg);
|
||||
return rp;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(ContrattoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CONTRATTO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTelefoniAssociati() {
|
||||
return (this.telefoniAssociati == null) ? "" :
|
||||
this.telefoniAssociati.trim();
|
||||
}
|
||||
|
||||
public void setTelefoniAssociati(String telefoniAssociati) {
|
||||
this.telefoniAssociati = telefoniAssociati;
|
||||
}
|
||||
|
||||
public Vectumerator findByClifor(long l_id_clifor, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from CONTRATTO AS A";
|
||||
String s_Sql_Order = " order by A.flgStato desc, A.dataScadenzaContratto desc";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static final String getStato(long l_flgStato) {
|
||||
if (l_flgStato == 1L)
|
||||
return "Attivo";
|
||||
if (l_flgStato == 0L)
|
||||
return "Non Attivo";
|
||||
return "??";
|
||||
}
|
||||
|
||||
public String getStato() {
|
||||
return getStato(getFlgStato());
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public String getLogContratto() {
|
||||
return (this.logContratto == null) ? "" : this.logContratto;
|
||||
}
|
||||
|
||||
public void setLogContratto(String logContratto) {
|
||||
this.logContratto = logContratto;
|
||||
}
|
||||
|
||||
public String getNotaContratto() {
|
||||
return (this.notaContratto == null) ? "" : this.notaContratto;
|
||||
}
|
||||
|
||||
public void setNotaContratto(String notaContratto) {
|
||||
this.notaContratto = notaContratto;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getDataScadenzaContratto() == null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(getDataInizioContratto());
|
||||
int durata = (int)getTipoContratto().getDurataMesi();
|
||||
if (getTipoContratto().getFlgPrepagato() == 1L) {
|
||||
cal.add(6, durata * 30);
|
||||
} else {
|
||||
cal.add(2, durata);
|
||||
cal.add(6, -1);
|
||||
}
|
||||
setDataScadenzaContratto(new Date(cal.getTimeInMillis()));
|
||||
}
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public Date getDataInvioAvvisoSms() {
|
||||
return this.dataInvioAvvisoSms;
|
||||
}
|
||||
|
||||
public void setDataInvioAvvisoSms(Date dataInvioAvvisoSms) {
|
||||
this.dataInvioAvvisoSms = dataInvioAvvisoSms;
|
||||
}
|
||||
|
||||
public ResParm creaCodaMessaggio() {
|
||||
ResParm rp = new ResParm();
|
||||
if (getId_contratto() > 0L) {
|
||||
MailMessage mm = new MailMessage(getApFull());
|
||||
mm.setTextMessage(getTipoContratto().getMessaggioSms());
|
||||
mm.setString("cliente", getClifor().getDescrizioneCompleta());
|
||||
mm.setString("contratto", getTipoContratto().getDescrizione());
|
||||
mm.setDate("dataScadenza", getDataScadenzaContratto());
|
||||
CodaMessaggi cm = new CodaMessaggi(getApFull());
|
||||
cm.setDataCreazione(getToday());
|
||||
cm.setCellulare(getTelefoniAssociati());
|
||||
cm.setTestoMessaggio(mm.getMessage());
|
||||
cm.setFlgTipo(2L);
|
||||
cm.setFlgStatoInvio(0L);
|
||||
rp = cm.save();
|
||||
setDataInvioAvvisoSms(getToday());
|
||||
rp.append(save());
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class ContrattoCR extends CRAdapter {
|
||||
private long id_contratto;
|
||||
|
||||
private long id_tipoContratto;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private Date dataInizioContratto;
|
||||
|
||||
private Date dataScadenzaContratto;
|
||||
|
||||
private long flgStato;
|
||||
|
||||
private long lastUpdId_user;
|
||||
|
||||
private Timestamp lastUpdTmst;
|
||||
|
||||
private TipoContratto tipoContratto;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private Date dataScadenzaContrattoDa;
|
||||
|
||||
private Date dataScadenzaContrattoA;
|
||||
|
||||
private long id_templateMsg;
|
||||
|
||||
public ContrattoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ContrattoCR() {}
|
||||
|
||||
public void setId_contratto(long newId_contratto) {
|
||||
this.id_contratto = newId_contratto;
|
||||
}
|
||||
|
||||
public void setId_tipoContratto(long newId_tipoContratto) {
|
||||
this.id_tipoContratto = newId_tipoContratto;
|
||||
setTipoContratto(null);
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setDataInizioContratto(Date newDataInizioContratto) {
|
||||
this.dataInizioContratto = newDataInizioContratto;
|
||||
}
|
||||
|
||||
public void setDataScadenzaContratto(Date newDataScadenzaContratto) {
|
||||
this.dataScadenzaContratto = newDataScadenzaContratto;
|
||||
}
|
||||
|
||||
public void setFlgStato(long newFlgStato) {
|
||||
this.flgStato = newFlgStato;
|
||||
}
|
||||
|
||||
public void setLastUpdId_user(long newLastUpdId_user) {
|
||||
this.lastUpdId_user = newLastUpdId_user;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
|
||||
this.lastUpdTmst = newLastUpdTmst;
|
||||
}
|
||||
|
||||
public long getId_contratto() {
|
||||
return this.id_contratto;
|
||||
}
|
||||
|
||||
public long getId_tipoContratto() {
|
||||
return this.id_tipoContratto;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
public Date getDataInizioContratto() {
|
||||
return this.dataInizioContratto;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaContratto() {
|
||||
return this.dataScadenzaContratto;
|
||||
}
|
||||
|
||||
public long getFlgStato() {
|
||||
return this.flgStato;
|
||||
}
|
||||
|
||||
public long getLastUpdId_user() {
|
||||
return this.lastUpdId_user;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
|
||||
public void setTipoContratto(TipoContratto newTipoContratto) {
|
||||
this.tipoContratto = newTipoContratto;
|
||||
}
|
||||
|
||||
public TipoContratto getTipoContratto() {
|
||||
this.tipoContratto = (TipoContratto)getSecondaryObject(this.tipoContratto, TipoContratto.class,
|
||||
getId_tipoContratto());
|
||||
return this.tipoContratto;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaContrattoDa() {
|
||||
return this.dataScadenzaContrattoDa;
|
||||
}
|
||||
|
||||
public void setDataScadenzaContrattoDa(Date dataScadenzaContrattoDa) {
|
||||
this.dataScadenzaContrattoDa = dataScadenzaContrattoDa;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaContrattoA() {
|
||||
return this.dataScadenzaContrattoA;
|
||||
}
|
||||
|
||||
public void setDataScadenzaContrattoA(Date dataScadenzaContrattoA) {
|
||||
this.dataScadenzaContrattoA = dataScadenzaContrattoA;
|
||||
}
|
||||
|
||||
public static final String getStato(long l_flgStato) {
|
||||
return Contratto.getStato(l_flgStato);
|
||||
}
|
||||
|
||||
public String getStato() {
|
||||
return Contratto.getStato(getFlgStato());
|
||||
}
|
||||
|
||||
public long getId_templateMsg() {
|
||||
return this.id_templateMsg;
|
||||
}
|
||||
|
||||
public void setId_templateMsg(long id_templateMsg) {
|
||||
this.id_templateMsg = id_templateMsg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,296 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class DestinazioneDiversa extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 2321576096013980457L;
|
||||
|
||||
private long id_destinazioneDiversa;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_comuneDD;
|
||||
|
||||
private String id_nazioneDD;
|
||||
|
||||
private String descrizioneDD;
|
||||
|
||||
private String pressoDD;
|
||||
|
||||
private String indirizzoDD;
|
||||
|
||||
private String numeroCivicoDD;
|
||||
|
||||
private String capZonaDD;
|
||||
|
||||
private String telefonoDD;
|
||||
|
||||
private String faxDD;
|
||||
|
||||
private String eMailDD;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private Comune comuneDD;
|
||||
|
||||
private Nazione nazioneDD;
|
||||
|
||||
private String capComuneDD;
|
||||
|
||||
private String descrizioneComuneDD;
|
||||
|
||||
private String provinciaComuneDD;
|
||||
|
||||
private long flgDDDefault;
|
||||
|
||||
public DestinazioneDiversa(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public DestinazioneDiversa() {}
|
||||
|
||||
public void setId_destinazioneDiversa(long newId_destinazioneDiversa) {
|
||||
this.id_destinazioneDiversa = newId_destinazioneDiversa;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_comuneDD(long newId_comuneDD) {
|
||||
this.id_comuneDD = newId_comuneDD;
|
||||
setComuneDD(null);
|
||||
}
|
||||
|
||||
public void setId_nazioneDD(String newId_nazioneDD) {
|
||||
this.id_nazioneDD = newId_nazioneDD;
|
||||
setNazioneDD(null);
|
||||
}
|
||||
|
||||
public void setDescrizioneDD(String newDescrizione) {
|
||||
this.descrizioneDD = newDescrizione;
|
||||
}
|
||||
|
||||
public void setPressoDD(String newPresso) {
|
||||
this.pressoDD = newPresso;
|
||||
}
|
||||
|
||||
public void setIndirizzoDD(String newIndirizzoDD) {
|
||||
this.indirizzoDD = newIndirizzoDD;
|
||||
}
|
||||
|
||||
public void setNumeroCivicoDD(String newNumeroCivicoDD) {
|
||||
this.numeroCivicoDD = newNumeroCivicoDD;
|
||||
}
|
||||
|
||||
public void setCapZonaDD(String newCapZonaDD) {
|
||||
this.capZonaDD = newCapZonaDD;
|
||||
}
|
||||
|
||||
public void setTelefonoDD(String newTelefonoDD) {
|
||||
this.telefonoDD = newTelefonoDD;
|
||||
}
|
||||
|
||||
public void setFaxDD(String newFaxDD) {
|
||||
this.faxDD = newFaxDD;
|
||||
}
|
||||
|
||||
public void setEMailDD(String newEMailDD) {
|
||||
this.eMailDD = newEMailDD;
|
||||
}
|
||||
|
||||
public long getId_destinazioneDiversa() {
|
||||
return this.id_destinazioneDiversa;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_comuneDD() {
|
||||
return this.id_comuneDD;
|
||||
}
|
||||
|
||||
public String getId_nazioneDD() {
|
||||
return (this.id_nazioneDD == null) ? "" : this.id_nazioneDD.trim();
|
||||
}
|
||||
|
||||
public String getDescrizioneDD() {
|
||||
return (this.descrizioneDD == null) ? "" : this.descrizioneDD.trim();
|
||||
}
|
||||
|
||||
public String getPressoDD() {
|
||||
return (this.pressoDD == null) ? "" : this.pressoDD.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzoDD() {
|
||||
return (this.indirizzoDD == null) ? "" : this.indirizzoDD.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivicoDD() {
|
||||
return (this.numeroCivicoDD == null) ? "" : this.numeroCivicoDD.trim();
|
||||
}
|
||||
|
||||
public String getCapZonaDD() {
|
||||
return (this.capZonaDD == null) ? "" : this.capZonaDD.trim();
|
||||
}
|
||||
|
||||
public String getTelefonoDD() {
|
||||
return (this.telefonoDD == null) ? "" : this.telefonoDD.trim();
|
||||
}
|
||||
|
||||
public String getFaxDD() {
|
||||
return (this.faxDD == null) ? "" : this.faxDD.trim();
|
||||
}
|
||||
|
||||
public String getEMailDD() {
|
||||
return (this.eMailDD == null) ? "" : this.eMailDD.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setComuneDD(Comune newComune) {
|
||||
this.comuneDD = newComune;
|
||||
}
|
||||
|
||||
public Comune getComuneDD() {
|
||||
this.comuneDD = (Comune)getSecondaryObject(this.comuneDD, Comune.class, getId_comuneDD());
|
||||
return this.comuneDD;
|
||||
}
|
||||
|
||||
public void setNazioneDD(Nazione newNazione) {
|
||||
this.nazioneDD = newNazione;
|
||||
}
|
||||
|
||||
public Nazione getNazioneDD() {
|
||||
this.nazioneDD = (Nazione)getSecondaryObject(this.nazioneDD, Nazione.class, getId_nazioneDD());
|
||||
return this.nazioneDD;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<DestinazioneDiversa> findByCR(DestinazioneDiversaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from DESTINAZIONE_DIVERSA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getIndirizzoCompleto() {
|
||||
return getIndirizzoDD() + " n." + getIndirizzoDD() + " - " + getNumeroCivicoDD() + " " + (getCapZonaDD().isEmpty() ? getCapComuneDD() : getCapZonaDD()) + " (" +
|
||||
getDescrizioneComuneDD() + ")";
|
||||
}
|
||||
|
||||
public String getContatti() {
|
||||
return (this.faxDD == null) ? "" : this.faxDD.trim();
|
||||
}
|
||||
|
||||
public Vectumerator<DestinazioneDiversa> findByClifor(long l_id_clifor, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from DESTINAZIONE_DIVERSA AS A";
|
||||
String s_Sql_Order = " order by A.descrizioneDD";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void seteMailDD(String eMailDD) {
|
||||
this.eMailDD = eMailDD;
|
||||
}
|
||||
|
||||
public String getCapComuneDD() {
|
||||
if (this.id_comuneDD != 0L)
|
||||
return getComuneDD().getCap();
|
||||
return (this.capComuneDD == null) ? "" : this.capComuneDD.trim();
|
||||
}
|
||||
|
||||
public void setCapComuneDD(String capComuneDD) {
|
||||
this.capComuneDD = capComuneDD;
|
||||
}
|
||||
|
||||
public String getDescrizioneComuneDD() {
|
||||
if (this.id_comuneDD != 0L)
|
||||
return getComuneDD().getDescrizione();
|
||||
return (this.descrizioneComuneDD == null) ? "" : this.descrizioneComuneDD.trim();
|
||||
}
|
||||
|
||||
public void setDescrizioneComuneDD(String descrizioneComuneDD) {
|
||||
this.descrizioneComuneDD = descrizioneComuneDD;
|
||||
}
|
||||
|
||||
public String getProvinciaComuneDD() {
|
||||
if (this.id_comuneDD != 0L)
|
||||
return getComuneDD().getProvincia();
|
||||
return (this.provinciaComuneDD == null) ? "" : this.provinciaComuneDD.trim();
|
||||
}
|
||||
|
||||
public void setProvinciaComuneDD(String provinciaComuneDD) {
|
||||
this.provinciaComuneDD = provinciaComuneDD;
|
||||
}
|
||||
|
||||
public long getFlgDDDefault() {
|
||||
return this.flgDDDefault;
|
||||
}
|
||||
|
||||
public void setFlgDDDefault(long flgDDDefault) {
|
||||
this.flgDDDefault = flgDDDefault;
|
||||
}
|
||||
|
||||
public void findDefaultByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from DESTINAZIONE_DIVERSA AS A";
|
||||
String s_Sql_Order = " order by A.descrizioneDD";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc("A.flgDDDefault=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getFlgDDDefault() == 1L)
|
||||
update("update DESTINAZIONE_DIVERSA SET flgDDDefault=0 where id_clifor=" + getId_clifor());
|
||||
return super.save();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class DestinazioneDiversaCR extends CRAdapter {
|
||||
private long id_destinazioneDiversa;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private long id_comuneDD;
|
||||
|
||||
private String id_nazioneDD;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String presso;
|
||||
|
||||
private String indirizzoDD;
|
||||
|
||||
private String numeroCivicoDD;
|
||||
|
||||
private String capZonaDD;
|
||||
|
||||
private String telefonoDD;
|
||||
|
||||
private String faxDD;
|
||||
|
||||
private String eMailDD;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private Comune comuneDD;
|
||||
|
||||
private Nazione nazioneDD;
|
||||
|
||||
public DestinazioneDiversaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public DestinazioneDiversaCR() {}
|
||||
|
||||
public void setId_destinazioneDiversa(long newId_destinazioneDiversa) {
|
||||
this.id_destinazioneDiversa = newId_destinazioneDiversa;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public void setId_comuneDD(long newId_comuneDD) {
|
||||
this.id_comuneDD = newId_comuneDD;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setId_nazioneDD(String newId_nazioneDD) {
|
||||
this.id_nazioneDD = newId_nazioneDD;
|
||||
setNazione(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setPresso(String newPresso) {
|
||||
this.presso = newPresso;
|
||||
}
|
||||
|
||||
public void setIndirizzoDD(String newIndirizzoDD) {
|
||||
this.indirizzoDD = newIndirizzoDD;
|
||||
}
|
||||
|
||||
public void setNumeroCivicoDD(String newNumeroCivicoDD) {
|
||||
this.numeroCivicoDD = newNumeroCivicoDD;
|
||||
}
|
||||
|
||||
public void setCapZonaDD(String newCapZonaDD) {
|
||||
this.capZonaDD = newCapZonaDD;
|
||||
}
|
||||
|
||||
public void setTelefonoDD(String newTelefonoDD) {
|
||||
this.telefonoDD = newTelefonoDD;
|
||||
}
|
||||
|
||||
public void setFaxDD(String newFaxDD) {
|
||||
this.faxDD = newFaxDD;
|
||||
}
|
||||
|
||||
public void setEMailDD(String newEMailDD) {
|
||||
this.eMailDD = newEMailDD;
|
||||
}
|
||||
|
||||
public long getId_destinazioneDiversa() {
|
||||
return this.id_destinazioneDiversa;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public long getId_comuneDD() {
|
||||
return this.id_comuneDD;
|
||||
}
|
||||
|
||||
public String getId_nazioneDD() {
|
||||
return (this.id_nazioneDD == null) ? "" : this.id_nazioneDD.trim();
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getPresso() {
|
||||
return (this.presso == null) ? "" : this.presso.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzoDD() {
|
||||
return (this.indirizzoDD == null) ? "" : this.indirizzoDD.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivicoDD() {
|
||||
return (this.numeroCivicoDD == null) ? "" : this.numeroCivicoDD.trim();
|
||||
}
|
||||
|
||||
public String getCapZonaDD() {
|
||||
return (this.capZonaDD == null) ? "" : this.capZonaDD.trim();
|
||||
}
|
||||
|
||||
public String getTelefonoDD() {
|
||||
return (this.telefonoDD == null) ? "" : this.telefonoDD.trim();
|
||||
}
|
||||
|
||||
public String getFaxDD() {
|
||||
return (this.faxDD == null) ? "" : this.faxDD.trim();
|
||||
}
|
||||
|
||||
public String getEMailDD() {
|
||||
return (this.eMailDD == null) ? "" : this.eMailDD.trim();
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setComune(Comune newComune) {
|
||||
this.comuneDD = newComune;
|
||||
}
|
||||
|
||||
public Comune getComune() {
|
||||
this.comuneDD = (Comune)getSecondaryObject(this.comuneDD, Comune.class,
|
||||
|
||||
getId_comuneDD());
|
||||
return this.comuneDD;
|
||||
}
|
||||
|
||||
public void setNazione(Nazione newNazione) {
|
||||
this.nazioneDD = newNazione;
|
||||
}
|
||||
|
||||
public Nazione getNazione() {
|
||||
this.nazioneDD = (Nazione)getSecondaryObject(this.nazioneDD, Nazione.class,
|
||||
|
||||
getId_nazioneDD());
|
||||
return this.nazioneDD;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Esercizio extends _AnagAdapter implements Serializable {
|
||||
private long id_esercizio;
|
||||
|
||||
private long flgStato;
|
||||
|
||||
public Esercizio(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Esercizio() {}
|
||||
|
||||
public void setId_esercizio(long newId_esercizio) {
|
||||
this.id_esercizio = newId_esercizio;
|
||||
}
|
||||
|
||||
public void setFlgStato(long newFlgStato) {
|
||||
this.flgStato = newFlgStato;
|
||||
}
|
||||
|
||||
public long getId_esercizio() {
|
||||
return this.id_esercizio;
|
||||
}
|
||||
|
||||
public long getFlgStato() {
|
||||
return this.flgStato;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(EsercizioCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from ESERCIZIO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class EsercizioCR extends CRAdapter {
|
||||
private long id_esercizio;
|
||||
|
||||
private long flgStato;
|
||||
|
||||
public EsercizioCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public EsercizioCR() {}
|
||||
|
||||
public void setId_esercizio(long newId_esercizio) {
|
||||
this.id_esercizio = newId_esercizio;
|
||||
}
|
||||
|
||||
public void setFlgStato(long newFlgStato) {
|
||||
this.flgStato = newFlgStato;
|
||||
}
|
||||
|
||||
public long getId_esercizio() {
|
||||
return this.id_esercizio;
|
||||
}
|
||||
|
||||
public long getFlgStato() {
|
||||
return this.flgStato;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class Festivita extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = -6806543963513972058L;
|
||||
|
||||
private long id_festivita;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long giorno;
|
||||
|
||||
private long mese;
|
||||
|
||||
private long anno;
|
||||
|
||||
private Date dataEsclusione;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private Date dataInizio;
|
||||
|
||||
private Date dataFine;
|
||||
|
||||
public static final long TIPO_CALCOLO_FRATELLI = 0L;
|
||||
|
||||
public static final long TIPO_FESTIVITA_AMBULATORIO = 1L;
|
||||
|
||||
public static final long TIPO_FESTIVITA_LAVORATIVI = 2L;
|
||||
|
||||
public Festivita(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Festivita() {}
|
||||
|
||||
public void setId_festivita(long newId_festivita) {
|
||||
this.id_festivita = newId_festivita;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setGiorno(long newGiorno) {
|
||||
this.giorno = newGiorno;
|
||||
}
|
||||
|
||||
public void setMese(long newMese) {
|
||||
this.mese = newMese;
|
||||
}
|
||||
|
||||
public void setAnno(long newAnno) {
|
||||
this.anno = newAnno;
|
||||
}
|
||||
|
||||
public void setFlgTipo(long newFlgTipo) {
|
||||
this.flgTipo = newFlgTipo;
|
||||
}
|
||||
|
||||
public long getId_festivita() {
|
||||
return this.id_festivita;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione;
|
||||
}
|
||||
|
||||
public long getGiorno() {
|
||||
return this.giorno;
|
||||
}
|
||||
|
||||
public Date getDataAnno(int l_anno) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(5, (int)getGiorno());
|
||||
cal.set(2, (int)getMese() - 1);
|
||||
if (l_anno > 0)
|
||||
cal.set(1, l_anno);
|
||||
return new Date(cal.getTimeInMillis());
|
||||
}
|
||||
|
||||
public Date getDataAnno() {
|
||||
return getDataAnno((int)getAnno());
|
||||
}
|
||||
|
||||
public long getMese() {
|
||||
return this.mese;
|
||||
}
|
||||
|
||||
public long getAnno() {
|
||||
return this.anno;
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Festivita> findByCR(FestivitaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from FESTIVITA AS A";
|
||||
String s_Sql_Order = " order by A.anno, A.mese, A.giorno";
|
||||
WcString wc = new WcString();
|
||||
if (CR.getDataDa() != null)
|
||||
wc.addWc("(A.anno=0 or A.anno is null or A.anno>=" + CR.getAnnoDataDa() + ")");
|
||||
if (CR.getDataA() != null)
|
||||
wc.addWc("(A.anno=0 or A.anno is null or A.anno<=" + CR.getAnnoDataA() + ")");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
Vectumerator<Festivita> vec = findRows(stmt, 0, 0);
|
||||
Vectumerator<Festivita> result = new Vectumerator();
|
||||
while (vec.hasMoreElements()) {
|
||||
Festivita row = (Festivita)vec.nextElement();
|
||||
if (CR.getMeseDataDa() == CR.getMeseDataA()) {
|
||||
if (row.getMese() == (long)CR.getMeseDataDa() && row.getGiorno() >= (long)CR.getGiornoDataDa() &&
|
||||
row.getGiorno() <= (long)CR.getGiornoDataA())
|
||||
result.addElement(row);
|
||||
continue;
|
||||
}
|
||||
if ((row.getMese() == (long)CR.getMeseDataDa() && row.getGiorno() >= (long)CR.getGiornoDataDa()) || (
|
||||
row.getMese() > (long)CR.getMeseDataDa() && row.getMese() < (long)CR.getMeseDataA()) || (
|
||||
row.getMese() == (long)CR.getMeseDataA() && row.getGiorno() <= (long)CR.getGiornoDataA()))
|
||||
result.addElement(row);
|
||||
}
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByData(Date l_data, long flgTipo) {
|
||||
String s_Sql_Find = "select A.* from FESTIVITA AS A";
|
||||
String s_Sql_Order = " order by A.anno, A.mese, A.giorno";
|
||||
WcString wc = new WcString();
|
||||
long l_giorno = 0L;
|
||||
long l_mese = 0L;
|
||||
long l_anno = 0L;
|
||||
if (l_data != null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(l_data);
|
||||
l_giorno = (long)cal.get(5);
|
||||
l_mese = (long)(cal.get(2) + 1);
|
||||
l_anno = (long)cal.get(1);
|
||||
}
|
||||
if (flgTipo == 0L) {
|
||||
wc.addWc("((A.anno=0 or A.anno is null) and A.giorno=" + l_giorno + " and A.mese=" + l_mese + ") or (A.anno=" + l_anno + " and A.giorno=" + l_giorno + " and A.mese=" + l_mese + ")");
|
||||
} else {
|
||||
wc.addWc("((A.anno=0 or A.anno is null) and A.giorno=" + l_giorno + " and A.mese=" + l_mese + ") or (A.anno=" + l_anno + " and A.giorno=" + l_giorno + " and A.mese=" + l_mese + ") OR (A.dataInizio <= ? AND A.dataFine >= ?)");
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
int dataCount = 0;
|
||||
if (flgTipo != 0L) {
|
||||
dataCount++;
|
||||
stmt.setDate(dataCount, l_data);
|
||||
dataCount++;
|
||||
stmt.setDate(dataCount, l_data);
|
||||
}
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Date getDataEsclusione() {
|
||||
return this.dataEsclusione;
|
||||
}
|
||||
|
||||
public void setDataEsclusione(Date dataEsclusione) {
|
||||
this.dataEsclusione = dataEsclusione;
|
||||
if (dataEsclusione != null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(dataEsclusione);
|
||||
setGiorno((long)cal.get(5));
|
||||
setMese((long)(cal.get(2) + 1));
|
||||
setAnno((long)cal.get(1));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFestivo(Date l_data, long flgTipo) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(l_data);
|
||||
if (cal.get(7) == 1)
|
||||
return true;
|
||||
if (flgTipo == 2L &&
|
||||
cal.get(7) == 7)
|
||||
return true;
|
||||
Festivita festivita = new Festivita(getApFull());
|
||||
festivita.findByData(l_data, flgTipo);
|
||||
if (festivita.getDBState() == 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public Date getDataInizio() {
|
||||
return this.dataInizio;
|
||||
}
|
||||
|
||||
public void setDataInizio(Date dataDa) {
|
||||
this.dataInizio = dataDa;
|
||||
}
|
||||
|
||||
public Date getDataFine() {
|
||||
return this.dataFine;
|
||||
}
|
||||
|
||||
public void setDataFine(Date dataA) {
|
||||
this.dataFine = dataA;
|
||||
}
|
||||
|
||||
public long getTotGiorniLavorativiFraDueDate(Date dataDa, Date dataA) {
|
||||
long totGg = 0L;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(dataDa);
|
||||
while (getDateDiff(new Date(cal.getTimeInMillis()), dataA) >= 0L) {
|
||||
if (!isFestivo(new Date(cal.getTimeInMillis()), 2L))
|
||||
totGg++;
|
||||
cal.add(6, 1);
|
||||
}
|
||||
return totGg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class FestivitaCR extends CRAdapter {
|
||||
private long id_festivita;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long giorno;
|
||||
|
||||
private long mese;
|
||||
|
||||
private Date dataDa;
|
||||
|
||||
private Date dataA;
|
||||
|
||||
private long anno;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private Date dataFine;
|
||||
|
||||
private Date dataInizio;
|
||||
|
||||
public FestivitaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public FestivitaCR() {}
|
||||
|
||||
public void setId_festivita(long newId_festivita) {
|
||||
this.id_festivita = newId_festivita;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setGiorno(long newGiorno) {
|
||||
this.giorno = newGiorno;
|
||||
}
|
||||
|
||||
public void setMese(long newMese) {
|
||||
this.mese = newMese;
|
||||
}
|
||||
|
||||
public void setAnno(long newAnno) {
|
||||
this.anno = newAnno;
|
||||
}
|
||||
|
||||
public void setFlgTipo(long newFlgTipo) {
|
||||
this.flgTipo = newFlgTipo;
|
||||
}
|
||||
|
||||
public long getId_festivita() {
|
||||
return this.id_festivita;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione;
|
||||
}
|
||||
|
||||
public long getGiorno() {
|
||||
return this.giorno;
|
||||
}
|
||||
|
||||
public long getMese() {
|
||||
return this.mese;
|
||||
}
|
||||
|
||||
public long getAnno() {
|
||||
return this.anno;
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
public Date getDataA() {
|
||||
if (this.dataA == null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
this.dataA = DBAdapter.getLastOfYear(cal.get(1));
|
||||
}
|
||||
return this.dataA;
|
||||
}
|
||||
|
||||
public void setDataA(Date dataA) {
|
||||
this.dataA = dataA;
|
||||
}
|
||||
|
||||
public Date getDataDa() {
|
||||
return this.dataDa;
|
||||
}
|
||||
|
||||
public int getGiornoDataA() {
|
||||
if (this.dataA != null)
|
||||
return getCalendarDataA().get(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getMeseDataDa() {
|
||||
if (this.dataDa != null)
|
||||
return getCalendarDataDa().get(2) + 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getAnnoDataDa() {
|
||||
if (this.dataDa != null)
|
||||
return getCalendarDataDa().get(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Calendar getCalendarDataDa() {
|
||||
if (this.dataDa != null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(getDataDa());
|
||||
return cal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Calendar getCalendarDataA() {
|
||||
if (this.dataA != null) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(getDataA());
|
||||
return cal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setDataDa(Date dataDa) {
|
||||
this.dataDa = dataDa;
|
||||
}
|
||||
|
||||
public int getAnnoDataA() {
|
||||
if (this.dataA != null)
|
||||
return getCalendarDataA().get(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getGiornoDataDa() {
|
||||
if (this.dataDa != null)
|
||||
return getCalendarDataDa().get(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getMeseDataA() {
|
||||
if (this.dataA != null)
|
||||
return getCalendarDataA().get(2) + 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public Date getDataFine() {
|
||||
return this.dataFine;
|
||||
}
|
||||
|
||||
public Date getDataInizio() {
|
||||
return this.dataInizio;
|
||||
}
|
||||
|
||||
public void setDataFine(Date dataA) {
|
||||
this.dataFine = dataA;
|
||||
}
|
||||
|
||||
public void setDataInizio(Date dataDa) {
|
||||
this.dataInizio = dataDa;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Fornitore extends Clifor {
|
||||
private static final long serialVersionUID = -6753258942143203192L;
|
||||
|
||||
private long id_fornitore;
|
||||
|
||||
public Fornitore() {}
|
||||
|
||||
public Fornitore(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getTableBeanName() {
|
||||
return "CLIFOR";
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "F";
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(FornitoreCR CR, int pageNumber, int pageRows) {
|
||||
return findByCR(CR, pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public long getId_fornitore() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_fornitore(long id_cliente) {
|
||||
setId_clifor(id_cliente);
|
||||
}
|
||||
|
||||
protected String sqlStringfindAll() {
|
||||
return "select * from CLIFOR where id_clifor>1 and flgTipo='F' order by cognome, nome";
|
||||
}
|
||||
|
||||
public Vectumerator<Fornitore> findProgettisti() {
|
||||
String s_Sql_Find = "select A.* from CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.cognome, A.nome\t";
|
||||
WcString wc = new WcString();
|
||||
s_Sql_Find = s_Sql_Find + " JOIN CLIFOR_TIPO_CLIFOR AS B ON A.id_clifor = B.id_clifor JOIN TIPO_CLIFOR AS C ON B.id_tipoClifor = C.id_tipoClifor ";
|
||||
wc.addWc("A.flgTipo='F'");
|
||||
wc.addWc("C.flgTipologia = 2");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
|
||||
public class FornitoreCR extends CliforCR {
|
||||
private long id_fornitore;
|
||||
|
||||
public FornitoreCR() {}
|
||||
|
||||
public FornitoreCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "F";
|
||||
}
|
||||
|
||||
public long getId_fornitore() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_fornitore(long id_cliente) {
|
||||
setId_clifor(id_cliente);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Glossario extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1695626744317L;
|
||||
|
||||
private long id_glossario;
|
||||
|
||||
private long id_tipoGlossario;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private TipoGlossario tipoGlossario;
|
||||
|
||||
private String codice;
|
||||
|
||||
public Glossario(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Glossario() {}
|
||||
|
||||
public void setId_glossario(long newId_glossario) {
|
||||
this.id_glossario = newId_glossario;
|
||||
}
|
||||
|
||||
public void setId_tipoGlossario(long newId_tipoGlossario) {
|
||||
this.id_tipoGlossario = newId_tipoGlossario;
|
||||
setTipoGlossario(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_glossario() {
|
||||
return this.id_glossario;
|
||||
}
|
||||
|
||||
public long getId_tipoGlossario() {
|
||||
return this.id_tipoGlossario;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public void setTipoGlossario(TipoGlossario newTipoGlossario) {
|
||||
this.tipoGlossario = newTipoGlossario;
|
||||
}
|
||||
|
||||
public TipoGlossario getTipoGlossario() {
|
||||
this.tipoGlossario = (TipoGlossario)getSecondaryObject(this.tipoGlossario, TipoGlossario.class, getId_tipoGlossario());
|
||||
return this.tipoGlossario;
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Glossario> findByCR(GlossarioCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from GLOSSARIO AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
if (!CR.getCodiceTipoGlossario().isEmpty())
|
||||
s_Sql_Find = s_Sql_Find + " inner join TIPO_GLOSSARIO AS B ON A.id_tipoGlossario=B.id_tipoGlossario";
|
||||
WcString wc = new WcString();
|
||||
if (CR.getId_tipoGlossarioS() > 0L)
|
||||
wc.addWc("A.id_tipoGlossario=" + CR.getId_tipoGlossarioS());
|
||||
if (!CR.getCodiceTipoGlossario().isEmpty())
|
||||
wc.addWc("B.codice='" + CR.getCodiceTipoGlossario() + "'");
|
||||
if (!CR.getDescrizione().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getDescrizione().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.descrizione like '%" + token + "%' or A.codice ='" + token + "')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getCodice() {
|
||||
return (this.codice == null) ? "" : this.codice.trim();
|
||||
}
|
||||
|
||||
public void setCodice(String codice) {
|
||||
this.codice = codice;
|
||||
}
|
||||
|
||||
public Vectumerator<Glossario> findByCodiceTipoGlossario(String l_codiceTipoGlossario) {
|
||||
String s_Sql_Find = "select A.* from GLOSSARIO AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
s_Sql_Find = s_Sql_Find + " inner join TIPO_GLOSSARIO AS B ON A.id_tipoGlossario=B.id_tipoGlossario";
|
||||
WcString wc = new WcString();
|
||||
if (!l_codiceTipoGlossario.isEmpty())
|
||||
wc.addWc("B.codice='" + l_codiceTipoGlossario + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class GlossarioCR extends CRAdapter {
|
||||
private static final long serialVersionUID = -5321498975655164852L;
|
||||
|
||||
private long id_glossario;
|
||||
|
||||
private long id_tipoGlossarioS;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private TipoGlossario tipoGlossario;
|
||||
|
||||
private String codiceTipoGlossario;
|
||||
|
||||
public GlossarioCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public GlossarioCR() {}
|
||||
|
||||
public void setId_glossario(long newId_glossario) {
|
||||
this.id_glossario = newId_glossario;
|
||||
}
|
||||
|
||||
public void setId_tipoGlossarioS(long newId_tipoGlossario) {
|
||||
this.id_tipoGlossarioS = newId_tipoGlossario;
|
||||
setTipoGlossario(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_glossario() {
|
||||
return this.id_glossario;
|
||||
}
|
||||
|
||||
public long getId_tipoGlossarioS() {
|
||||
return this.id_tipoGlossarioS;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public void setTipoGlossario(TipoGlossario newTipoGlossario) {
|
||||
this.tipoGlossario = newTipoGlossario;
|
||||
}
|
||||
|
||||
public TipoGlossario getTipoGlossario() {
|
||||
this.tipoGlossario = (TipoGlossario)getSecondaryObject(this.tipoGlossario, TipoGlossario.class,
|
||||
|
||||
getId_tipoGlossarioS());
|
||||
return this.tipoGlossario;
|
||||
}
|
||||
|
||||
public String getCodiceTipoGlossario() {
|
||||
return (this.codiceTipoGlossario == null) ? "" : this.codiceTipoGlossario.trim();
|
||||
}
|
||||
|
||||
public void setCodiceTipoGlossario(String newCodice) {
|
||||
this.codiceTipoGlossario = newCodice;
|
||||
}
|
||||
}
|
||||
400
decompiled-libs/www/acxent-common-1.0.1/it/acxent/anag/Iva.java
Normal file
400
decompiled-libs/www/acxent-common-1.0.1/it/acxent/anag/Iva.java
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapterException;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Iva extends _AnagAdapter implements Serializable, IvaInterface {
|
||||
private static final long serialVersionUID = -2303180562953644516L;
|
||||
|
||||
public static final String TI_IMPONIBILE = "I";
|
||||
|
||||
public static final String TI_N1_ESCLUSO_ART_15 = "X";
|
||||
|
||||
public static final String TI_N2_NON_SOGGETTE_NON_VALIDO_2021 = "S";
|
||||
|
||||
public static final String TI_N2_1_NON_SOGGETTE_ART_7 = "S1";
|
||||
|
||||
public static final String TI_N2_2_NON_SOGGETTE_ALTRE = "S2";
|
||||
|
||||
public static final String TI_N3_NON_IMPONIBILE_NON_VALIDO_2021 = "N";
|
||||
|
||||
public static final String TI_N3_1_NON_IMPONIBILE_ESPORTAZIONI = "N1";
|
||||
|
||||
public static final String TI_N3_2_NON_IMPONIBILE_CESS_COMUN = "N2";
|
||||
|
||||
public static final String TI_N3_3_NON_IMPONIBILE_CESS_S_MARINO = "N3";
|
||||
|
||||
public static final String TI_N3_4_NON_IMPONIBILE_OP_ASSIM_CESS_ESPORT = "N4";
|
||||
|
||||
public static final String TI_N3_5_NON_IMPONIBILE_CON_DICH_INTENTO = "N5";
|
||||
|
||||
public static final String TI_N3_6_NON_IMPONIBILE_ALTRE_OPER = "N6";
|
||||
|
||||
public static final String TI_N4_ESENTE = "E";
|
||||
|
||||
public static final String TI_N5_REGIME_MARGINE = "R";
|
||||
|
||||
public static final String TI_N6_INVERSIONE_CONTABILE_NON_VALIDO_2021 = "C";
|
||||
|
||||
public static final String TI_N6_1_INVERSIONE_CONTABILE_ROTTAMI = "C1";
|
||||
|
||||
public static final String TI_N6_2_INVERSIONE_CONTABILE_ORO_ARGENTO = "C2";
|
||||
|
||||
public static final String TI_N6_3_INVERSIONE_CONTABILE_SUBAPP_EDILE = "C3";
|
||||
|
||||
public static final String TI_N6_4_INVERSIONE_CONTABILE_CESS_FABBRICATI = "C4";
|
||||
|
||||
public static final String TI_N6_5_INVERSIONE_CONTABILE_CESS_TEL_CELLULARI = "C5";
|
||||
|
||||
public static final String TI_N6_6_INVERSIONE_CONTABILE_CESS_PROD_ELETTRONICI = "C6";
|
||||
|
||||
public static final String TI_N6_7_INVERSIONE_CONTABILE_PREST_EDILE = "C7";
|
||||
|
||||
public static final String TI_N6_8_INVERSIONE_CONTABILE_SETT_ENERGETICO = "C8";
|
||||
|
||||
public static final String TI_N6_9_INVERSIONE_CONTABILE_ALTRI_CASI = "C9";
|
||||
|
||||
public static final String TI_N7_ASSOLTA_ATRO_STATO_UE = "A";
|
||||
|
||||
private long aliquota;
|
||||
|
||||
private long aliquotaIndetraibile;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String flgTipo;
|
||||
|
||||
private long id_ivaStdRM;
|
||||
|
||||
private Iva ivaStdRM;
|
||||
|
||||
private String notaEsenzione;
|
||||
|
||||
private String codiceExport;
|
||||
|
||||
private String descrizioneRigaStampa;
|
||||
|
||||
private long flgOss;
|
||||
|
||||
private long id_iva;
|
||||
|
||||
public static final String P_CODICE_IVA_STD_VEND = "CODICE_IVA_STD_VEND";
|
||||
|
||||
public static final String P_CODICE_IVA_STD_ACQUISTO = "CODICE_IVA_STD_ACQ";
|
||||
|
||||
public static final String P_CODICE_IVA_ESENTE_SPESE_BOLLI = "CODICE_IVA_ESENTE";
|
||||
|
||||
public static final String P_CODICE_IVA_CEE_AZIENDA_ART41 = "CODICE_IVA_CEE_AZIENDA_ART41";
|
||||
|
||||
public static final String P_CODICE_IVA_ITA_CEE_AZIENDA_ART58 = "CODICE_IVA_ITA_CEE_AZIENDA_ART58";
|
||||
|
||||
public static final String P_CODICE_IVA_EXTRA_CEE_ART8_A = "CODICE_IVA_ART8_A";
|
||||
|
||||
public static final String P_CODICE_IVA_EXTRA_CEE_ESP_ABITUALE_ART8_C = "CODICE_IVA_EXTRA_CEE_ESP_ABITUALE_ART8_C";
|
||||
|
||||
public static final String P_CODICE_IVA_TRASP_EXTRA_CEE_RAV_ART9 = "CODICE_IVA_ART9";
|
||||
|
||||
public static final String P_CODICE_IVA_REVERSE_CHARGE = "CODICE_IVA_REVERSE_CHARGE";
|
||||
|
||||
public static final String P_CODICE_IVA_REGIME_MARGINE = "CODICE_IVA_REGIME_MARGINE";
|
||||
|
||||
public static final String P_IVA_CEE_ONE_STOP_SHOP = "IVA_CEE_ONE_STOP_SHOP";
|
||||
|
||||
public static final String P_IVA_ESTERO_AZIENDA_ESENTE = "IVA_ESTERO_AZIENDA_ESENTE";
|
||||
|
||||
public Iva() {}
|
||||
|
||||
public Iva(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(IvaCR CR, int pageNumber, int pageRows) throws DBAdapterException, SQLException {
|
||||
String s_Sql_Find = "select A.* from IVA AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
String wc = "";
|
||||
if (!CR.getSearchTxt().isEmpty())
|
||||
wc = buildWc(wc, "A.descrizione like'" + CR.getSearchTxt() + "%' ");
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public long getAliquota() {
|
||||
return this.aliquota;
|
||||
}
|
||||
|
||||
public long getAliquotaIndetraibile() {
|
||||
return this.aliquotaIndetraibile;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione;
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return (this.flgTipo == null || this.flgTipo.isEmpty()) ? "I" : this.flgTipo;
|
||||
}
|
||||
|
||||
public static final String getTipo(String l_flgTipo) {
|
||||
if (l_flgTipo.equals("I"))
|
||||
return "Imponibile";
|
||||
if (l_flgTipo.equals("X"))
|
||||
return "Escluso ex art. 15 N1";
|
||||
if (l_flgTipo.equals("S"))
|
||||
return "Non Soggette N2 NO 2021";
|
||||
if (l_flgTipo.equals("S1"))
|
||||
return "Non Soggette N2.1 ART. 7 DPR 633/72";
|
||||
if (l_flgTipo.equals("S2"))
|
||||
return "Non Soggette N2.2 ALTRE";
|
||||
if (l_flgTipo.equals("N"))
|
||||
return "Non Imponibile N3 NO 2021";
|
||||
if (l_flgTipo.equals("N1"))
|
||||
return "Non Imponibile N3.1 Esportazioni";
|
||||
if (l_flgTipo.equals("N2"))
|
||||
return "Non Imponibile N3.2 Cessioni Intracomunitarie";
|
||||
if (l_flgTipo.equals("N3"))
|
||||
return "Non Imponibile N3.3 Cessioni San Marino";
|
||||
if (l_flgTipo.equals("N4"))
|
||||
return "Non Imponibile N3.4 Assim. Cess. Esportazioni";
|
||||
if (l_flgTipo.equals("N5"))
|
||||
return "Non Imponibile N3.5 con dichiarazioni di Intento";
|
||||
if (l_flgTipo.equals("N6"))
|
||||
return "Non Imponibile N3.6 oper. non concorrono al plafond";
|
||||
if (l_flgTipo.equals("E"))
|
||||
return "Esente N4";
|
||||
if (l_flgTipo.equals("R"))
|
||||
return "Regime del Margine N5";
|
||||
if (l_flgTipo.equals("C"))
|
||||
return "Inversione Contabile N6 NO 2021";
|
||||
if (l_flgTipo.equals("C1"))
|
||||
return "Inversione Contabile N6.1 Cess. Rottami";
|
||||
if (l_flgTipo.equals("C2"))
|
||||
return "Inversione Contabile N6.2 Cess. Oro o Argento";
|
||||
if (l_flgTipo.equals("C3"))
|
||||
return "Inversione Contabile N6.3 subapp. settore edile";
|
||||
if (l_flgTipo.equals("C4"))
|
||||
return "Inversione Contabile N6.4 Cessione Fabbricati";
|
||||
if (l_flgTipo.equals("C5"))
|
||||
return "Inversione Contabile N6.5 Cessione Tel. Cellulari";
|
||||
if (l_flgTipo.equals("C6"))
|
||||
return "Inversione Contabile N6.6 Cessione Prod. Elettronici";
|
||||
if (l_flgTipo.equals("C7"))
|
||||
return "Inversione Contabile N6.7 Prestaz. comparto edile e connessi";
|
||||
if (l_flgTipo.equals("C8"))
|
||||
return "Inversione Contabile N6.8 Oper. Settore Energetico";
|
||||
if (l_flgTipo.equals("C9"))
|
||||
return "Inversione Contabile N6.9 Altri Casi";
|
||||
if (l_flgTipo.equals("A"))
|
||||
return "Assolta UE N7";
|
||||
return "";
|
||||
}
|
||||
|
||||
public static final String getFENatura(String l_flgTipo) {
|
||||
if (l_flgTipo.equals("I"))
|
||||
return "";
|
||||
if (l_flgTipo.equals("X"))
|
||||
return "N1";
|
||||
if (l_flgTipo.equals("S"))
|
||||
return "N2";
|
||||
if (l_flgTipo.equals("S1"))
|
||||
return "N2.1";
|
||||
if (l_flgTipo.equals("S2"))
|
||||
return "N2.2";
|
||||
if (l_flgTipo.equals("N"))
|
||||
return "N3";
|
||||
if (l_flgTipo.equals("N1"))
|
||||
return "N3.1";
|
||||
if (l_flgTipo.equals("N2"))
|
||||
return "N3.2";
|
||||
if (l_flgTipo.equals("N3"))
|
||||
return "N3.3";
|
||||
if (l_flgTipo.equals("N4"))
|
||||
return "N3.4";
|
||||
if (l_flgTipo.equals("N5"))
|
||||
return "N3.5";
|
||||
if (l_flgTipo.equals("N6"))
|
||||
return "N3.6";
|
||||
if (l_flgTipo.equals("E"))
|
||||
return "N4";
|
||||
if (l_flgTipo.equals("R"))
|
||||
return "N5";
|
||||
if (l_flgTipo.equals("C"))
|
||||
return "N6";
|
||||
if (l_flgTipo.equals("C1"))
|
||||
return "N6.1";
|
||||
if (l_flgTipo.equals("C2"))
|
||||
return "N6.2";
|
||||
if (l_flgTipo.equals("C3"))
|
||||
return "N6.3";
|
||||
if (l_flgTipo.equals("C4"))
|
||||
return "N6.4";
|
||||
if (l_flgTipo.equals("C5"))
|
||||
return "N6.5";
|
||||
if (l_flgTipo.equals("C6"))
|
||||
return "N6.6";
|
||||
if (l_flgTipo.equals("C7"))
|
||||
return "N6.7";
|
||||
if (l_flgTipo.equals("C8"))
|
||||
return "N6.8";
|
||||
if (l_flgTipo.equals("C9"))
|
||||
return "N6.9";
|
||||
if (l_flgTipo.equals("A"))
|
||||
return "N7";
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getFENatura() {
|
||||
return getFENatura(getFlgTipo());
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return getTipo(getFlgTipo());
|
||||
}
|
||||
|
||||
public long getId_iva() {
|
||||
return this.id_iva;
|
||||
}
|
||||
|
||||
public String getNotaEsenzione() {
|
||||
return (this.notaEsenzione == null) ? "" : this.notaEsenzione;
|
||||
}
|
||||
|
||||
public void setAliquota(long newAliquota) {
|
||||
this.aliquota = newAliquota;
|
||||
}
|
||||
|
||||
public void setAliquotaIndetraibile(long l) {
|
||||
this.aliquotaIndetraibile = l;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setFlgTipo(String string) {
|
||||
this.flgTipo = string;
|
||||
}
|
||||
|
||||
public void setId_iva(long newId_iva) {
|
||||
this.id_iva = newId_iva;
|
||||
}
|
||||
|
||||
public void setNotaEsenzione(String l_notaEsenzione) {
|
||||
this.notaEsenzione = l_notaEsenzione;
|
||||
}
|
||||
|
||||
public String getCodiceExport() {
|
||||
return (this.codiceExport == null) ? "" : this.codiceExport;
|
||||
}
|
||||
|
||||
public void setCodiceExport(String codiceExport) {
|
||||
this.codiceExport = codiceExport;
|
||||
}
|
||||
|
||||
public long getAliquotaFE() {
|
||||
if (getFlgTipo().equals("R"))
|
||||
return 0L;
|
||||
return getAliquota();
|
||||
}
|
||||
|
||||
public boolean isRegimeMargine() {
|
||||
return getFlgTipo().equals("R");
|
||||
}
|
||||
|
||||
public String getDescrizioneRigaStampa() {
|
||||
return (this.descrizioneRigaStampa == null) ? "" : this.descrizioneRigaStampa.trim();
|
||||
}
|
||||
|
||||
public void setDescrizioneRigaStampa(String descrizioneRigaStampa) {
|
||||
this.descrizioneRigaStampa = descrizioneRigaStampa;
|
||||
}
|
||||
|
||||
public String getDescrizioneRigaStampaAuto() {
|
||||
return getDescrizioneRigaStampa().isEmpty() ? getDescrizione() : getDescrizioneRigaStampa();
|
||||
}
|
||||
|
||||
public long getFlgOss() {
|
||||
return this.flgOss;
|
||||
}
|
||||
|
||||
public void setFlgOss(long flgOss) {
|
||||
this.flgOss = flgOss;
|
||||
}
|
||||
|
||||
public Vectumerator<Iva> findAllOss() {
|
||||
String s_Sql_Find = "select A.* from IVA AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgOss=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getId_ivaStdRM() {
|
||||
return this.id_ivaStdRM;
|
||||
}
|
||||
|
||||
public void setId_ivaStdRM(long id_ivaStdRM) {
|
||||
this.id_ivaStdRM = id_ivaStdRM;
|
||||
setIvaStdRM(null);
|
||||
}
|
||||
|
||||
public Iva getIvaStdRM() {
|
||||
this.ivaStdRM = (Iva)getSecondaryObject(this.ivaStdRM, Iva.class, new Long(getId_ivaStdRM()));
|
||||
return this.ivaStdRM;
|
||||
}
|
||||
|
||||
public void setIvaStdRM(Iva ivaStdRM) {
|
||||
this.ivaStdRM = ivaStdRM;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getFlgTipo().equals("R")) {
|
||||
if (getId_ivaStdRM() == 0L)
|
||||
return new ResParm(false, "Errore! Indicare una aliquota iva per il calcolo dell'iva sul margine");
|
||||
} else {
|
||||
setId_ivaStdRM(0L);
|
||||
}
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public Vectumerator<Iva> findAllNoRM() {
|
||||
String s_Sql_Find = "select A.* from IVA AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgTipo!='R'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Iva> findAllNonOss() {
|
||||
String s_Sql_Find = "select A.* from IVA AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("(A.flgOss=0 or A.flgOss is null)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class IvaCR extends CRAdapter {
|
||||
public IvaCR() {}
|
||||
|
||||
public IvaCR(ApplParmFull newAp) {
|
||||
super(newAp);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
public interface IvaInterface {
|
||||
long getAliquota();
|
||||
|
||||
long getAliquotaIndetraibile();
|
||||
|
||||
String getDescrizione();
|
||||
|
||||
String getFlgTipo();
|
||||
|
||||
String getFENatura();
|
||||
|
||||
String getTipo();
|
||||
|
||||
long getId_iva();
|
||||
|
||||
String getNotaEsenzione();
|
||||
|
||||
void setAliquota(long paramLong);
|
||||
|
||||
void setAliquotaIndetraibile(long paramLong);
|
||||
|
||||
void setDescrizione(String paramString);
|
||||
|
||||
void setFlgTipo(String paramString);
|
||||
|
||||
void setId_iva(long paramLong);
|
||||
|
||||
void setNotaEsenzione(String paramString);
|
||||
|
||||
String getCodiceExport();
|
||||
|
||||
void setCodiceExport(String paramString);
|
||||
|
||||
long getAliquotaFE();
|
||||
|
||||
boolean isRegimeMargine();
|
||||
|
||||
Iva getIvaStdRM();
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
|
||||
public class Lang extends _AnagAdapter {
|
||||
private String descrizione;
|
||||
|
||||
public Lang() {}
|
||||
|
||||
public Lang(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public Vectumerator findLingue() {
|
||||
Vectumerator vec = new Vectumerator();
|
||||
String lingue = getParm("TAGLIE_LINGUE").getTesto();
|
||||
StringTokenizer st = new StringTokenizer(lingue, ",");
|
||||
while (st.hasMoreTokens()) {
|
||||
Lang lg = new Lang(getApFull());
|
||||
lg.setDescrizione(st.nextToken());
|
||||
vec.add(lg);
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
|
||||
protected boolean isDatabaseBean() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,696 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.DoubleOperator;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Listino extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = -8525948766452916580L;
|
||||
|
||||
public static final int TIPO_LISTINO_PERC_SCONTO_VEND = 0;
|
||||
|
||||
public static final int TIPO_LISTINO_RICARICO_ACQ = 1;
|
||||
|
||||
public static final int TIPO_LISTINO_RICARICO_PREZZO_BASE = 2;
|
||||
|
||||
public static final int TIPO_LISTINO_BASE = 99;
|
||||
|
||||
public static final int PREZZO = 0;
|
||||
|
||||
public static final int PERTCENTUALE = 1;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private long flgTipoL;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private double percL;
|
||||
|
||||
private double percL1;
|
||||
|
||||
private double percL2;
|
||||
|
||||
private double percL3;
|
||||
|
||||
public Listino(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Listino() {}
|
||||
|
||||
public void setId_listino(long newId_listino) {
|
||||
this.id_listino = newId_listino;
|
||||
}
|
||||
|
||||
public void setFlgTipoL(long newFlgTipo) {
|
||||
this.flgTipoL = newFlgTipo;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setPercL(double newPercL) {
|
||||
this.percL = newPercL;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public long getFlgTipoL() {
|
||||
return this.flgTipoL;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public double getPercL() {
|
||||
return this.percL;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(ListinoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.descrizione like '%" + token + "%' or A.descrizione like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
if (!CR.getDescrizione().trim().isEmpty())
|
||||
wc.addWc("A.descrizione like'%" + CR.getDescrizione() + "%'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTipoL() {
|
||||
return getTipoL(getFlgTipoL());
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
if (getId_listino() == 0L)
|
||||
return "";
|
||||
return getDescrizione() + " " + getDescrizione() + " " + getTipoL();
|
||||
}
|
||||
|
||||
public ResParm addListinoTipo(ListinoTipo row) {
|
||||
ListinoTipo bean = new ListinoTipo(getApFull());
|
||||
bean.findByPrimaryKey(row.getId_listinoTipo());
|
||||
if (bean.getDBState() == 1)
|
||||
row.setDBState(bean.getDBState());
|
||||
ResParm rp = row.save();
|
||||
return rp;
|
||||
}
|
||||
|
||||
public ResParm delListinoTipo(ListinoTipo row) {
|
||||
ListinoTipo bean = new ListinoTipo(getApFull());
|
||||
bean.findByPrimaryKey(row.getId_listinoTipo());
|
||||
return bean.delete();
|
||||
}
|
||||
|
||||
public Vectumerator getListinoTipo() {
|
||||
return new ListinoTipo(getApFull()).findByListino(getId_listino(), 0, 0);
|
||||
}
|
||||
|
||||
public boolean hasListinoTipo() {
|
||||
Vectumerator vec = new ListinoTipo(getApFull()).findByListino(getId_listino(), 1, 1);
|
||||
if (vec.hasMoreElements())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasListinoArticolo(Articolo bean) {
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloListino(bean.getId_articolo(), getId_listino());
|
||||
if (la.getId_listinoArticolo() > 0L)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasListinoArticoloVariante(ArticoloVariante bean) {
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloVarianteListino(bean.getId_articoloVariante(), getId_listino());
|
||||
if (la.getId_listinoArticolo() > 0L)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public double getPercSconto(Articolo articolo) {
|
||||
if (getId_listino() == 0L || getFlgTipoL() == 1L)
|
||||
return 0.0D;
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloListino(articolo.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L)
|
||||
return listinoArticolo.getPercEffettiva();
|
||||
double percSconto = getPercEffettiva();
|
||||
ListinoTipo listinoTipo = new ListinoTipo(getApFull());
|
||||
listinoTipo.findByListinoTipo(getId_listino(), articolo.getId_tipo());
|
||||
if (listinoTipo.getId_listinoTipo() > 0L)
|
||||
percSconto = listinoTipo.getPercEffettiva();
|
||||
return percSconto;
|
||||
}
|
||||
|
||||
public double getPercSconto(ArticoloVariante articoloVariante) {
|
||||
if (getId_listino() == 0L || getFlgTipoL() == 1L)
|
||||
return 0.0D;
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloListino(articoloVariante.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L)
|
||||
return listinoArticolo.getPercEffettiva();
|
||||
return getPercSconto(articoloVariante.getArticolo());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoIva(Articolo articolo) {
|
||||
return getPrezzo(articolo).conIva((double)articolo.getIva().getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoIva(Articolo articolo, Iva l_iva) {
|
||||
return getPrezzo(articolo).conIva((double)l_iva.getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoBaseLA(Articolo articolo) {
|
||||
PrezzoArticolo pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
if (getId_listino() == 0L || articolo == null || articolo.getId_articolo() == 0L || getFlgTipoL() != 99L)
|
||||
return pa;
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloListino(articolo.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L)
|
||||
pa = listinoArticolo.getPrezzoArticoloLA();
|
||||
return pa;
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoBaseIvaLA(Articolo articolo) {
|
||||
return getPrezzoBaseLA(articolo).conIva((double)articolo.getIva().getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzo(Articolo articolo) {
|
||||
PrezzoArticolo pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
if (getId_listino() == 0L || articolo == null || articolo.getId_articolo() == 0L)
|
||||
return pa;
|
||||
if (getFlgTipoL() == 99L) {
|
||||
ListinoArticolo listinoArticolo1 = new ListinoArticolo(getApFull());
|
||||
listinoArticolo1.findByArticoloListino(articolo.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo1.getId_listinoArticolo() > 0L)
|
||||
pa = listinoArticolo1.getPrezzoFinaleLA();
|
||||
return pa;
|
||||
}
|
||||
PrezzoArticolo prezzoArticoloBase = dammiListinoBase(getApFull()).getPrezzo(articolo);
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloListino(articolo.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L) {
|
||||
pa = listinoArticolo.getPrezzoFinaleLA();
|
||||
} else {
|
||||
ListinoTipo listinoTipo = new ListinoTipo(getApFull());
|
||||
listinoTipo.findByListinoTipo(getId_listino(), articolo.getId_tipo());
|
||||
if (listinoTipo.getId_listinoTipo() > 0L) {
|
||||
pa = listinoTipo.getPrezzoFinaleLT(articolo);
|
||||
} else {
|
||||
double prezzoBase = articolo.getPrezzoBase();
|
||||
double perc = getPercEffettiva();
|
||||
if (perc > 0.0D) {
|
||||
if (getFlgTipoL() == 0L) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(prezzoBase);
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
pa = new PrezzoArticolo(prezzoBase, getPercL(), pps.getResult(), getPercL1(), getPercL2(), getPercL3(), 0.0D);
|
||||
} else if (getFlgTipoL() == 1L) {
|
||||
if (articolo.getCostoAcquistoUltimo() > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(articolo.getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
pa = new PrezzoArticolo(0.0D, 0.0D, pps.getResult(), getPercL1(), getPercL2(), getPercL3(), 0.0D);
|
||||
}
|
||||
} else if (getFlgTipoL() == 2L) {
|
||||
if (prezzoBase > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(prezzoBase);
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
pa = new PrezzoArticolo(0.0D, 0.0D, pps.getResult(), getPercL1(), getPercL2(), getPercL3(), 0.0D);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return dammiListinoBase(getApFull()).getPrezzo(articolo);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pa.getPrezzoFinale() > 0.0D) {
|
||||
double prezzoBaseFinale = prezzoArticoloBase.getPrezzoFinale();
|
||||
if (getFlgTipoL() != 2L && prezzoBaseFinale < pa.getPrezzoFinale())
|
||||
return prezzoArticoloBase;
|
||||
return pa;
|
||||
}
|
||||
return prezzoArticoloBase;
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzo(ArticoloVariante articoloVariante) {
|
||||
PrezzoArticolo pa;
|
||||
if (getId_listino() == 0L || articoloVariante == null || articoloVariante.getId_articoloVariante() == 0L) {
|
||||
pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return pa;
|
||||
}
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloVarianteListino(articoloVariante.getId_articoloVariante(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L) {
|
||||
pa = listinoArticolo.getPrezzoFinaleLA();
|
||||
} else {
|
||||
pa = getPrezzo(articoloVariante.getArticolo());
|
||||
}
|
||||
if (getFlgTipoL() != 99L) {
|
||||
PrezzoArticolo prezzoArticoloBase = dammiListinoBase(getApFull()).getPrezzo(articoloVariante);
|
||||
double prezzoBaseFinale = prezzoArticoloBase.getPrezzoFinale();
|
||||
if (prezzoBaseFinale < pa.getPrezzoFinale())
|
||||
return prezzoArticoloBase;
|
||||
return pa;
|
||||
}
|
||||
return pa;
|
||||
}
|
||||
|
||||
public static final String getTipoL(long l_flgTipo) {
|
||||
switch ((int)l_flgTipo) {
|
||||
case 0:
|
||||
return "Sconto su Vendita";
|
||||
case 1:
|
||||
return "Ricarico su Acquisto";
|
||||
case 99:
|
||||
return "Listino base";
|
||||
case 2:
|
||||
return "Ricarico aggiuntivo su prezzo base";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public Vectumerator getListinoArticoloVariante(int pageNumber, int pageRows) {
|
||||
return new ListinoArticolo(getApFull()).findArticoliVarianteByListino(getId_listino(), pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public ResParm addListinoArticolo(ListinoArticolo row) {
|
||||
ResParm rp = new ResParm(true);
|
||||
ListinoArticolo bean = new ListinoArticolo(getApFull());
|
||||
bean.findByPrimaryKey(row.getId_listinoArticolo());
|
||||
if (bean.getDBState() == 1) {
|
||||
bean.setPrezzoLA(row.getPrezzoLA());
|
||||
bean.setPercLA(row.getPercLA());
|
||||
bean.setPercLA1(row.getPercLA1());
|
||||
bean.setPercLA2(row.getPercLA2());
|
||||
bean.setPercLA3(row.getPercLA3());
|
||||
rp = bean.save();
|
||||
} else {
|
||||
row.setDBState(0);
|
||||
rp = row.save();
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public ResParm addListinoArticoloVariante(ListinoArticolo row) {
|
||||
ResParm rp = new ResParm(true);
|
||||
ListinoArticolo bean = new ListinoArticolo(getApFull());
|
||||
bean.findByPrimaryKey(row.getId_listinoArticolo());
|
||||
if (bean.getDBState() == 1) {
|
||||
bean.setPrezzoLA(row.getPrezzoLA());
|
||||
bean.setPercLA(row.getPercLA());
|
||||
bean.setPercLA1(row.getPercLA1());
|
||||
bean.setPercLA2(row.getPercLA2());
|
||||
bean.setPercLA3(row.getPercLA3());
|
||||
bean.setDataScadenzaOffertaLA(row.getDataScadenzaOffertaLA());
|
||||
bean.setPrezzoOffertaLA(row.getPrezzoOffertaLA());
|
||||
rp = bean.save();
|
||||
} else {
|
||||
row.setDBState(0);
|
||||
rp = row.save();
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public ResParm delListinoArticolo(ListinoArticolo row) {
|
||||
ListinoArticolo bean = new ListinoArticolo(getApFull());
|
||||
bean.findByPrimaryKey(row.getId_listinoArticolo());
|
||||
return bean.delete();
|
||||
}
|
||||
|
||||
public Vectumerator getListinoArticolo(int pageNumber, int pageRows) {
|
||||
return new ListinoArticolo(getApFull()).findArticoliByListino(getId_listino(), pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public void findListinoBase() {
|
||||
String s_Sql_Find = "select A.* from LISTINO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgTipoL = 99");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void creaListinoBase() {
|
||||
setDescrizione("Listino Base");
|
||||
setFlgTipoL(99L);
|
||||
save();
|
||||
}
|
||||
|
||||
public double getPercLAByArticoloListino(long id_articolo, long id_listino) {
|
||||
double percentuale = 0.0D;
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloListino(id_articolo, id_listino);
|
||||
if (getFlgTipoL() == 99L) {
|
||||
if (la.isOffertaValida()) {
|
||||
percentuale = 0.0D;
|
||||
} else {
|
||||
percentuale = la.getPercLA();
|
||||
}
|
||||
} else {
|
||||
double perc = 0.0D;
|
||||
if (la.getPercLA() != 0.0D) {
|
||||
perc = la.getPercLA();
|
||||
} else {
|
||||
perc = getPercL();
|
||||
}
|
||||
Listino lis = dammiListinoBase(getApFull());
|
||||
double prezzoBase = getPrezzoByArticoloListino(id_articolo, lis.getId_listino(), true);
|
||||
DoubleOperator dp = new DoubleOperator(prezzoBase);
|
||||
dp.multiply(perc);
|
||||
dp.divide(100.0F);
|
||||
dp.add(prezzoBase);
|
||||
double prezzoLisCli = dp.getResult();
|
||||
double prezzoLisBase = lis.getPrezzoByArticoloListino(id_articolo, lis.getId_listino(), false);
|
||||
if (prezzoLisCli > prezzoLisBase) {
|
||||
percentuale = lis.getPercLAByArticoloListino(id_articolo, lis.getId_listino());
|
||||
} else {
|
||||
percentuale = perc;
|
||||
}
|
||||
}
|
||||
return percentuale;
|
||||
}
|
||||
|
||||
public double getPercLAByArticoloVarianteListino(long id_articoloVariante, long id_listino) {
|
||||
double percentuale = 0.0D;
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloVarianteListino(id_articoloVariante, id_listino);
|
||||
if (getFlgTipoL() == 99L) {
|
||||
if (la.isOffertaValida()) {
|
||||
percentuale = 0.0D;
|
||||
} else {
|
||||
percentuale = la.getPercLA();
|
||||
}
|
||||
} else {
|
||||
double perc = 0.0D;
|
||||
if (la.getPercLA() != 0.0D) {
|
||||
perc = la.getPercLA();
|
||||
} else {
|
||||
perc = getPercL();
|
||||
}
|
||||
Listino lis = dammiListinoBase(getApFull());
|
||||
double prezzoBase = getPrezzoByArticoloVarianteListino(id_articoloVariante, lis.getId_listino(), true);
|
||||
DoubleOperator dp = new DoubleOperator(prezzoBase);
|
||||
dp.multiply(perc);
|
||||
dp.divide(100.0F);
|
||||
dp.add(prezzoBase);
|
||||
double prezzoLisCli = dp.getResult();
|
||||
double prezzoLisBase = lis.getPrezzoByArticoloVarianteListino(id_articoloVariante, lis.getId_listino(), false);
|
||||
if (prezzoLisCli > prezzoLisBase) {
|
||||
percentuale = lis.getPercLAByArticoloVarianteListino(id_articoloVariante, lis.getId_listino());
|
||||
} else {
|
||||
percentuale = perc;
|
||||
}
|
||||
}
|
||||
return percentuale;
|
||||
}
|
||||
|
||||
public double getPrezzoByArticoloListino(long id_articolo, long id_listino, boolean rendiPrezzoBase) {
|
||||
double prezzo = 0.0D;
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloListino(id_articolo, id_listino);
|
||||
if (rendiPrezzoBase) {
|
||||
prezzo = la.getPrezzoLA();
|
||||
} else if (getFlgTipoL() == 99L) {
|
||||
if (la.isOffertaValida()) {
|
||||
DoubleOperator dp = new DoubleOperator(la.getPrezzoLA());
|
||||
dp.multiply(la.getPercLA());
|
||||
dp.divide(100.0F);
|
||||
dp.add(la.getPrezzoLA());
|
||||
if (dp.getResult() > la.getPrezzoOffertaLA())
|
||||
prezzo = la.getPrezzoOffertaLA();
|
||||
} else {
|
||||
prezzo = la.getPrezzoLA();
|
||||
}
|
||||
} else {
|
||||
double perc = 0.0D;
|
||||
if (la.getPercLA() != 0.0D) {
|
||||
perc = la.getPercLA();
|
||||
} else {
|
||||
perc = getPercL();
|
||||
}
|
||||
Listino lis = dammiListinoBase(getApFull());
|
||||
double prezzoBase = getPrezzoByArticoloListino(id_articolo, lis.getId_listino(), true);
|
||||
DoubleOperator dp = new DoubleOperator(prezzoBase);
|
||||
dp.multiply(perc);
|
||||
dp.divide(100.0F);
|
||||
dp.add(prezzoBase);
|
||||
double prezzoLisCli = dp.getResult();
|
||||
double prezzoLisBase = lis.getPrezzoByArticoloListino(id_articolo, lis.getId_listino(), false);
|
||||
if (prezzoLisCli > prezzoLisBase) {
|
||||
if (lis.getPercLAByArticoloListino(id_articolo, id_listino) > 0.0D) {
|
||||
prezzo = prezzoBase;
|
||||
} else {
|
||||
prezzo = prezzoLisBase;
|
||||
}
|
||||
} else {
|
||||
prezzo = prezzoLisCli;
|
||||
}
|
||||
}
|
||||
return prezzo;
|
||||
}
|
||||
|
||||
public double getPrezzoByArticoloVarianteListino(long id_articoloVariante, long id_listino, boolean rendiPrezzoBase) {
|
||||
double prezzo = 0.0D;
|
||||
ListinoArticolo la = new ListinoArticolo(getApFull());
|
||||
la.findByArticoloVarianteListino(id_articoloVariante, id_listino);
|
||||
if (rendiPrezzoBase) {
|
||||
prezzo = la.getPrezzoLA();
|
||||
} else if (getFlgTipoL() == 99L) {
|
||||
if (la.isOffertaValida()) {
|
||||
DoubleOperator dp = new DoubleOperator(la.getPrezzoLA());
|
||||
dp.multiply(la.getPercLA());
|
||||
dp.divide(100.0F);
|
||||
dp.add(la.getPrezzoLA());
|
||||
if (dp.getResult() > la.getPrezzoOffertaLA())
|
||||
if (la.getPercLA() > 0.0D) {
|
||||
prezzo = la.getPrezzoLA();
|
||||
} else {
|
||||
prezzo = la.getPrezzoOffertaLA();
|
||||
}
|
||||
} else {
|
||||
prezzo = la.getPrezzoLA();
|
||||
}
|
||||
} else {
|
||||
double perc = 0.0D;
|
||||
if (la.getPercLA() != 0.0D) {
|
||||
perc = la.getPercLA();
|
||||
} else {
|
||||
perc = getPercL();
|
||||
}
|
||||
Listino lis = dammiListinoBase(getApFull());
|
||||
double prezzoBase = getPrezzoByArticoloVarianteListino(id_articoloVariante, lis.getId_listino(), true);
|
||||
DoubleOperator dp = new DoubleOperator(prezzoBase);
|
||||
dp.multiply(perc);
|
||||
dp.divide(100.0F);
|
||||
dp.add(prezzoBase);
|
||||
double prezzoLisCli = dp.getResult();
|
||||
double prezzoLisBase = lis.getPrezzoByArticoloVarianteListino(id_articoloVariante, lis.getId_listino(), false);
|
||||
if (prezzoLisCli > prezzoLisBase) {
|
||||
if (lis.getPercLAByArticoloVarianteListino(id_articoloVariante, id_listino) > 0.0D) {
|
||||
prezzo = prezzoBase;
|
||||
} else {
|
||||
prezzo = prezzoLisBase;
|
||||
}
|
||||
} else {
|
||||
prezzo = prezzoBase;
|
||||
}
|
||||
}
|
||||
return prezzo;
|
||||
}
|
||||
|
||||
public double getPrezzoOld(Articolo articolo) {
|
||||
if (getId_listino() == 0L)
|
||||
return articolo.getPrezzoPubblico();
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloListino(articolo.getId_articolo(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L) {
|
||||
if (listinoArticolo.getPrezzoLA() > 0.0D)
|
||||
return listinoArticolo.getPrezzoLA();
|
||||
if (getFlgTipoL() == 0L || listinoArticolo.getPercLA() == 0.0D)
|
||||
return articolo.getPrezzoPubblico();
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(listinoArticolo.getPercLA());
|
||||
pps.multiply(articolo.getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
return pps.getResult();
|
||||
}
|
||||
if (getFlgTipoL() == 1L) {
|
||||
double percRicarico = getPercL();
|
||||
ListinoTipo listinoTipo = new ListinoTipo(getApFull());
|
||||
listinoTipo.findByListinoTipo(getId_listino(), articolo.getId_tipo());
|
||||
if (listinoTipo.getId_listinoTipo() > 0L)
|
||||
percRicarico = listinoTipo.getPercLT();
|
||||
if (percRicarico > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(percRicarico);
|
||||
pps.multiply(articolo.getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
return pps.getResult();
|
||||
}
|
||||
return articolo.getPrezzoPubblico();
|
||||
}
|
||||
return articolo.getPrezzoPubblico();
|
||||
}
|
||||
|
||||
public double getPrezzoOld(ArticoloVariante articoloVariante) {
|
||||
if (getId_listino() == 0L)
|
||||
return articoloVariante.getArticolo().getPrezzoPubblico();
|
||||
ListinoArticolo listinoArticolo = new ListinoArticolo(getApFull());
|
||||
listinoArticolo.findByArticoloVarianteListino(articoloVariante.getId_articoloVariante(), getId_listino());
|
||||
if (listinoArticolo.getId_listinoArticolo() > 0L) {
|
||||
if (listinoArticolo.getPrezzoLA() > 0.0D)
|
||||
return listinoArticolo.getPrezzoLA();
|
||||
if (getFlgTipoL() == 0L || listinoArticolo.getPercLA() == 0.0D)
|
||||
return articoloVariante.getArticolo().getPrezzoPubblico();
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(listinoArticolo.getPercLA());
|
||||
pps.multiply(articoloVariante.getArticolo().getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
return pps.getResult();
|
||||
}
|
||||
return 0.0D;
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoIva(ArticoloVariante articoloVariante) {
|
||||
return getPrezzo(articoloVariante).conIva((double)articoloVariante.getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public ListinoArticolo getListinoArticoloBase(Articolo articolo) {
|
||||
if (getApFull() != null && articolo.getId_articolo() != 0L) {
|
||||
ListinoArticolo listinoArticoloBase = new ListinoArticolo(getApFull());
|
||||
listinoArticoloBase.findByArticoloListino(articolo.getId_articolo(), dammiListinoBase(getApFull()).getId_listino());
|
||||
return listinoArticoloBase;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public double getPercL1() {
|
||||
return this.percL1;
|
||||
}
|
||||
|
||||
public double getPercL2() {
|
||||
return this.percL2;
|
||||
}
|
||||
|
||||
public double getPercL3() {
|
||||
return this.percL3;
|
||||
}
|
||||
|
||||
public void setPercL1(double percL1) {
|
||||
this.percL1 = percL1;
|
||||
}
|
||||
|
||||
public void setPercL2(double percL2) {
|
||||
this.percL2 = percL2;
|
||||
}
|
||||
|
||||
public void setPercL3(double percL3) {
|
||||
this.percL3 = percL3;
|
||||
}
|
||||
|
||||
public String getDescrizionePercentuale() {
|
||||
if (isPercentualiSconto3())
|
||||
return getNf2().format(getPercL1()) + " + " + getNf2().format(getPercL1()) + " + " + getNf2().format(getPercL2()) + " %";
|
||||
return getNf2().format(getPercL()) + " %";
|
||||
}
|
||||
|
||||
public double getPercEffettiva() {
|
||||
if (isPercentualiSconto3()) {
|
||||
double perc = getPercL1();
|
||||
if (perc > 0.0D &&
|
||||
getPercL2() > 0.0D) {
|
||||
perc = getSommaPercentuali(perc, getPercL2());
|
||||
if (getPercL3() > 0.0D)
|
||||
perc = getSommaPercentuali(perc, getPercL3());
|
||||
}
|
||||
return perc;
|
||||
}
|
||||
return getPercL();
|
||||
}
|
||||
|
||||
public Vectumerator<Listino> findNoListinoBase() {
|
||||
String s_Sql_Find = "select A.* from LISTINO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgTipoL <> 99");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static final Listino dammiListinoBase(ApplParmFull apFull) {
|
||||
Listino bean = new Listino(apFull);
|
||||
bean.findListinoBase();
|
||||
if (bean.getDBState() == 0)
|
||||
bean.creaListinoBase();
|
||||
return bean;
|
||||
}
|
||||
|
||||
public static final double getSommaPercentuali(double perc1, double perc2) {
|
||||
DoubleOperator dop = new DoubleOperator(100.0F);
|
||||
dop.setScale(2, 5);
|
||||
dop.subtract(perc1);
|
||||
dop.multiply(perc2);
|
||||
dop.divide(100.0F);
|
||||
dop.add(perc1);
|
||||
return dop.getResult();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,500 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.DoubleOperator;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ListinoArticolo extends _AnagAdapter {
|
||||
private long id_listinoArticolo;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private long id_articolo;
|
||||
|
||||
private long id_articoloVariante;
|
||||
|
||||
private double prezzoLA;
|
||||
|
||||
private Listino listino;
|
||||
|
||||
private Articolo articolo;
|
||||
|
||||
private ArticoloVariante articoloVariante;
|
||||
|
||||
private double percLA;
|
||||
|
||||
private double prezzoOffertaLA;
|
||||
|
||||
private Date dataScadenzaOffertaLA;
|
||||
|
||||
private double abbuonoPrezzoPubblicoLA;
|
||||
|
||||
private Date dataCambiamentoPrezzoLA;
|
||||
|
||||
private double prezzoLADb;
|
||||
|
||||
private double prezzoConIvaLA;
|
||||
|
||||
private double percLA1;
|
||||
|
||||
private double percLA3;
|
||||
|
||||
private double percLA2;
|
||||
|
||||
private double percScontoOffertaLA;
|
||||
|
||||
public ListinoArticolo(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoArticolo() {}
|
||||
|
||||
public long getId_listinoArticolo() {
|
||||
return this.id_listinoArticolo;
|
||||
}
|
||||
|
||||
public void setId_listinoArticolo(long id_listinoArticolo) {
|
||||
this.id_listinoArticolo = id_listinoArticolo;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public void setId_listino(long id_listino) {
|
||||
this.id_listino = id_listino;
|
||||
}
|
||||
|
||||
public long getId_articolo() {
|
||||
return this.id_articolo;
|
||||
}
|
||||
|
||||
public void setId_articolo(long id_articolo) {
|
||||
this.id_articolo = id_articolo;
|
||||
}
|
||||
|
||||
public long getId_articoloVariante() {
|
||||
return this.id_articoloVariante;
|
||||
}
|
||||
|
||||
public void setId_articoloVariante(long id_articoloVariante) {
|
||||
this.id_articoloVariante = id_articoloVariante;
|
||||
}
|
||||
|
||||
public double getPrezzoLA() {
|
||||
return Math.abs(this.prezzoLA);
|
||||
}
|
||||
|
||||
public double getPrezzoIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoFinaleIvaLA() {
|
||||
return getPrezzoFinaleLA().conIva((double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public double getPrezzoIvaAbbuonoLA() {
|
||||
DoubleOperator dp = new DoubleOperator(DBAdapter.conIva(getPrezzoLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getListino().getFlgTipoL() == 99L) {
|
||||
dp.subtract(getAbbuonoPrezzoPubblicoLA());
|
||||
dp.setScale(2, 5);
|
||||
}
|
||||
return dp.getResult();
|
||||
}
|
||||
|
||||
public double getPrezzoScontatoLA() {
|
||||
double perc = getPercEffettiva();
|
||||
if (perc != 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(getPrezzoLA());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
return pps.getResult();
|
||||
}
|
||||
return getPrezzoLA();
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoArticoloLA() {
|
||||
return new PrezzoArticolo(getPrezzoLA(), 0.0D, getPrezzoLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoArticoloIvaLA() {
|
||||
return getPrezzoArticoloLA().conIva((double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoFinaleLA() {
|
||||
if (getId_listino() > 0L) {
|
||||
if (getListino().getFlgTipoL() == 99L) {
|
||||
if (isOffertaValida()) {
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(getPrezzoOffertaLA(), 0.0D, getPrezzoOffertaLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
prezzoArticolo2.setOfferta(true);
|
||||
prezzoArticolo2.setDataScadenzaOfferta(getDataScadenzaOffertaLA());
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(getPrezzoLA(), getPercLA(), getPrezzoScontatoLA(), getPercLA1(), getPercLA2(), getPercLA3(),
|
||||
getAbbuonoPrezzoPubblicoLA());
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
if (isOffertaValida()) {
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(getPrezzoOffertaLA(), 0.0D, getPrezzoOffertaLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
prezzoArticolo1.setOfferta(true);
|
||||
prezzoArticolo1.setDataScadenzaOfferta(getDataScadenzaOffertaLA());
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
double perc = getPercEffettiva();
|
||||
if (perc > 0.0D) {
|
||||
if (getListino().getFlgTipoL() == 0L) {
|
||||
double prezzobase = getArticolo().getPrezzoBase();
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(prezzobase);
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(prezzobase, getPercLA(), pps.getResult(), getPercLA1(), getPercLA2(), getPercLA3(),
|
||||
getAbbuonoPrezzoPubblicoLA());
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
if (getListino().getFlgTipoL() == 1L) {
|
||||
if (this.articolo.getCostoAcquistoUltimo() > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(getArticolo().getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo3 = new PrezzoArticolo(0.0D, 0.0D, pps.getResult(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo3;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
if (getListino().getFlgTipoL() == 2L) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(getArticolo().getPrezzoBase());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(0.0D, 0.0D, pps.getResult(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo = new PrezzoArticolo(getPrezzoLA(), 0.0D, getPrezzoLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo;
|
||||
}
|
||||
PrezzoArticolo pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return pa;
|
||||
}
|
||||
|
||||
public double getPercEffettiva() {
|
||||
if (isPercentualiSconto3()) {
|
||||
double perc = getPercLA1();
|
||||
if (perc > 0.0D &&
|
||||
getPercLA2() > 0.0D) {
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLA2());
|
||||
if (getPercLA3() > 0.0D)
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLA3());
|
||||
}
|
||||
return perc;
|
||||
}
|
||||
return getPercLA();
|
||||
}
|
||||
|
||||
public void setPrezzoLA(double prezzoLA) {
|
||||
this.prezzoLA = prezzoLA;
|
||||
}
|
||||
|
||||
public Articolo getArticolo() {
|
||||
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
|
||||
return this.articolo;
|
||||
}
|
||||
|
||||
public ArticoloVariante getArticoloVariante() {
|
||||
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
|
||||
return this.articoloVariante;
|
||||
}
|
||||
|
||||
public Listino getListino() {
|
||||
this.listino = (Listino)getSecondaryObject(this.listino, Listino.class, getId_listino());
|
||||
return this.listino;
|
||||
}
|
||||
|
||||
public void findByArticoloListino(long id_articolo, long id_listino) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + id_listino);
|
||||
wc.addWc("A.id_articolo=" + id_articolo);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
if (getId_listinoArticolo() == 0L) {
|
||||
setId_articolo(id_articolo);
|
||||
setId_listino(id_listino);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticolo(long id_articolo) {
|
||||
String s_Sql_Find = "select A.*, B.nome as b_nome from LISTINO_ARTICOLO AS A INNER JOIN ARTICOLO AS B ON A.id_articolo = B.id_articolo";
|
||||
String s_Sql_Order = " ORDER BY B.nome";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_articolo=" + id_articolo);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByArticoloVarianteListino(long id_articoloVariante, long id_listino) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("id_listino=" + id_listino);
|
||||
wc.addWc("id_articoloVariante=" + id_articoloVariante);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticoloVariante(long id_articoloVariante) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A INNER JOIN ARTICOLO_VARIANTE AS B ON A.id_articoloVariante = B.id_articoloVariante";
|
||||
String s_Sql_Order = " ORDER BY B.nomeV";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_articoloVariante=" + id_articoloVariante);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public double getPercLA() {
|
||||
return this.percLA;
|
||||
}
|
||||
|
||||
public void setPercLA(double percLA) {
|
||||
this.percLA = percLA;
|
||||
}
|
||||
|
||||
public Vectumerator findArticoliByListino(long id_listino, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + id_listino);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findArticoliVarianteByListino(long id_listino, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("id_listino=" + id_listino);
|
||||
wc.addWc("id_articoloVariante!=0");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public double getPrezzoOffertaLA() {
|
||||
return this.prezzoOffertaLA;
|
||||
}
|
||||
|
||||
public double getPrezzoOffertaIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoOffertaLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public void setPrezzoOffertaLA(double prezzoOfferta) {
|
||||
this.prezzoOffertaLA = prezzoOfferta;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaOffertaLA() {
|
||||
return this.dataScadenzaOffertaLA;
|
||||
}
|
||||
|
||||
public void setDataScadenzaOffertaLA(Date dataScadenzaOfferta) {
|
||||
this.dataScadenzaOffertaLA = dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public boolean isOffertaValida() {
|
||||
if (getDataScadenzaOffertaLA() == null || getDateDiff(getToday(), getDataScadenzaOffertaLA()) < 0L || getPrezzoOffertaLA() == 0.0D ||
|
||||
getPrezzoOffertaLA() >= getPrezzoLA())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getId_listino() == 0L || getId_articolo() == 0L)
|
||||
return new ResParm(false, "ERRORE! Impossibile salvare listino con riferimenti a listino o articolo nulli. id_listino=" +
|
||||
getId_listino() + " id_articolo=" + getId_articolo());
|
||||
ResParm rp = super.save();
|
||||
if (rp.getStatus()) {
|
||||
getArticolo().setDataScadenzaOfferta(getDataScadenzaOffertaLA());
|
||||
rp.append(getArticolo().superSave());
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public double getAbbuonoPrezzoPubblicoLA() {
|
||||
return this.abbuonoPrezzoPubblicoLA;
|
||||
}
|
||||
|
||||
public double getAbbuonoPrezzoPubblicoLA(Clifor l_clifor) {
|
||||
return this.abbuonoPrezzoPubblicoLA;
|
||||
}
|
||||
|
||||
public void setAbbuonoPrezzoPubblicoLA(double abbuonoPrezzoPubblico) {
|
||||
this.abbuonoPrezzoPubblicoLA = abbuonoPrezzoPubblico;
|
||||
}
|
||||
|
||||
public Date getDataCambiamentoPrezzoLA() {
|
||||
return this.dataCambiamentoPrezzoLA;
|
||||
}
|
||||
|
||||
public void setDataCambiamentoPrezzoLA(Date dataCambiamentoPrezzoLA) {
|
||||
this.dataCambiamentoPrezzoLA = dataCambiamentoPrezzoLA;
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws SQLException {
|
||||
if (getPrezzoConIvaLA() != 0.0D)
|
||||
setPrezzoLA(DBAdapter.scorporaIva(getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getPrezzoLA() != getPrezzoLADb())
|
||||
setDataCambiamentoPrezzoLA(getToday());
|
||||
double costoNetto = getArticolo().getCostoNetto();
|
||||
if (getDateDiff(getToday(), getDataScadenzaOffertaLA()) >= 0L && getPercScontoOffertaLA() > 0.0D && costoNetto > 0.0D) {
|
||||
double percRicaricoOfferta = getArticolo().getPercRicarico() - getPercScontoOffertaLA();
|
||||
if (percRicaricoOfferta < getParm("CC_RICARICO_MINIMO_OFFERTE").getNumero())
|
||||
percRicaricoOfferta = getParm("CC_RICARICO_MINIMO_OFFERTE").getNumero();
|
||||
DoubleOperator prNetto = new DoubleOperator(costoNetto);
|
||||
prNetto.multiply(percRicaricoOfferta + 100.0D);
|
||||
prNetto.divide(100.0F);
|
||||
prNetto.setScale(2, 5);
|
||||
double prPubblicoConIva = conIva(prNetto.getResult(), (double)getArticolo().getIva().getAliquota());
|
||||
if (prPubblicoConIva >= getParm("CC_ARROTONDA_PREZZO_A_EURO_SOPRA").getNumero()) {
|
||||
prPubblicoConIva = arrotonda(prPubblicoConIva, 1.0D);
|
||||
} else {
|
||||
prPubblicoConIva = arrotonda(prPubblicoConIva, getParm("CC_ARROTONDA_DECIMALE_PER_PREZZI_BASSI").getNumero());
|
||||
}
|
||||
setPrezzoOffertaLA(scorporaIva(prPubblicoConIva, (double)getArticolo().getIva().getAliquota()));
|
||||
}
|
||||
super.prepareSave(ps);
|
||||
}
|
||||
|
||||
protected void initFields() {
|
||||
super.initFields();
|
||||
setPrezzoLADb(0.0D);
|
||||
}
|
||||
|
||||
protected void fillFields(ResultSet rst) {
|
||||
super.fillFields(rst);
|
||||
setPrezzoLADb(getPrezzoLA());
|
||||
}
|
||||
|
||||
public double getPrezzoLADb() {
|
||||
return this.prezzoLADb;
|
||||
}
|
||||
|
||||
public void setPrezzoLADb(double prezzLADb) {
|
||||
this.prezzoLADb = prezzLADb;
|
||||
}
|
||||
|
||||
public double getPrezzoScontatoIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoScontatoLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public double getPrezzoConIvaLA() {
|
||||
return this.prezzoConIvaLA;
|
||||
}
|
||||
|
||||
public void setPrezzoConIvaLA(double prezzoConIvaLA) {
|
||||
this.prezzoConIvaLA = prezzoConIvaLA;
|
||||
}
|
||||
|
||||
public boolean hasStessiValori(ListinoArticolo la) {
|
||||
if (la.getPrezzoConIvaLA() != 0.0D && la.getPrezzoLA() == 0.0D)
|
||||
la.setPrezzoLA(DBAdapter.scorporaIva(la.getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getPrezzoConIvaLA() != 0.0D && getPrezzoLA() == 0.0D)
|
||||
setPrezzoLA(DBAdapter.scorporaIva(getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (la.getPrezzoLA() != getPrezzoLA() || la.getPercLA() != getPercLA() || la.getPercLA1() != getPercLA1() ||
|
||||
la.getPercLA2() != getPercLA2() || la.getPercLA3() != getPercLA3() || la.getPrezzoOffertaLA() != getPrezzoOffertaLA() ||
|
||||
la.getDataScadenzaOffertaLA() != getDataScadenzaOffertaLA() ||
|
||||
la.getAbbuonoPrezzoPubblicoLA() != getAbbuonoPrezzoPubblicoLA())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescrizionePercentuale() {
|
||||
if (isPercentualiSconto3())
|
||||
return getNf2().format(getPercLA1()) + " + " + getNf2().format(getPercLA1()) + " + " + getNf2().format(getPercLA2()) + " %";
|
||||
return getNf2().format(getPercLA()) + " %";
|
||||
}
|
||||
|
||||
public double getPercLA1() {
|
||||
return this.percLA1;
|
||||
}
|
||||
|
||||
public void setPercLA1(double percLA1) {
|
||||
this.percLA1 = percLA1;
|
||||
}
|
||||
|
||||
public double getPercLA3() {
|
||||
return this.percLA3;
|
||||
}
|
||||
|
||||
public void setPercLA3(double percLA3) {
|
||||
this.percLA3 = percLA3;
|
||||
}
|
||||
|
||||
public double getPercLA2() {
|
||||
return this.percLA2;
|
||||
}
|
||||
|
||||
public void setPercLA2(double percLA2) {
|
||||
this.percLA2 = percLA2;
|
||||
}
|
||||
|
||||
public double getPercScontoOffertaLA() {
|
||||
return this.percScontoOffertaLA;
|
||||
}
|
||||
|
||||
public void setPercScontoOffertaLA(double percScontoOffertaLA) {
|
||||
this.percScontoOffertaLA = percScontoOffertaLA;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,446 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.DoubleOperator;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ListinoArticoloCOPIA extends _AnagAdapter {
|
||||
private long id_listinoArticolo;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private long id_articolo;
|
||||
|
||||
private long id_articoloVariante;
|
||||
|
||||
private double prezzoLA;
|
||||
|
||||
private Listino listino;
|
||||
|
||||
private Articolo articolo;
|
||||
|
||||
private ArticoloVariante articoloVariante;
|
||||
|
||||
private double percLA;
|
||||
|
||||
private double prezzoOffertaLA;
|
||||
|
||||
private Date dataScadenzaOffertaLA;
|
||||
|
||||
private double abbuonoPrezzoPubblicoLA;
|
||||
|
||||
private Date dataCambiamentoPrezzoLA;
|
||||
|
||||
private double prezzoLADb;
|
||||
|
||||
private double prezzoConIvaLA;
|
||||
|
||||
private double percLA1;
|
||||
|
||||
private double percLA3;
|
||||
|
||||
private double percLA2;
|
||||
|
||||
public ListinoArticoloCOPIA(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoArticoloCOPIA() {}
|
||||
|
||||
public long getId_listinoArticolo() {
|
||||
return this.id_listinoArticolo;
|
||||
}
|
||||
|
||||
public void setId_listinoArticolo(long id_listinoArticolo) {
|
||||
this.id_listinoArticolo = id_listinoArticolo;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public void setId_listino(long id_listino) {
|
||||
this.id_listino = id_listino;
|
||||
}
|
||||
|
||||
public long getId_articolo() {
|
||||
return this.id_articolo;
|
||||
}
|
||||
|
||||
public void setId_articolo(long id_articolo) {
|
||||
this.id_articolo = id_articolo;
|
||||
}
|
||||
|
||||
public long getId_articoloVariante() {
|
||||
return this.id_articoloVariante;
|
||||
}
|
||||
|
||||
public void setId_articoloVariante(long id_articoloVariante) {
|
||||
this.id_articoloVariante = id_articoloVariante;
|
||||
}
|
||||
|
||||
public double getPrezzoLA() {
|
||||
if (getArticolo().getFlgNegativo() == 1L)
|
||||
return -Math.abs(this.prezzoLA);
|
||||
return Math.abs(this.prezzoLA);
|
||||
}
|
||||
|
||||
public double getPrezzoIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoFinaleIvaLA() {
|
||||
return getPrezzoFinaleLA().conIva((double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public double getPrezzoIvaAbbuonoLA() {
|
||||
DoubleOperator dp = new DoubleOperator(DBAdapter.conIva(getPrezzoLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getListino().getFlgTipoL() == 99L) {
|
||||
dp.subtract(getAbbuonoPrezzoPubblicoLA());
|
||||
dp.setScale(2, 5);
|
||||
}
|
||||
return dp.getResult();
|
||||
}
|
||||
|
||||
public double getPrezzoScontatoLA() {
|
||||
double perc = getPercEffettiva();
|
||||
if (perc != 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(getPrezzoLA());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
return pps.getResult();
|
||||
}
|
||||
return getPrezzoLA();
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoFinaleLA() {
|
||||
if (getId_listino() > 0L) {
|
||||
if (getListino().getFlgTipoL() == 99L) {
|
||||
if (isOffertaValida()) {
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(getPrezzoOffertaLA(), 0.0D, getPrezzoOffertaLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
prezzoArticolo2.setOfferta(true);
|
||||
prezzoArticolo2.setDataScadenzaOfferta(getDataScadenzaOffertaLA());
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(getPrezzoLA(), getPercLA(), getPrezzoScontatoLA(), getPercLA1(), getPercLA2(), getPercLA3(),
|
||||
getAbbuonoPrezzoPubblicoLA());
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
if (isOffertaValida()) {
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(getPrezzoOffertaLA(), 0.0D, getPrezzoOffertaLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
prezzoArticolo1.setOfferta(true);
|
||||
prezzoArticolo1.setDataScadenzaOfferta(getDataScadenzaOffertaLA());
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
double perc = getPercEffettiva();
|
||||
if (perc > 0.0D) {
|
||||
if (getListino().getFlgTipoL() == 0L) {
|
||||
double prezzobase = getArticolo().getPrezzoBase();
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(prezzobase);
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(prezzobase, getPercLA(), pps.getResult(), getPercLA1(), getPercLA2(), getPercLA3(), getAbbuonoPrezzoPubblicoLA());
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
if (getListino().getFlgTipoL() == 0L) {
|
||||
if (this.articolo.getCostoAcquistoUltimo() > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(getArticolo().getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo3 = new PrezzoArticolo(pps.getResult(), 0.0D, pps.getResult(), getPercLA1(), getPercLA2(), getPercLA3(), getAbbuonoPrezzoPubblicoLA());
|
||||
return prezzoArticolo3;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo = new PrezzoArticolo(getPrezzoLA(), 0.0D, getPrezzoLA(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo;
|
||||
}
|
||||
PrezzoArticolo pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return pa;
|
||||
}
|
||||
|
||||
public double getPercEffettiva() {
|
||||
if (isPercentualiSconto3()) {
|
||||
double perc = getPercLA1();
|
||||
if (perc > 0.0D &&
|
||||
getPercLA2() > 0.0D) {
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLA2());
|
||||
if (getPercLA3() > 0.0D)
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLA3());
|
||||
}
|
||||
return perc;
|
||||
}
|
||||
return getPercLA();
|
||||
}
|
||||
|
||||
public void setPrezzoLA(double prezzoLA) {
|
||||
this.prezzoLA = prezzoLA;
|
||||
}
|
||||
|
||||
public Articolo getArticolo() {
|
||||
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
|
||||
return this.articolo;
|
||||
}
|
||||
|
||||
public ArticoloVariante getArticoloVariante() {
|
||||
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
|
||||
return this.articoloVariante;
|
||||
}
|
||||
|
||||
public Listino getListino() {
|
||||
this.listino = (Listino)getSecondaryObject(this.listino, Listino.class, getId_listino());
|
||||
return this.listino;
|
||||
}
|
||||
|
||||
public void findByArticoloListino(long id_articolo, long id_listino) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + id_listino);
|
||||
wc.addWc("A.id_articolo=" + id_articolo);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticolo(long id_articolo) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A INNER JOIN ARTICOLO AS B ON A.id_articolo = B.id_articolo";
|
||||
String s_Sql_Order = " ORDER BY B.nome";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_articolo=" + id_articolo);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByArticoloVarianteListino(long id_articoloVariante, long id_listino) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("id_listino=" + id_listino);
|
||||
wc.addWc("id_articoloVariante=" + id_articoloVariante);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticoloVariante(long id_articoloVariante) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A INNER JOIN ARTICOLO_VARIANTE AS B ON A.id_articoloVariante = B.id_articoloVariante";
|
||||
String s_Sql_Order = " ORDER BY B.nomeV";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_articoloVariante=" + id_articoloVariante);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public double getPercLA() {
|
||||
return this.percLA;
|
||||
}
|
||||
|
||||
public void setPercLA(double percLA) {
|
||||
this.percLA = percLA;
|
||||
}
|
||||
|
||||
public Vectumerator findArticoliByListino(long id_listino, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + id_listino);
|
||||
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findArticoliVarianteByListino(long id_listino, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("id_listino=" + id_listino);
|
||||
wc.addWc("id_articoloVariante!=0");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public double getPrezzoOffertaLA() {
|
||||
return this.prezzoOffertaLA;
|
||||
}
|
||||
|
||||
public double getPrezzoOffertaIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoOffertaLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public void setPrezzoOffertaLA(double prezzoOfferta) {
|
||||
this.prezzoOffertaLA = prezzoOfferta;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaOffertaLA() {
|
||||
return this.dataScadenzaOffertaLA;
|
||||
}
|
||||
|
||||
public void setDataScadenzaOffertaLA(Date dataScadenzaOfferta) {
|
||||
this.dataScadenzaOffertaLA = dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public boolean isOffertaValida() {
|
||||
if (getDateDiff(getToday(), getDataScadenzaOffertaLA()) < 0L || getPrezzoOffertaLA() == 0.0D)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getId_listino() == 0L || getId_articolo() == 0L)
|
||||
return new ResParm(false, "ERRORE! Impossibile salvare listino con riferimenti a listino o articolo nulli. id_listino=" +
|
||||
getId_listino() + " id_articolo=" + getId_articolo());
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public double getAbbuonoPrezzoPubblicoLA() {
|
||||
return this.abbuonoPrezzoPubblicoLA;
|
||||
}
|
||||
|
||||
public double getAbbuonoPrezzoPubblicoLA(Clifor l_clifor) {
|
||||
return this.abbuonoPrezzoPubblicoLA;
|
||||
}
|
||||
|
||||
public void setAbbuonoPrezzoPubblicoLA(double abbuonoPrezzoPubblico) {
|
||||
this.abbuonoPrezzoPubblicoLA = abbuonoPrezzoPubblico;
|
||||
}
|
||||
|
||||
public Date getDataCambiamentoPrezzoLA() {
|
||||
return this.dataCambiamentoPrezzoLA;
|
||||
}
|
||||
|
||||
public void setDataCambiamentoPrezzoLA(Date dataCambiamentoPrezzoLA) {
|
||||
this.dataCambiamentoPrezzoLA = dataCambiamentoPrezzoLA;
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws SQLException {
|
||||
if (getPrezzoConIvaLA() != 0.0D)
|
||||
setPrezzoLA(DBAdapter.scorporaIva(getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getPrezzoLA() != getPrezzoLADb())
|
||||
setDataCambiamentoPrezzoLA(getToday());
|
||||
super.prepareSave(ps);
|
||||
}
|
||||
|
||||
protected void initFields() {
|
||||
super.initFields();
|
||||
setPrezzoLADb(0.0D);
|
||||
}
|
||||
|
||||
protected void fillFields(ResultSet rst) {
|
||||
super.fillFields(rst);
|
||||
setPrezzoLADb(getPrezzoLA());
|
||||
}
|
||||
|
||||
public double getPrezzoLADb() {
|
||||
return this.prezzoLADb;
|
||||
}
|
||||
|
||||
public void setPrezzoLADb(double prezzLADb) {
|
||||
this.prezzoLADb = prezzLADb;
|
||||
}
|
||||
|
||||
public double getPrezzoScontatoIvaLA() {
|
||||
return DBAdapter.conIva(getPrezzoScontatoLA(), (double)getArticolo().getIva().getAliquota());
|
||||
}
|
||||
|
||||
public double getPrezzoConIvaLA() {
|
||||
return this.prezzoConIvaLA;
|
||||
}
|
||||
|
||||
public void setPrezzoConIvaLA(double prezzoConIvaLA) {
|
||||
this.prezzoConIvaLA = prezzoConIvaLA;
|
||||
}
|
||||
|
||||
public boolean hasStessiValori(ListinoArticoloCOPIA la) {
|
||||
if (la.getPrezzoConIvaLA() != 0.0D && la.getPrezzoLA() == 0.0D)
|
||||
la.setPrezzoLA(DBAdapter.scorporaIva(la.getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (getPrezzoConIvaLA() != 0.0D && getPrezzoLA() == 0.0D)
|
||||
setPrezzoLA(DBAdapter.scorporaIva(getPrezzoConIvaLA(), (double)getArticolo().getIva().getAliquota()));
|
||||
if (la.getPrezzoLA() != getPrezzoLA() || la.getPercLA() != getPercLA() || la.getPercLA1() != getPercLA1() ||
|
||||
la.getPercLA2() != getPercLA2() || la.getPercLA3() != getPercLA3() || la.getPrezzoOffertaLA() != getPrezzoOffertaLA() ||
|
||||
la.getDataScadenzaOffertaLA() != getDataScadenzaOffertaLA() ||
|
||||
la.getAbbuonoPrezzoPubblicoLA() != getAbbuonoPrezzoPubblicoLA())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescrizionePercentuale() {
|
||||
if (isPercentualiSconto3())
|
||||
return getNf2().format(getPercLA1()) + " + " + getNf2().format(getPercLA1()) + " + " + getNf2().format(getPercLA2()) + " %";
|
||||
return getNf2().format(getPercLA()) + " %";
|
||||
}
|
||||
|
||||
public double getPercLA1() {
|
||||
return this.percLA1;
|
||||
}
|
||||
|
||||
public void setPercLA1(double percLA1) {
|
||||
this.percLA1 = percLA1;
|
||||
}
|
||||
|
||||
public double getPercLA3() {
|
||||
return this.percLA3;
|
||||
}
|
||||
|
||||
public void setPercLA3(double percLA3) {
|
||||
this.percLA3 = percLA3;
|
||||
}
|
||||
|
||||
public double getPercLA2() {
|
||||
return this.percLA2;
|
||||
}
|
||||
|
||||
public void setPercLA2(double percLA2) {
|
||||
this.percLA2 = percLA2;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.ArticoloVariante;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.sql.Date;
|
||||
|
||||
public class ListinoArticoloCR extends CRAdapter {
|
||||
private long id_listinoArticolo;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private long id_articolo;
|
||||
|
||||
private long id_articoloVariante;
|
||||
|
||||
private double prezzoLA;
|
||||
|
||||
private Listino listino;
|
||||
|
||||
private Articolo articolo;
|
||||
|
||||
private ArticoloVariante articoloVariante;
|
||||
|
||||
private Date dataScadenzaOfferta;
|
||||
|
||||
private double prezzoOfferta;
|
||||
|
||||
public ListinoArticoloCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoArticoloCR() {}
|
||||
|
||||
public long getId_listinoArticolo() {
|
||||
return this.id_listinoArticolo;
|
||||
}
|
||||
|
||||
public void setId_listinoArticolo(long id_listinoArticolo) {
|
||||
this.id_listinoArticolo = id_listinoArticolo;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public void setId_listino(long id_listino) {
|
||||
this.id_listino = id_listino;
|
||||
}
|
||||
|
||||
public long getId_articolo() {
|
||||
return this.id_articolo;
|
||||
}
|
||||
|
||||
public void setId_articolo(long id_articolo) {
|
||||
this.id_articolo = id_articolo;
|
||||
}
|
||||
|
||||
public long getId_articoloVariante() {
|
||||
return this.id_articoloVariante;
|
||||
}
|
||||
|
||||
public void setId_articoloVariante(long id_articoloVariante) {
|
||||
this.id_articoloVariante = id_articoloVariante;
|
||||
}
|
||||
|
||||
public double getPrezzoLA() {
|
||||
return this.prezzoLA;
|
||||
}
|
||||
|
||||
public void setPrezzoLA(double prezzoLA) {
|
||||
this.prezzoLA = prezzoLA;
|
||||
}
|
||||
|
||||
public Articolo getArticolo() {
|
||||
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
|
||||
getId_articolo());
|
||||
return this.articolo;
|
||||
}
|
||||
|
||||
public ArticoloVariante getArticoloVariante() {
|
||||
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
|
||||
|
||||
getId_articoloVariante());
|
||||
return this.articoloVariante;
|
||||
}
|
||||
|
||||
public Listino getListino() {
|
||||
this.listino = (Listino)getSecondaryObject(this.listino, Listino.class,
|
||||
getId_listino());
|
||||
return this.listino;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaOfferta() {
|
||||
return this.dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public void setDataScadenzaOfferta(Date dataScadenzaOfferta) {
|
||||
this.dataScadenzaOfferta = dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public double getPrezzoOfferta() {
|
||||
return this.prezzoOfferta;
|
||||
}
|
||||
|
||||
public void setPrezzoOfferta(double prezzoOfferta) {
|
||||
this.prezzoOfferta = prezzoOfferta;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class ListinoCR extends CRAdapter {
|
||||
private long id_listino;
|
||||
|
||||
private long flgTipoL;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private double percL;
|
||||
|
||||
private Timestamp lastUpdTmst;
|
||||
|
||||
private long lastUpdId_user;
|
||||
|
||||
public ListinoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoCR() {}
|
||||
|
||||
public void setId_listino(long newId_listino) {
|
||||
this.id_listino = newId_listino;
|
||||
}
|
||||
|
||||
public void setFlgTipoL(long newFlgTipo) {
|
||||
this.flgTipoL = newFlgTipo;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setPercL(double newPercL) {
|
||||
this.percL = newPercL;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
|
||||
this.lastUpdTmst = newLastUpdTmst;
|
||||
}
|
||||
|
||||
public void setLastUpdId_user(long newLastUpdId_user) {
|
||||
this.lastUpdId_user = newLastUpdId_user;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public long getFlgTipoL() {
|
||||
return this.flgTipoL;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public double getPercL() {
|
||||
return this.percL;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
|
||||
public long getLastUpdId_user() {
|
||||
return this.lastUpdId_user;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,315 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Articolo;
|
||||
import it.acxent.art.Tipo;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.DoubleOperator;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ListinoTipo extends _AnagAdapter implements Serializable {
|
||||
private long id_listinoTipo;
|
||||
|
||||
private long flgTipoLT;
|
||||
|
||||
private double percLT;
|
||||
|
||||
private long id_tipo;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private Tipo tipo;
|
||||
|
||||
private Listino listino;
|
||||
|
||||
private String indiciTipo;
|
||||
|
||||
private double prezzoLT;
|
||||
|
||||
private double percLT2;
|
||||
|
||||
private double percLT3;
|
||||
|
||||
private double percLT1;
|
||||
|
||||
public ListinoTipo(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoTipo() {}
|
||||
|
||||
public void setId_listinoTipo(long newId_listinoTipo) {
|
||||
this.id_listinoTipo = newId_listinoTipo;
|
||||
}
|
||||
|
||||
public void setFlgTipoLT(long newFlgTipoLT) {
|
||||
this.flgTipoLT = newFlgTipoLT;
|
||||
}
|
||||
|
||||
public void setPercLT(double newPercLT) {
|
||||
this.percLT = newPercLT;
|
||||
}
|
||||
|
||||
public void setId_tipo(long newId_tipo) {
|
||||
this.id_tipo = newId_tipo;
|
||||
setTipo(null);
|
||||
}
|
||||
|
||||
public void setId_listino(long newId_listino) {
|
||||
this.id_listino = newId_listino;
|
||||
setListino(null);
|
||||
}
|
||||
|
||||
public long getId_listinoTipo() {
|
||||
return this.id_listinoTipo;
|
||||
}
|
||||
|
||||
public long getFlgTipoLT() {
|
||||
return this.flgTipoLT;
|
||||
}
|
||||
|
||||
public double getPercLT() {
|
||||
return this.percLT;
|
||||
}
|
||||
|
||||
public double getPercEffettiva() {
|
||||
if (isPercentualiSconto3()) {
|
||||
double perc = getPercLT1();
|
||||
if (perc > 0.0D &&
|
||||
getPercLT2() > 0.0D) {
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLT2());
|
||||
if (getPercLT3() > 0.0D)
|
||||
perc = Listino.getSommaPercentuali(perc, getPercLT3());
|
||||
}
|
||||
return perc;
|
||||
}
|
||||
return getPercLT();
|
||||
}
|
||||
|
||||
public long getId_tipo() {
|
||||
return this.id_tipo;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public void setTipo(Tipo newTipo) {
|
||||
this.tipo = newTipo;
|
||||
}
|
||||
|
||||
public Tipo getTipo() {
|
||||
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class, getId_tipo());
|
||||
return this.tipo;
|
||||
}
|
||||
|
||||
public void setListino(Listino newListino) {
|
||||
this.listino = newListino;
|
||||
}
|
||||
|
||||
public Listino getListino() {
|
||||
this.listino = (Listino)getSecondaryObject(this.listino, Listino.class, getId_listino());
|
||||
return this.listino;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(ListinoTipoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_TIPO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByListino(long l_id_listino, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_TIPO AS A ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + l_id_listino);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getIndiciTipo() {
|
||||
return (this.indiciTipo == null) ? "" : this.indiciTipo;
|
||||
}
|
||||
|
||||
public void setIndiciTipo(String indiciTipo) {
|
||||
this.indiciTipo = indiciTipo;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
setIndiciTipo(calcolaIndiciTipo());
|
||||
ResParm rp = super.save();
|
||||
return rp;
|
||||
}
|
||||
|
||||
protected String calcolaIndiciTipo() {
|
||||
StringBuffer idx = new StringBuffer(":");
|
||||
idx.append(calcolaIndiciTipoR(getTipo()));
|
||||
idx.append(":");
|
||||
return idx.toString();
|
||||
}
|
||||
|
||||
private StringBuffer calcolaIndiciTipoR(Tipo l_tipo) {
|
||||
StringBuffer idx = new StringBuffer();
|
||||
Vectumerator<Tipo> vec = l_tipo.findFigli(0, 0);
|
||||
if (vec.hasMoreElements()) {
|
||||
boolean first = true;
|
||||
while (vec.hasMoreElements()) {
|
||||
Tipo row = (Tipo)vec.nextElement();
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
idx.insert(0, ":");
|
||||
}
|
||||
idx.insert(0, (CharSequence)calcolaIndiciTipoR(row));
|
||||
}
|
||||
idx.insert(0, ":");
|
||||
idx.insert(0, l_tipo.getId_tipo());
|
||||
} else {
|
||||
idx = new StringBuffer(String.valueOf(l_tipo.getId_tipo()));
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
public static final String getTipoListino(long l_flgTipo) {
|
||||
return Listino.getTipoL(l_flgTipo);
|
||||
}
|
||||
|
||||
public void findByCliforTipo(long l_id_clifor, long l_id_tipo) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_PERS AS A , TIPO AS B";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_tipo=B.id_tipo");
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
wc.addWc(" B.indici like'%:" + l_id_tipo + ":%'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findByListinoTipo(long l_id_listino, long l_id_tipo) {
|
||||
String s_Sql_Find = "select A.* from LISTINO_TIPO AS A ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + l_id_listino);
|
||||
wc.addWc(" A.indiciTipo like'%:" + l_id_tipo + ":%'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public double getPercLT1() {
|
||||
return this.percLT1;
|
||||
}
|
||||
|
||||
public void setPercLT1(double percLT1) {
|
||||
this.percLT1 = percLT1;
|
||||
}
|
||||
|
||||
public double getPercLT2() {
|
||||
return this.percLT2;
|
||||
}
|
||||
|
||||
public void setPercLT2(double percLT2) {
|
||||
this.percLT2 = percLT2;
|
||||
}
|
||||
|
||||
public double getPercLT3() {
|
||||
return this.percLT3;
|
||||
}
|
||||
|
||||
public void setPercLT3(double percLT3) {
|
||||
this.percLT3 = percLT3;
|
||||
}
|
||||
|
||||
public String getDescrizionePercentuale() {
|
||||
if (isPercentualiSconto3())
|
||||
return getNf2().format(getPercLT1()) + " + " + getNf2().format(getPercLT1()) + " + " + getNf2().format(getPercLT2()) + " %";
|
||||
return getNf2().format(getPercLT()) + " %";
|
||||
}
|
||||
|
||||
public double getPrezzoLT() {
|
||||
return this.prezzoLT;
|
||||
}
|
||||
|
||||
public void setPrezzoLT(double prezzoLT) {
|
||||
this.prezzoLT = prezzoLT;
|
||||
}
|
||||
|
||||
public PrezzoArticolo getPrezzoFinaleLT(Articolo articolo) {
|
||||
if (getId_listinoTipo() > 0L) {
|
||||
if (getListino().getFlgTipoL() == 99L) {
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
double perc = getPercEffettiva();
|
||||
if (perc > 0.0D) {
|
||||
if (getListino().getFlgTipoL() == 0L) {
|
||||
double prezzobase = articolo.getPrezzoBase();
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.subtract(perc);
|
||||
pps.multiply(prezzobase);
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(prezzobase, getPercLT(), pps.getResult(), getPercLT1(), getPercLT2(), getPercLT3(), 0.0D);
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
if (getListino().getFlgTipoL() == 1L) {
|
||||
if (articolo.getCostoAcquistoUltimo() > 0.0D) {
|
||||
DoubleOperator pps = new DoubleOperator(100.0F);
|
||||
pps.setScale(4, 5);
|
||||
pps.add(perc);
|
||||
pps.multiply(articolo.getCostoAcquistoUltimo());
|
||||
pps.divide(100.0F);
|
||||
pps.setScale(2, 5);
|
||||
PrezzoArticolo prezzoArticolo3 = new PrezzoArticolo(pps.getResult(), 0.0D, pps.getResult(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo3;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo2 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo2;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo1 = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo1;
|
||||
}
|
||||
PrezzoArticolo prezzoArticolo = new PrezzoArticolo(getPrezzoLT(), 0.0D, getPrezzoLT(), 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return prezzoArticolo;
|
||||
}
|
||||
PrezzoArticolo pa = new PrezzoArticolo(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
return pa;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.art.Tipo;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class ListinoTipoCR extends CRAdapter {
|
||||
private long id_listinoTipo;
|
||||
|
||||
private long flgTipoLT;
|
||||
|
||||
private double percLT;
|
||||
|
||||
private long id_tipo;
|
||||
|
||||
private long id_listino;
|
||||
|
||||
private Tipo tipo;
|
||||
|
||||
private Listino listino;
|
||||
|
||||
public ListinoTipoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ListinoTipoCR() {}
|
||||
|
||||
public void setId_listinoTipo(long newId_listinoTipo) {
|
||||
this.id_listinoTipo = newId_listinoTipo;
|
||||
}
|
||||
|
||||
public void setFlgTipoLT(long newFlgTipoLT) {
|
||||
this.flgTipoLT = newFlgTipoLT;
|
||||
}
|
||||
|
||||
public void setPercLT(double newPercLT) {
|
||||
this.percLT = newPercLT;
|
||||
}
|
||||
|
||||
public void setId_tipo(long newId_tipo) {
|
||||
this.id_tipo = newId_tipo;
|
||||
setTipo(null);
|
||||
}
|
||||
|
||||
public void setId_listino(long newId_listino) {
|
||||
this.id_listino = newId_listino;
|
||||
setListino(null);
|
||||
}
|
||||
|
||||
public long getId_listinoTipo() {
|
||||
return this.id_listinoTipo;
|
||||
}
|
||||
|
||||
public long getFlgTipoLT() {
|
||||
return this.flgTipoLT;
|
||||
}
|
||||
|
||||
public double getPercLT() {
|
||||
return this.percLT;
|
||||
}
|
||||
|
||||
public long getId_tipo() {
|
||||
return this.id_tipo;
|
||||
}
|
||||
|
||||
public long getId_listino() {
|
||||
return this.id_listino;
|
||||
}
|
||||
|
||||
public void setTipo(Tipo newTipo) {
|
||||
this.tipo = newTipo;
|
||||
}
|
||||
|
||||
public Tipo getTipo() {
|
||||
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class,
|
||||
|
||||
getId_tipo());
|
||||
return this.tipo;
|
||||
}
|
||||
|
||||
public void setListino(Listino newListino) {
|
||||
this.listino = newListino;
|
||||
}
|
||||
|
||||
public Listino getListino() {
|
||||
this.listino = (Listino)getSecondaryObject(this.listino, Listino.class,
|
||||
|
||||
getId_listino());
|
||||
return this.listino;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,299 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.contab.CausaleMagazzino;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MagFisico extends _AnagAdapter implements Serializable {
|
||||
private long id_magFisico;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private long flgFineLavorazione;
|
||||
|
||||
public static final long TIPO_MAGAZZINO_TUTTI = 0L;
|
||||
|
||||
public static final long TIPO_MAGAZZINO_INTERNO = 1L;
|
||||
|
||||
public static final long TIPO_MAGAZZINO_LAVORAZIONE = 2L;
|
||||
|
||||
public static final long TIPO_MAGAZZINO_ORDINATO_A_FORNITORI = 3L;
|
||||
|
||||
public static final long FINE_LAVORAZIONE_NO = 0L;
|
||||
|
||||
public static final long FINE_LAVORAZIONE_SI = 1L;
|
||||
|
||||
public MagFisico(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Vectumerator<MagFisico> findByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = " order by descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public MagFisico() {}
|
||||
|
||||
public void setId_magFisico(long newId_magFisico) {
|
||||
this.id_magFisico = newId_magFisico;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public long getId_magFisico() {
|
||||
return this.id_magFisico;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(MagFisicoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return getTipo(getFlgTipo());
|
||||
}
|
||||
|
||||
public void setFlgTipo(long flgInterno) {
|
||||
this.flgTipo = flgInterno;
|
||||
}
|
||||
|
||||
public Vectumerator<MagFisico> findByTipo(long l_flgTipo) {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (l_flgTipo > 0L)
|
||||
wc.addWc(" A.flgTipo = " + l_flgTipo);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<MagFisico> findByCausalePartenza(CausaleMagazzino cm) {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (cm.getId_magFisicoPartenza() > 0L) {
|
||||
wc.addWc(" A.id_magFisico = " + cm.getId_magFisicoPartenza());
|
||||
} else if (cm.getFlgPartenzaInterno() == 1L && cm.getFlgPartenzaLavorazione() == 1L) {
|
||||
wc.addWc("(A.flgTipo = 1 or A.flgTipo=2)");
|
||||
} else if (cm.getFlgPartenzaInterno() == 1L && cm.getFlgPartenzaLavorazione() == 0L) {
|
||||
wc.addWc("A.flgTipo = 1");
|
||||
} else if (cm.getFlgPartenzaInterno() == 0L && cm.getFlgPartenzaLavorazione() == 1L) {
|
||||
wc.addWc("A.flgTipo=2");
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<MagFisico> findByCausaleArrivo(CausaleMagazzino cm) {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (cm.getId_magFisicoArrivo() > 0L) {
|
||||
wc.addWc(" A.id_magFisico = " + cm.getId_magFisicoArrivo());
|
||||
} else if (cm.getFlgArrivoInterno() == 1L && cm.getFlgArrivoLavorazione() == 1L) {
|
||||
wc.addWc("(A.flgTipo = 1 or A.flgTipo=2)");
|
||||
} else if (cm.getFlgArrivoInterno() == 1L && cm.getFlgArrivoLavorazione() == 0L) {
|
||||
wc.addWc("A.flgTipo = 1");
|
||||
} else if (cm.getFlgArrivoInterno() == 0L && cm.getFlgArrivoLavorazione() == 1L) {
|
||||
wc.addWc("A.flgTipo=2");
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isMagOrdinatoValorizzato() {
|
||||
String s_Sql_Find = "select COUNT(*) as tot from MAG_FISICO AS A ";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.flgTipo = 3");
|
||||
wc.addWc(" A.id_magFisico != " + getId_magFisico());
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
long tot = getCount(stmt, "tot");
|
||||
if (tot > 0L)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void findMagazzinoOrdinato() {
|
||||
String s_Sql_Find = "select A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.flgTipo = 3");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
if (getDescrizione().isEmpty())
|
||||
return "Nessuno";
|
||||
return getDescrizione() + " " + getDescrizione();
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
public static final String getTipo(long l_flgTipo) {
|
||||
switch ((int)l_flgTipo) {
|
||||
case 1:
|
||||
return "Interno";
|
||||
case 2:
|
||||
return "Lavorazione";
|
||||
case 3:
|
||||
return "Ordinato a Fornitori";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public long getFlgFineLavorazione() {
|
||||
return this.flgFineLavorazione;
|
||||
}
|
||||
|
||||
public void setFlgFineLavorazione(long flgFineLavorazione) {
|
||||
this.flgFineLavorazione = flgFineLavorazione;
|
||||
}
|
||||
|
||||
public static final String getFineLavorazione(long l_flgFineLavorazione) {
|
||||
switch ((int)l_flgFineLavorazione) {
|
||||
case 0:
|
||||
return "No (solo prelievo)";
|
||||
case 1:
|
||||
return "Si (scarico e prelievo)";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public String getFineLavorazione() {
|
||||
return getFineLavorazione(getFlgFineLavorazione());
|
||||
}
|
||||
|
||||
public String getHtmlTableHeaderInterni() {
|
||||
Vectumerator<MagFisico> vec = findByTipo(1L);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (vec.hasMoreElements()) {
|
||||
MagFisico row = (MagFisico)vec.nextElement();
|
||||
sb.append("<th>");
|
||||
sb.append(row.getDescrizione());
|
||||
sb.append("</th>");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getHtmlTableHeaderInterniVuoti() {
|
||||
Vectumerator<MagFisico> vec = findByTipo(1L);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<th");
|
||||
sb.append(" colspan='");
|
||||
sb.append(vec.getTotNumberOfRecords());
|
||||
sb.append("'> ");
|
||||
sb.append("</th>");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getDescrizioneTipo() {
|
||||
StringBuilder sb = new StringBuilder(getTipo());
|
||||
if (getFlgTipo() == 2L) {
|
||||
sb.append(" ");
|
||||
sb.append("-");
|
||||
sb.append(" ");
|
||||
sb.append("Fine lav: ");
|
||||
sb.append(getFineLavorazione());
|
||||
sb.append(" ");
|
||||
sb.append("-");
|
||||
sb.append(" ");
|
||||
sb.append(getClifor().getCognomeNome());
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class MagFisicoCR extends CRAdapter {
|
||||
private long id_magFisico;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
private long flgTipo;
|
||||
|
||||
private long flgFineLavorazione;
|
||||
|
||||
public MagFisicoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public MagFisicoCR() {}
|
||||
|
||||
public void setId_magFisico(long newId_magFisico) {
|
||||
this.id_magFisico = newId_magFisico;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setId_clifor(long newId_clifor) {
|
||||
this.id_clifor = newId_clifor;
|
||||
setClifor(null);
|
||||
}
|
||||
|
||||
public long getId_magFisico() {
|
||||
return this.id_magFisico;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor newClifor) {
|
||||
this.clifor = newClifor;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return MagFisico.getTipo(getFlgTipo());
|
||||
}
|
||||
|
||||
public long getFlgTipo() {
|
||||
return this.flgTipo;
|
||||
}
|
||||
|
||||
public void setFlgTipo(long flgTipo) {
|
||||
this.flgTipo = flgTipo;
|
||||
}
|
||||
|
||||
public String getFineLavorazione() {
|
||||
return MagFisico.getFineLavorazione(getFlgFineLavorazione());
|
||||
}
|
||||
|
||||
public static final String getFineLavorazione(long l_flgFineLavorazione) {
|
||||
return MagFisico.getFineLavorazione(l_flgFineLavorazione);
|
||||
}
|
||||
|
||||
public long getFlgFineLavorazione() {
|
||||
return this.flgFineLavorazione;
|
||||
}
|
||||
|
||||
public void setFlgFineLavorazione(long flgFineLavorazione) {
|
||||
this.flgFineLavorazione = flgFineLavorazione;
|
||||
}
|
||||
|
||||
public static final String getTipo(long l_flgTipo) {
|
||||
return MagFisico.getTipo(l_flgTipo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MeseEscluso extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 3164023737083124440L;
|
||||
|
||||
private long id_meseEscluso;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private long meseEscluso;
|
||||
|
||||
private long giornoEscluso;
|
||||
|
||||
private TipoPagamento tipoPagamento;
|
||||
|
||||
public MeseEscluso(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public MeseEscluso() {}
|
||||
|
||||
public void setId_meseEscluso(long newId_vettore) {
|
||||
this.id_meseEscluso = newId_vettore;
|
||||
}
|
||||
|
||||
public long getId_meseEscluso() {
|
||||
return this.id_meseEscluso;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<MeseEscluso> findByCR(MeseEsclusoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from MESE_ESCLUSO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
if (CR.getId_tipoPagamento() > 0L)
|
||||
wc.addWc(" A.id_tipoPagamento = " + CR.getId_tipoPagamento());
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setId_tipoPagamento(long id_tipoPagamento) {
|
||||
this.id_tipoPagamento = id_tipoPagamento;
|
||||
setTipoPagamento(null);
|
||||
}
|
||||
|
||||
public long getMeseEscluso() {
|
||||
return this.meseEscluso;
|
||||
}
|
||||
|
||||
public void setMeseEscluso(long meseEscluso) {
|
||||
this.meseEscluso = meseEscluso;
|
||||
}
|
||||
|
||||
public long getGiornoEscluso() {
|
||||
return this.giornoEscluso;
|
||||
}
|
||||
|
||||
public void setGiornoEscluso(long giornoEscluso) {
|
||||
this.giornoEscluso = giornoEscluso;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamento() {
|
||||
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class, getId_tipoPagamento());
|
||||
return this.tipoPagamento;
|
||||
}
|
||||
|
||||
public void setTipoPagamento(TipoPagamento tipoPagamento) {
|
||||
this.tipoPagamento = tipoPagamento;
|
||||
}
|
||||
|
||||
public String getDescrizioneMese() {
|
||||
return getDescrizioneMese(getMeseEscluso());
|
||||
}
|
||||
|
||||
public String getDescrizioneMese(long id_mese) {
|
||||
return MONTH_DES[(int)id_mese - 1];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class MeseEsclusoCR extends CRAdapter {
|
||||
private long id_meseEscluso;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private long meseEscluso;
|
||||
|
||||
private long giornoEscluso;
|
||||
|
||||
private TipoPagamento tipoPagamento;
|
||||
|
||||
public MeseEsclusoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public MeseEsclusoCR() {}
|
||||
|
||||
public void setId_meseEscluso(long newId_vettore) {
|
||||
this.id_meseEscluso = newId_vettore;
|
||||
}
|
||||
|
||||
public long getId_meseEscluso() {
|
||||
return this.id_meseEscluso;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setId_tipoPagamento(long id_tipoPagamento) {
|
||||
this.id_tipoPagamento = id_tipoPagamento;
|
||||
}
|
||||
|
||||
public long getMeseEscluso() {
|
||||
return this.meseEscluso;
|
||||
}
|
||||
|
||||
public void setMeseEscluso(long meseEscluso) {
|
||||
this.meseEscluso = meseEscluso;
|
||||
}
|
||||
|
||||
public long getGiornoEscluso() {
|
||||
return this.giornoEscluso;
|
||||
}
|
||||
|
||||
public void setGiornoEscluso(long giornoEscluso) {
|
||||
this.giornoEscluso = giornoEscluso;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamento() {
|
||||
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class, getId_tipoPagamento());
|
||||
return this.tipoPagamento;
|
||||
}
|
||||
|
||||
public void setTipoPagamento(TipoPagamento tipoPagamento) {
|
||||
this.tipoPagamento = tipoPagamento;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,402 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.cart.Cart;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Nazione extends _AnagAdapter implements Serializable {
|
||||
private static final String MESSAGGIO_IMPORTO_MINIMO = "messaggioImportoMinimo";
|
||||
|
||||
private static final long serialVersionUID = 1282454814109856597L;
|
||||
|
||||
public static final String CODICE_IT = "IT";
|
||||
|
||||
private String id_nazione;
|
||||
|
||||
private String lang;
|
||||
|
||||
private String descrizione_en;
|
||||
|
||||
private String descrizione_it;
|
||||
|
||||
private String codiceIstat;
|
||||
|
||||
private long flgCee;
|
||||
|
||||
private double costoSpedizione;
|
||||
|
||||
private long flgAttiva;
|
||||
|
||||
private String codice;
|
||||
|
||||
private String descrizioneInLingua;
|
||||
|
||||
private long flgGoogleMerchant;
|
||||
|
||||
private long flgPreventivoWww;
|
||||
|
||||
private long id_iva;
|
||||
|
||||
private Iva iva;
|
||||
|
||||
private double importoMinimoWww;
|
||||
|
||||
private String tag;
|
||||
|
||||
private String prefissoTel;
|
||||
|
||||
public Nazione(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Nazione() {}
|
||||
|
||||
public void setId_nazione(String newId_nazione) {
|
||||
this.id_nazione = newId_nazione;
|
||||
}
|
||||
|
||||
public void setLang(String newId_lingua) {
|
||||
this.lang = newId_lingua;
|
||||
}
|
||||
|
||||
public void setFlgCee(long newFlgCee) {
|
||||
this.flgCee = newFlgCee;
|
||||
}
|
||||
|
||||
public String getId_nazione() {
|
||||
return (this.id_nazione == null) ? "" : this.id_nazione.trim();
|
||||
}
|
||||
|
||||
public String getLang() {
|
||||
return (this.lang == null) ? "" : this.lang.trim();
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
return getDescrizione_it().trim();
|
||||
}
|
||||
|
||||
public long getFlgCee() {
|
||||
return this.flgCee;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(NazioneCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from NAZIONE AS A";
|
||||
String s_Sql_Order = " order by descrizione_it";
|
||||
if (CR.getLang().equals("en")) {
|
||||
s_Sql_Order = " order by descrizione_en";
|
||||
} else {
|
||||
s_Sql_Order = " order by descrizione_it";
|
||||
}
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.descrizione_it like '%" + token + "%' or A.descrizione_en like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
if (CR.getFlgAttivaS() == 0L) {
|
||||
wc.addWc("(A.flgAttiva is null or A.flgAttiva=0)");
|
||||
} else if (CR.getFlgAttivaS() == 1L) {
|
||||
wc.addWc("A.flgAttiva = 1");
|
||||
}
|
||||
if (CR.getFlgCeeS() == 0L) {
|
||||
wc.addWc("(A.flgCee is null or A.flgCee=0)");
|
||||
} else if (CR.getFlgCeeS() == 1L) {
|
||||
wc.addWc("A.flgCee = 1");
|
||||
}
|
||||
if (CR.getFlgGoogleMerchantS() == 0L) {
|
||||
wc.addWc("(A.flgGoogleMerchant is null or A.flgGoogleMerchant=0)");
|
||||
} else if (CR.getFlgGoogleMerchantS() == 1L) {
|
||||
wc.addWc("A.flgGoogleMerchant = 1");
|
||||
}
|
||||
if (CR.getFlgPreventivoWwwS() == 0L) {
|
||||
wc.addWc("(A.flgPreventivoWww is null or A.flgPreventivoWww=0)");
|
||||
} else if (CR.getFlgPreventivoWwwS() == 1L) {
|
||||
wc.addWc("A.flgPreventivoWww = 1");
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static final String getCee(long l_flgCee) {
|
||||
switch ((int)l_flgCee) {
|
||||
case -1:
|
||||
return " ";
|
||||
case 0:
|
||||
return "Extra Cee";
|
||||
case 1:
|
||||
return "Cee";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public String getCee() {
|
||||
return getCee(getFlgCee());
|
||||
}
|
||||
|
||||
public String getAttiva() {
|
||||
return (this.flgAttiva == 0L) ? "N" : "S";
|
||||
}
|
||||
|
||||
public double getCostoSpedizione() {
|
||||
return this.costoSpedizione;
|
||||
}
|
||||
|
||||
public void setCostoSpedizione(double costoSpedizione) {
|
||||
this.costoSpedizione = costoSpedizione;
|
||||
}
|
||||
|
||||
public long getFlgAttiva() {
|
||||
return this.flgAttiva;
|
||||
}
|
||||
|
||||
public void setFlgAttiva(long flgAttiva) {
|
||||
this.flgAttiva = flgAttiva;
|
||||
}
|
||||
|
||||
public String getCodice() {
|
||||
return (this.codice == null) ? getId_nazione() : this.codice.trim();
|
||||
}
|
||||
|
||||
public void setCodice(String codice) {
|
||||
this.codice = codice;
|
||||
}
|
||||
|
||||
public String getCodiceIstat() {
|
||||
return (this.codiceIstat == null) ? "" : this.codiceIstat.trim();
|
||||
}
|
||||
|
||||
public void setCodiceIstat(String codiceIstat) {
|
||||
this.codiceIstat = codiceIstat;
|
||||
}
|
||||
|
||||
public String getDescrizione(String lang) {
|
||||
if (lang.equals(Locale.ITALIAN.getLanguage()))
|
||||
return getDescrizione_it();
|
||||
return getDescrizione_en();
|
||||
}
|
||||
|
||||
public boolean useDescLangTables() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void findByCodice(String l_codice) {
|
||||
String s_Sql_Find = "select A.* from NAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.codice='" + l_codice + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Nazione> findAllAttiveGoogle(String lang) {
|
||||
String s_Sql_Find = "select A.* from NAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
if (lang.equals("en")) {
|
||||
s_Sql_Order = " order by descrizione_en";
|
||||
} else {
|
||||
s_Sql_Order = " order by descrizione_it";
|
||||
}
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgAttiva=1");
|
||||
wc.addWc("A.flgGoogleMerchant=1");
|
||||
wc.addWc("(A.flgPreventivoWww is null or A.flgPreventivoWww=0)");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, 0, 0);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Nazione> findAll(String lang) {
|
||||
String s_Sql_Find = "select A.* from NAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
if (lang.equals("en")) {
|
||||
s_Sql_Order = " order by descrizione_en";
|
||||
} else {
|
||||
s_Sql_Order = " order by descrizione_it";
|
||||
}
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, 0, 0);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta(String lang) {
|
||||
if (getFlgPreventivoWww() == 0L)
|
||||
return getDescrizione(lang);
|
||||
return getDescrizione(lang) + " *";
|
||||
}
|
||||
|
||||
protected String sqlStringfindAll() {
|
||||
return "select * from NAZIONE order by descrizione_it";
|
||||
}
|
||||
|
||||
public String getDescrizioneInLingua() {
|
||||
return (this.descrizioneInLingua == null || this.descrizioneInLingua.isEmpty()) ? getDescrizione_it() : this.descrizioneInLingua.trim();
|
||||
}
|
||||
|
||||
public void setDescrizioneInLingua(String descrizioneInLingua) {
|
||||
this.descrizioneInLingua = descrizioneInLingua;
|
||||
}
|
||||
|
||||
public double getCostoSpedizioneConIva() {
|
||||
return conIva(getCostoSpedizione(), getParm(Cart.P_DELIVERY_IVA_ALIQUOTA).getNumeroDouble());
|
||||
}
|
||||
|
||||
public long getFlgGoogleMerchant() {
|
||||
return this.flgGoogleMerchant;
|
||||
}
|
||||
|
||||
public void setFlgGoogleMerchant(long flgGoogleMerchant) {
|
||||
this.flgGoogleMerchant = flgGoogleMerchant;
|
||||
}
|
||||
|
||||
public long getFlgPreventivoWww() {
|
||||
return this.flgPreventivoWww;
|
||||
}
|
||||
|
||||
public void setFlgPreventivoWww(long flgPreventivoWww) {
|
||||
this.flgPreventivoWww = flgPreventivoWww;
|
||||
}
|
||||
|
||||
public long getId_iva() {
|
||||
return this.id_iva;
|
||||
}
|
||||
|
||||
public void setId_iva(long id_iva) {
|
||||
this.id_iva = id_iva;
|
||||
setIva(null);
|
||||
}
|
||||
|
||||
public Iva getIva() {
|
||||
this.iva = (Iva)getSecondaryObject(this.iva, Iva.class, new Long(getId_iva()));
|
||||
return this.iva;
|
||||
}
|
||||
|
||||
public void setIva(Iva iva) {
|
||||
this.iva = iva;
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws SQLException {
|
||||
System.out.println(getDescTxtLang("descrizione", Locale.ITALIAN.getLanguage()) + " - " + getDescTxtLang("descrizione", Locale.ITALIAN.getLanguage()));
|
||||
super.prepareSave(ps);
|
||||
if (getFlgCee() == 0L)
|
||||
setId_iva(0L);
|
||||
}
|
||||
|
||||
public double getImportoMinimoWww() {
|
||||
return this.importoMinimoWww;
|
||||
}
|
||||
|
||||
public void setImportoMinimoWww(double importoMinimoWww) {
|
||||
this.importoMinimoWww = importoMinimoWww;
|
||||
}
|
||||
|
||||
public String getMessaggioImportoMinimo(String l_lang) {
|
||||
if (l_lang.isEmpty())
|
||||
l_lang = "it";
|
||||
return getDescTxtLang("messaggioImportoMinimo", l_lang);
|
||||
}
|
||||
|
||||
public boolean checkCart(Cart cart) {
|
||||
if (getImportoMinimoWww() <= 0.0D)
|
||||
return true;
|
||||
if (cart.getTotCartVAT() < getImportoMinimoWww())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
if (this.tag == null)
|
||||
return "";
|
||||
this.tag = this.tag.trim();
|
||||
if (!this.tag.startsWith(","))
|
||||
this.tag = "," + this.tag;
|
||||
if (!this.tag.endsWith(","))
|
||||
this.tag += ",";
|
||||
if (this.tag.equals(","))
|
||||
return "";
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getDescrizione_en() {
|
||||
return (this.descrizione_en == null) ? "" : this.descrizione_en;
|
||||
}
|
||||
|
||||
public void setDescrizione_en(String descrizioneEn) {
|
||||
this.descrizione_en = descrizioneEn;
|
||||
}
|
||||
|
||||
public String getDescrizione_it() {
|
||||
return (this.descrizione_it == null) ? "" : this.descrizione_it.trim();
|
||||
}
|
||||
|
||||
public void setDescrizione_it(String descrizioneIt) {
|
||||
this.descrizione_it = descrizioneIt;
|
||||
}
|
||||
|
||||
public String getPrefissoTel() {
|
||||
if (this.prefissoTel == null)
|
||||
return "";
|
||||
if (!this.prefissoTel.trim().startsWith("+"))
|
||||
return "+" + this.prefissoTel.trim();
|
||||
return this.prefissoTel.trim();
|
||||
}
|
||||
|
||||
public void setPrefissoTel(String prefissoTel) {
|
||||
this.prefissoTel = prefissoTel;
|
||||
}
|
||||
|
||||
public Vectumerator<Nazione> findAllAttive(String lang) {
|
||||
String s_Sql_Find = "select A.* from NAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
if (lang.equals("en")) {
|
||||
s_Sql_Order = " order by descrizione_en";
|
||||
} else {
|
||||
s_Sql_Order = " order by descrizione_it";
|
||||
}
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgAttiva=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, 0, 0);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class NazioneCR extends CRAdapter {
|
||||
private long id_nazione;
|
||||
|
||||
private long flgCeeS = -1L;
|
||||
|
||||
private String id_lingua;
|
||||
|
||||
private long flgAttivaS = -1L;
|
||||
|
||||
private long flgGoogleMerchantS = -1L;
|
||||
|
||||
private long flgPreventivoWwwS = -1L;
|
||||
|
||||
public NazioneCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public NazioneCR() {}
|
||||
|
||||
public void setId_nazione(long newId_nazione) {
|
||||
this.id_nazione = newId_nazione;
|
||||
}
|
||||
|
||||
public void setFlgCeeS(long newFlgCee) {
|
||||
this.flgCeeS = newFlgCee;
|
||||
}
|
||||
|
||||
public long getId_nazione() {
|
||||
return this.id_nazione;
|
||||
}
|
||||
|
||||
public long getFlgCeeS() {
|
||||
return this.flgCeeS;
|
||||
}
|
||||
|
||||
public String getId_lingua() {
|
||||
return (this.id_lingua == null) ? AB_EMPTY_STRING : this.id_lingua.trim();
|
||||
}
|
||||
|
||||
public void setId_lingua(String newId_lingua) {
|
||||
this.id_lingua = newId_lingua;
|
||||
}
|
||||
|
||||
public long getFlgAttivaS() {
|
||||
return this.flgAttivaS;
|
||||
}
|
||||
|
||||
public void setFlgAttivaS(long flgAttivaS) {
|
||||
this.flgAttivaS = flgAttivaS;
|
||||
}
|
||||
|
||||
public static final String getCeeS(long l_flgCee) {
|
||||
return Nazione.getCee(l_flgCee);
|
||||
}
|
||||
|
||||
public String getCeeS() {
|
||||
return Nazione.getCee(getFlgCeeS());
|
||||
}
|
||||
|
||||
public long getFlgGoogleMerchantS() {
|
||||
return this.flgGoogleMerchantS;
|
||||
}
|
||||
|
||||
public void setFlgGoogleMerchantS(long flgGoogleMerchant) {
|
||||
this.flgGoogleMerchantS = flgGoogleMerchant;
|
||||
}
|
||||
|
||||
public long getFlgPreventivoWwwS() {
|
||||
return this.flgPreventivoWwwS;
|
||||
}
|
||||
|
||||
public void setFlgPreventivoWwwS(long flgPreventivoWwwS) {
|
||||
this.flgPreventivoWwwS = flgPreventivoWwwS;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.ResParm;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Ottoxmille extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1684937946550L;
|
||||
|
||||
private long id_ottoxmille;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public Ottoxmille(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Ottoxmille() {}
|
||||
|
||||
public void setId_ottoxmille(long newId_ottoxmille) {
|
||||
this.id_ottoxmille = newId_ottoxmille;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_ottoxmille() {
|
||||
return this.id_ottoxmille;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Ottoxmille> findByCR(OttoxmilleCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from OTTOXMILLE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class OttoxmilleCR extends CRAdapter {
|
||||
private long id_ottoxmille;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public OttoxmilleCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public OttoxmilleCR() {}
|
||||
|
||||
public void setId_ottoxmille(long newId_ottoxmille) {
|
||||
this.id_ottoxmille = newId_ottoxmille;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_ottoxmille() {
|
||||
return this.id_ottoxmille;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Porto extends _AnagAdapter implements Serializable {
|
||||
private long id_porto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String nota;
|
||||
|
||||
public Porto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Porto() {}
|
||||
|
||||
public void setId_porto(long newId_porto) {
|
||||
this.id_porto = newId_porto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setNota(String newNota) {
|
||||
this.nota = newNota;
|
||||
}
|
||||
|
||||
public long getId_porto() {
|
||||
return this.id_porto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getNota() {
|
||||
return (this.nota == null) ? "" : this.nota.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(PortoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from PORTO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class PortoCR extends CRAdapter {
|
||||
private long id_porto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String nota;
|
||||
|
||||
public PortoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public PortoCR() {}
|
||||
|
||||
public void setId_porto(long newId_porto) {
|
||||
this.id_porto = newId_porto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setNota(String newNota) {
|
||||
this.nota = newNota;
|
||||
}
|
||||
|
||||
public long getId_porto() {
|
||||
return this.id_porto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getNota() {
|
||||
return (this.nota == null) ? "" : this.nota.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Postazione extends it.acxent.common.Postazione implements Serializable {
|
||||
private static final long serialVersionUID = -8882732861262606524L;
|
||||
|
||||
private long id_regCassa;
|
||||
|
||||
private RegCassa regCassa;
|
||||
|
||||
public Postazione(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Postazione() {}
|
||||
|
||||
public void setId_regCassa(long newId_regCassa) {
|
||||
this.id_regCassa = newId_regCassa;
|
||||
setRegCassa(null);
|
||||
}
|
||||
|
||||
public long getId_regCassa() {
|
||||
return this.id_regCassa;
|
||||
}
|
||||
|
||||
public void setRegCassa(RegCassa newRegCassa) {
|
||||
this.regCassa = newRegCassa;
|
||||
}
|
||||
|
||||
public RegCassa getRegCassa() {
|
||||
this.regCassa = (RegCassa)getSecondaryObject(this.regCassa, RegCassa.class,
|
||||
getId_regCassa());
|
||||
return this.regCassa;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(PostazioneCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from POSTAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByIp(String l_ip) {
|
||||
String s_Sql_Find = "select A.* from POSTAZIONE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.ipAddress='" + l_ip + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
|
||||
public class PostazioneCR extends it.acxent.common.PostazioneCR {
|
||||
private long id_regCassa;
|
||||
|
||||
private RegCassa regCassa;
|
||||
|
||||
public PostazioneCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public PostazioneCR() {}
|
||||
|
||||
public void setId_regCassa(long newId_regCassa) {
|
||||
this.id_regCassa = newId_regCassa;
|
||||
setRegCassa(null);
|
||||
}
|
||||
|
||||
public long getId_regCassa() {
|
||||
return this.id_regCassa;
|
||||
}
|
||||
|
||||
public void setRegCassa(RegCassa newRegCassa) {
|
||||
this.regCassa = newRegCassa;
|
||||
}
|
||||
|
||||
public RegCassa getRegCassa() {
|
||||
this.regCassa = (RegCassa)getSecondaryObject(this.regCassa, RegCassa.class,
|
||||
getId_regCassa());
|
||||
return this.regCassa;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.util.DoubleOperator;
|
||||
import java.sql.Date;
|
||||
|
||||
public class PrezzoArticolo {
|
||||
private double prezzoBase;
|
||||
|
||||
private double percSconto;
|
||||
|
||||
private double prezzoFinale;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private boolean isOfferta;
|
||||
|
||||
private Date dataScadenzaOfferta;
|
||||
|
||||
private double percSconto1;
|
||||
|
||||
private double percSconto3;
|
||||
|
||||
private double percSconto2;
|
||||
|
||||
private double abbuono;
|
||||
|
||||
public PrezzoArticolo() {}
|
||||
|
||||
public PrezzoArticolo(double prezzoBase, double percSconto, double prezzoFinale, double percSconto1, double percSconto2, double percSconto3, double abbuono) {
|
||||
this.prezzoBase = prezzoBase;
|
||||
this.percSconto = percSconto;
|
||||
this.percSconto1 = percSconto1;
|
||||
this.percSconto2 = percSconto2;
|
||||
this.percSconto3 = percSconto3;
|
||||
this.prezzoFinale = prezzoFinale;
|
||||
this.abbuono = abbuono;
|
||||
}
|
||||
|
||||
public double getPercSconto() {
|
||||
return this.percSconto;
|
||||
}
|
||||
|
||||
public void setPercSconto(double percSconto) {
|
||||
this.percSconto = percSconto;
|
||||
}
|
||||
|
||||
public double getPrezzoFinale() {
|
||||
return this.prezzoFinale;
|
||||
}
|
||||
|
||||
public PrezzoArticolo conIva(double l_aliquota) {
|
||||
DoubleOperator prezzoFinale = new DoubleOperator(DBAdapter.conIva(getPrezzoFinale(), l_aliquota));
|
||||
if (getAbbuono() != 0.0D)
|
||||
prezzoFinale.subtract(getAbbuono());
|
||||
return new PrezzoArticolo(DBAdapter.conIva(getPrezzoBase(), l_aliquota), getPercSconto(), prezzoFinale.getResult(),
|
||||
getPercSconto1(), getPercSconto2(), getPercSconto3(), getAbbuono());
|
||||
}
|
||||
|
||||
public double getPrezzoBase() {
|
||||
return this.prezzoBase;
|
||||
}
|
||||
|
||||
public void setPrezzoBase(double prezzoBase) {
|
||||
this.prezzoBase = prezzoBase;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long id_clifor) {
|
||||
this.id_clifor = id_clifor;
|
||||
}
|
||||
|
||||
public boolean isOfferta() {
|
||||
return this.isOfferta;
|
||||
}
|
||||
|
||||
public void setOfferta(boolean isOfferta) {
|
||||
this.isOfferta = isOfferta;
|
||||
}
|
||||
|
||||
public Date getDataScadenzaOfferta() {
|
||||
return this.dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public void setDataScadenzaOfferta(Date dataScadenzaOfferta) {
|
||||
this.dataScadenzaOfferta = dataScadenzaOfferta;
|
||||
}
|
||||
|
||||
public double getPercSconto1() {
|
||||
return this.percSconto1;
|
||||
}
|
||||
|
||||
public void setPercSconto1(double percSconto1) {
|
||||
this.percSconto1 = percSconto1;
|
||||
}
|
||||
|
||||
public double getPercSconto3() {
|
||||
return this.percSconto3;
|
||||
}
|
||||
|
||||
public void setPercSconto3(double percSconto3) {
|
||||
this.percSconto3 = percSconto3;
|
||||
}
|
||||
|
||||
public double getPercSconto2() {
|
||||
return this.percSconto2;
|
||||
}
|
||||
|
||||
public void setPercSconto2(double percSconto2) {
|
||||
this.percSconto2 = percSconto2;
|
||||
}
|
||||
|
||||
public double getAbbuono() {
|
||||
return this.abbuono;
|
||||
}
|
||||
|
||||
public void setAbbuono(double abbuono) {
|
||||
this.abbuono = abbuono;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class RegCassa extends _AnagAdapter implements Serializable {
|
||||
private long flgTipoCassa;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String ipCassa;
|
||||
|
||||
private long porta;
|
||||
|
||||
private long id_regCassa;
|
||||
|
||||
public static final long TIPO_CASSA_SIEMENS = 0L;
|
||||
|
||||
public static final long TIPO_CASSA_EPSON = 1L;
|
||||
|
||||
public RegCassa(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public RegCassa() {}
|
||||
|
||||
public void setId_regCassa(long newId_regCassa) {
|
||||
this.id_regCassa = newId_regCassa;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIpCassa(String newIpCassa) {
|
||||
this.ipCassa = newIpCassa;
|
||||
}
|
||||
|
||||
public void setPorta(long newPorta) {
|
||||
this.porta = newPorta;
|
||||
}
|
||||
|
||||
public long getId_regCassa() {
|
||||
return this.id_regCassa;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIpCassa() {
|
||||
return (this.ipCassa == null) ? "" : this.ipCassa.trim();
|
||||
}
|
||||
|
||||
public long getPorta() {
|
||||
return this.porta;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(RegCassaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from REG_CASSA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||||
wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getFlgTipoCassa() {
|
||||
return this.flgTipoCassa;
|
||||
}
|
||||
|
||||
public void setFlgTipoCassa(long flgTipoCassa) {
|
||||
this.flgTipoCassa = flgTipoCassa;
|
||||
}
|
||||
|
||||
public static final String getTipoCassa(long l_flgTipoCassa) {
|
||||
if (l_flgTipoCassa == 0L)
|
||||
return "Siemens";
|
||||
if (l_flgTipoCassa == 1L)
|
||||
return "Epson";
|
||||
return "??";
|
||||
}
|
||||
|
||||
public String getTipoCassa() {
|
||||
return getTipoCassa(getFlgTipoCassa());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.CRAdapter;
|
||||
|
||||
public class RegCassaCR extends CRAdapter {
|
||||
private long id_regCassa;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String ipCassa;
|
||||
|
||||
private long porta;
|
||||
|
||||
public RegCassaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public RegCassaCR() {}
|
||||
|
||||
public void setId_regCassa(long newId_regCassa) {
|
||||
this.id_regCassa = newId_regCassa;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIpCassa(String newIpCassa) {
|
||||
this.ipCassa = newIpCassa;
|
||||
}
|
||||
|
||||
public void setPorta(long newPorta) {
|
||||
this.porta = newPorta;
|
||||
}
|
||||
|
||||
public long getId_regCassa() {
|
||||
return this.id_regCassa;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIpCassa() {
|
||||
return (this.ipCassa == null) ? "" : this.ipCassa.trim();
|
||||
}
|
||||
|
||||
public long getPorta() {
|
||||
return this.porta;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package it.acxent.anag;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.WcString;
|
||||
import it.acxent.util.StringTokenizer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Regione extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 8182997964401040060L;
|
||||
|
||||
private String id_regione;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public Regione(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Regione() {}
|
||||
|
||||
public void setId_regione(String newId_regione) {
|
||||
this.id_regione = newId_regione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public String getId_regione() {
|
||||
return (this.id_regione == null) ? "" : this.id_regione.trim();
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Regione> findByCR(RegioneCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select A.* from REGIONE AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue