first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCab.java
Normal file
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCab.java
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
102
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCabCR.java
Normal file
102
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCabCR.java
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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,201 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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(String.valueOf(getPathAllegato()) + getNomeFileSuDisco()).delete();
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(AllegatoCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getNomeFileSuDisco() {
|
||||
return String.valueOf(getId_clifor()) + "_" + getNomeFile();
|
||||
}
|
||||
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws Exception {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Aspetto.java
Normal file
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Aspetto.java
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AspettoCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AspettoCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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();
|
||||
}
|
||||
}
|
||||
460
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Banca.java
Normal file
460
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Banca.java
Normal file
|
|
@ -0,0 +1,460 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT A.* from BANCA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.codiceAlt='" + codiceAlt + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT A.* from BANCA AS A";
|
||||
String s_Sql_Order = " ORDER BY ordine";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findSuccessivoByOrdine(long l_ordine) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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() {
|
||||
getFlgDefaultBonifico();
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public void findBancaDefault() {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Banca> findNonVisibili() {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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();
|
||||
}
|
||||
}
|
||||
116
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/BancaCR.java
Normal file
116
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/BancaCR.java
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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,68 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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();
|
||||
}
|
||||
}
|
||||
40
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Cliente.java
Normal file
40
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Cliente.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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";
|
||||
}
|
||||
}
|
||||
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ClienteCR.java
Normal file
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ClienteCR.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.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);
|
||||
}
|
||||
}
|
||||
2220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Clifor.java
Normal file
2220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Clifor.java
Normal file
File diff suppressed because it is too large
Load diff
654
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforCR.java
Normal file
654
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforCR.java
Normal file
|
|
@ -0,0 +1,654 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
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;
|
||||
|
||||
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) ? "" : this.flgCF;
|
||||
}
|
||||
|
||||
public String getCF() {
|
||||
if (getFlgCF().equals("C"))
|
||||
return "Cliente";
|
||||
if (getFlgCF().equals("F"))
|
||||
return "Fornitore";
|
||||
return "";
|
||||
}
|
||||
|
||||
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) ? "" : 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) ? "" : 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) ? "" : 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) ? "" : this.descrizioneComune;
|
||||
}
|
||||
|
||||
public void setDescrizioneComune(String descrizioneComune) {
|
||||
this.descrizioneComune = descrizioneComune;
|
||||
}
|
||||
|
||||
public String getProvinciaComune() {
|
||||
return (this.provinciaComune == null) ? "" : 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.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,190 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAgenteByClifor(long l_id_clifor) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
Vectumerator vec = findRows(stmt, 1, 1);
|
||||
if (vec.getTotNumberOfRecords() > 0)
|
||||
return true;
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
103
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforUsers.java
Normal file
103
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforUsers.java
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CliforUsers extends _AnagAdapter implements Serializable {
|
||||
private long id_cliforUsers;
|
||||
|
||||
private long id_cliFor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private Clifor cliFor;
|
||||
|
||||
private com.ablia.common.Users users;
|
||||
|
||||
public CliforUsers(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforUsers() {}
|
||||
|
||||
public void setId_cliforUsers(long newId_cliforUsers) {
|
||||
this.id_cliforUsers = newId_cliforUsers;
|
||||
}
|
||||
|
||||
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 long getId_cliforUsers() {
|
||||
return this.id_cliforUsers;
|
||||
}
|
||||
|
||||
public long getId_cliFor() {
|
||||
return this.id_cliFor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
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(com.ablia.common.Users newUsers) {
|
||||
this.users = newUsers;
|
||||
}
|
||||
|
||||
public com.ablia.common.Users getUsers() {
|
||||
this.users = (com.ablia.common.Users)getSecondaryObject(
|
||||
(DBAdapter)this.users,
|
||||
com.ablia.common.Users.class, getId_users());
|
||||
return this.users;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(CliforUsersCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_USERS 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
|
||||
public class CliforUsersCR extends CRAdapter {
|
||||
private long id_cliforUsers;
|
||||
|
||||
private long id_cliFor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private Clifor cliFor;
|
||||
|
||||
private com.ablia.common.Users users;
|
||||
|
||||
public CliforUsersCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public CliforUsersCR() {}
|
||||
|
||||
public void setId_cliforUsers(long newId_cliforUsers) {
|
||||
this.id_cliforUsers = newId_cliforUsers;
|
||||
}
|
||||
|
||||
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 long getId_cliforUsers() {
|
||||
return this.id_cliforUsers;
|
||||
}
|
||||
|
||||
public long getId_cliFor() {
|
||||
return this.id_cliFor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
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(com.ablia.common.Users newUsers) {
|
||||
this.users = newUsers;
|
||||
}
|
||||
|
||||
public com.ablia.common.Users getUsers() {
|
||||
this.users = (com.ablia.common.Users)getSecondaryObject(
|
||||
(DBAdapter)this.users,
|
||||
com.ablia.common.Users.class, getId_users());
|
||||
return this.users;
|
||||
}
|
||||
}
|
||||
230
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Comune.java
Normal file
230
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Comune.java
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.anag.json.JsonComune;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import com.google.gson.Gson;
|
||||
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 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;
|
||||
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 String.valueOf(getCodice()) + " " + getDescrizione();
|
||||
}
|
||||
|
||||
public Vectumerator findByProv(String l_provincia) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByProvCom(String l_provincia, String l_comuneDesc) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findProvince() {
|
||||
String s_Sql_Find = "select DISTINCT A.provincia from COMUNE AS A";
|
||||
String s_Sql_Order = " order by A.provincia";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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) {
|
||||
System.out.println("getBeanJson: INIZIO RICHIESTA ");
|
||||
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, 0, 0);
|
||||
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);
|
||||
System.out.println("getJson: Comune " + res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
127
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ComuneCR.java
Normal file
127
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ComuneCR.java
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
138
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contatore.java
Normal file
138
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contatore.java
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
155
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contatto.java
Normal file
155
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contatto.java
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
276
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contratto.java
Normal file
276
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Contratto.java
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.mail.MailMessage;
|
||||
import com.ablia.newsletter.CodaMessaggi;
|
||||
import com.ablia.newsletter.TemplateMsg;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
169
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ContrattoCR.java
Normal file
169
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ContrattoCR.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getIndirizzoCompleto() {
|
||||
return String.valueOf(getIndirizzoDD()) + " n." + getNumeroCivicoDD() + " - " + (getCapZonaDD().isEmpty() ? getCapComuneDD() : getCapZonaDD()) + " " +
|
||||
getDescrizioneComuneDD() + " (" + getProvinciaComuneDD() + ")";
|
||||
}
|
||||
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Esercizio.java
Normal file
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Esercizio.java
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Festivita.java
Normal file
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Festivita.java
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
173
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/FestivitaCR.java
Normal file
173
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/FestivitaCR.java
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
60
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Fornitore.java
Normal file
60
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Fornitore.java
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT A.* from CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.cognome, A.nome\t";
|
||||
WcString wc = new WcString();
|
||||
s_Sql_Find = String.valueOf(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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.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);
|
||||
}
|
||||
}
|
||||
188
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Iva.java
Normal file
188
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Iva.java
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapterException;
|
||||
import com.ablia.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 = "S";
|
||||
|
||||
public static final String TI_N3_NON_IMPONIBILE = "N";
|
||||
|
||||
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 = "C";
|
||||
|
||||
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_iva;
|
||||
|
||||
private String notaEsenzione;
|
||||
|
||||
private String codiceExport;
|
||||
|
||||
public static final String P_CODICE_IVA_STD_VEND = "CODICE_IVA_STD_VEND";
|
||||
|
||||
public static final String P_CODICE_IVA_ART8 = "CODICE_IVA_ART8";
|
||||
|
||||
public static final String P_CODICE_IVA_ART9 = "CODICE_IVA_ART9";
|
||||
|
||||
public static final String P_CODICE_IVA_REVERSE_CHARGE = "CODICE_IVA_REVERSE_CHARGE";
|
||||
|
||||
public static final String P_CODICE_IVA_STD_ACQUISTO = "CODICE_IVA_STD_ACQ";
|
||||
|
||||
public static final String P_CODICE_IVA_ESENTE = "CODICE_IVA_ESENTE";
|
||||
|
||||
public static final String P_CODICE_IVA_REGIME_MARGINE = "CODICE_IVA_REGIME_MARGINE";
|
||||
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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";
|
||||
if (l_flgTipo.equals("N"))
|
||||
return "Non Imponibile N3";
|
||||
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";
|
||||
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("N"))
|
||||
return "N3";
|
||||
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("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");
|
||||
}
|
||||
}
|
||||
12
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/IvaCR.java
Normal file
12
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/IvaCR.java
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class IvaCR extends CRAdapter {
|
||||
public IvaCR() {}
|
||||
|
||||
public IvaCR(ApplParmFull newAp) {
|
||||
super(newAp);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.ablia.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();
|
||||
}
|
||||
39
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Lang.java
Normal file
39
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Lang.java
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
647
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Listino.java
Normal file
647
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Listino.java
Normal file
|
|
@ -0,0 +1,647 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloVariante;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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_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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return getTipo(getFlgTipoL());
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
if (getId_listino() == 0L)
|
||||
return "";
|
||||
return String.valueOf(getDescrizione()) + " " + getTipo() + " " + getDescrizionePercentuale();
|
||||
}
|
||||
|
||||
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 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 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 {
|
||||
return dammiListinoBase(getApFull()).getPrezzo(articolo);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pa.getPrezzoFinale() > 0.0D) {
|
||||
double prezzoBaseFinale = prezzoArticoloBase.getPrezzoFinale();
|
||||
if (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 getTipo(long l_flgTipo) {
|
||||
switch ((int)l_flgTipo) {
|
||||
case 0:
|
||||
return "Sconto su Vendita";
|
||||
case 1:
|
||||
return "Ricarico su Acquisto";
|
||||
case 99:
|
||||
return "Listino 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 DISTINCT A.* from LISTINO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgTipoL = 99");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 static final Listino dammiListinoBase(ApplParmFull apFull) {
|
||||
Listino bean = new Listino(apFull);
|
||||
bean.findListinoBase();
|
||||
if (bean.getDBState() == 0)
|
||||
bean.creaListinoBase();
|
||||
return bean;
|
||||
}
|
||||
|
||||
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 String.valueOf(getNf2().format(getPercL1())) + " + " + getNf2().format(getPercL2()) + " + " + getNf2().format(getPercL3()) + " %";
|
||||
return String.valueOf(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 DISTINCT A.* from LISTINO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgTipoL <> 99");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
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,447 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloVariante;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.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;
|
||||
|
||||
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() {
|
||||
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() == 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;
|
||||
}
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticolo(long id_articolo) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticoloVariante(long id_articoloVariante) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 Exception {
|
||||
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(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 String.valueOf(getNf2().format(getPercLA1())) + " + " + getNf2().format(getPercLA2()) + " + " + getNf2().format(getPercLA3()) + " %";
|
||||
return String.valueOf(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,446 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloVariante;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticolo(long id_articolo) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findPrezziByArticoloVariante(long id_articoloVariante) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 Exception {
|
||||
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 String.valueOf(getNf2().format(getPercLA1())) + " + " + getNf2().format(getPercLA2()) + " + " + getNf2().format(getPercLA3()) + " %";
|
||||
return String.valueOf(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 com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloVariante;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
73
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ListinoCR.java
Normal file
73
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ListinoCR.java
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
315
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ListinoTipo.java
Normal file
315
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ListinoTipo.java
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT A.* from LISTINO_TIPO AS A ";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.id_listino=" + l_id_listino);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString());
|
||||
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 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.getTipo(l_flgTipo);
|
||||
}
|
||||
|
||||
public void findByCliforTipo(long l_id_clifor, long l_id_tipo) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findByListinoTipo(long l_id_listino, long l_id_tipo) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString());
|
||||
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 String.valueOf(getNf2().format(getPercLT1())) + " + " + getNf2().format(getPercLT2()) + " + " + getNf2().format(getPercLT3()) + " %";
|
||||
return String.valueOf(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 com.ablia.anag;
|
||||
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
219
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/MagFisico.java
Normal file
219
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/MagFisico.java
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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_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 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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT A.* from MAG_FISICO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.flgTipo = 3");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
return getDescrizione().isEmpty() ? "Nessuno" : 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();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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);
|
||||
}
|
||||
}
|
||||
108
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/MeseEscluso.java
Normal file
108
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/MeseEscluso.java
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
222
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Nazione.java
Normal file
222
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Nazione.java
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.cart.Cart;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 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;
|
||||
|
||||
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 setDescrizione_it(String newDescrizione) {
|
||||
this.descrizione_it = newDescrizione;
|
||||
}
|
||||
|
||||
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 DISTINCT 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");
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizione_en() {
|
||||
return (this.descrizione_en == null) ? "" : this.descrizione_en.trim();
|
||||
}
|
||||
|
||||
public void setDescrizione_en(String descrizione_en) {
|
||||
this.descrizione_en = descrizione_en;
|
||||
}
|
||||
|
||||
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 getDescrizione_it() {
|
||||
return (this.descrizione_it == null) ? "" : this.descrizione_it.trim();
|
||||
}
|
||||
|
||||
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()) || lang.equals(Locale.ENGLISH.getLanguage()))
|
||||
return getLangField("descrizione", lang);
|
||||
return getDescrizione_en();
|
||||
}
|
||||
|
||||
public Vectumerator findAllAttive(String lang) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, 0, 0);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta(String lang) {
|
||||
return getLangField("descrizione", 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());
|
||||
}
|
||||
}
|
||||
60
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/NazioneCR.java
Normal file
60
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/NazioneCR.java
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class NazioneCR extends CRAdapter {
|
||||
private long id_nazione;
|
||||
|
||||
private long flgCeeS = -1L;
|
||||
|
||||
private String id_lingua;
|
||||
|
||||
private long flgAttivaS = -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) ? "" : 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());
|
||||
}
|
||||
}
|
||||
75
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Porto.java
Normal file
75
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Porto.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/PortoCR.java
Normal file
42
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/PortoCR.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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,83 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Postazione extends com.ablia.common.Postazione {
|
||||
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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
|
||||
public class PostazioneCR extends com.ablia.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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
114
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RegCassa.java
Normal file
114
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RegCassa.java
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
66
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Regione.java
Normal file
66
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Regione.java
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT A.* from REGIONE 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RegioneCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RegioneCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class RegioneCR extends CRAdapter {
|
||||
private String id_regione;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public RegioneCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public RegioneCR() {}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
36
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Rubrica.java
Normal file
36
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Rubrica.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.util.Vectumerator;
|
||||
|
||||
public class Rubrica extends Clifor {
|
||||
private static final long serialVersionUID = 1085261265605689583L;
|
||||
|
||||
private long id_rubrica;
|
||||
|
||||
public Rubrica() {}
|
||||
|
||||
public Rubrica(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getTableBeanName() {
|
||||
return "CLIFOR";
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "R";
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(RubricaCR CR, int pageNumber, int pageRows) {
|
||||
return findByCR(CR, pageNumber, pageRows);
|
||||
}
|
||||
|
||||
public long getId_rubrica() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_rubrica(long id_rubrica) {
|
||||
setId_clifor(id_rubrica);
|
||||
}
|
||||
}
|
||||
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RubricaCR.java
Normal file
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/RubricaCR.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
|
||||
public class RubricaCR extends CliforCR {
|
||||
private long id_cliente;
|
||||
|
||||
public RubricaCR() {}
|
||||
|
||||
public RubricaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return "R";
|
||||
}
|
||||
|
||||
public long getId_cliente() {
|
||||
return getId_clifor();
|
||||
}
|
||||
|
||||
public void setId_cliente(long id_cliente) {
|
||||
setId_clifor(id_cliente);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class TipoAllegatoClifor extends _AnagAdapter implements Serializable {
|
||||
private long id_tipoAllegatoClifor;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public TipoAllegatoClifor(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoAllegatoClifor() {}
|
||||
|
||||
public void setId_tipoAllegatoClifor(long newId_tipoAllegatoClifor) {
|
||||
this.id_tipoAllegatoClifor = newId_tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_tipoAllegatoClifor() {
|
||||
return this.id_tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(TipoAllegatoCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_ALLEGATO_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
if (CR.getId_tipoAllegatoCliforS() > 0L)
|
||||
wc.addWc("A.id_tipoAllegatoClifor > " + CR.getId_tipoAllegatoCliforS());
|
||||
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 + "%' )");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class TipoAllegatoCliforCR extends CRAdapter {
|
||||
private long id_tipoAllegatoCliforS;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public TipoAllegatoCliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoAllegatoCliforCR() {}
|
||||
|
||||
public void setId_tipoAllegatoCliforS(long newId_tipoAllegatoClifor) {
|
||||
this.id_tipoAllegatoCliforS = newId_tipoAllegatoClifor;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_tipoAllegatoCliforS() {
|
||||
return this.id_tipoAllegatoCliforS;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
}
|
||||
159
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoClifor.java
Normal file
159
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoClifor.java
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class TipoClifor extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = -8580769150946613128L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_NESSUNO = 0L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_AGENTE = 1L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_PROGETTISTA = 2L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_RESP_COMMERCIALE = 3L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_RESP_PRODUZIONE = 4L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_AGENTE_E_RESP_COMM = 101L;
|
||||
|
||||
public static final long TIPOLOGIA_FOR_AGENTE_RESP_COMM_PROG = 102L;
|
||||
|
||||
private long id_tipoClifor;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String flgTipo;
|
||||
|
||||
private long flgTipologia;
|
||||
|
||||
private long flgProvvCliente;
|
||||
|
||||
private long flgProvvArticolo;
|
||||
|
||||
public TipoClifor(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoClifor() {}
|
||||
|
||||
public void setId_tipoClifor(long newId_causaleMagazzino) {
|
||||
this.id_tipoClifor = newId_causaleMagazzino;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_tipoClifor() {
|
||||
return this.id_tipoClifor;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(TipoCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.flgTipo,A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getFlgTipoS().isEmpty())
|
||||
wc.addWc(" A.flgTipo = '" + CR.getFlgTipoS() + "' ");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getFlgTipo() {
|
||||
return (this.flgTipo == null) ? "" : this.flgTipo;
|
||||
}
|
||||
|
||||
public void setFlgTipo(String flgTipo) {
|
||||
this.flgTipo = flgTipo;
|
||||
}
|
||||
|
||||
public long getFlgTipologia() {
|
||||
return this.flgTipologia;
|
||||
}
|
||||
|
||||
public static final String getTipologia(long l_flgTipologia) {
|
||||
switch ((int)l_flgTipologia) {
|
||||
case 1:
|
||||
return "Agente";
|
||||
case 2:
|
||||
return "Progettista";
|
||||
case 3:
|
||||
return "Responsabile Commerciale";
|
||||
case 4:
|
||||
return "Responsabile Produzione";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getTipologia() {
|
||||
return getTipologia(getFlgTipologia());
|
||||
}
|
||||
|
||||
public void setFlgTipologia(long flgAgente) {
|
||||
this.flgTipologia = flgAgente;
|
||||
}
|
||||
|
||||
public String getDescrizioneTipologia(long l_id) {
|
||||
if (getFlgTipo().equals("C"))
|
||||
return "--";
|
||||
String ret = "";
|
||||
if (l_id == 0L) {
|
||||
ret = "Nessuna";
|
||||
} else if (l_id == 1L) {
|
||||
ret = "Agente";
|
||||
} else if (l_id == 2L) {
|
||||
ret = "Progettista";
|
||||
} else if (l_id == 3L) {
|
||||
ret = "Resp. Commerciale";
|
||||
} else if (l_id == 4L) {
|
||||
ret = "Resp. Produzione";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Vectumerator<TipoClifor> findByTipo(String l_flgTipo) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_CLIFOR AS A";
|
||||
String s_Sql_Order = " order by A.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.flgTipo = '" + l_flgTipo + "' ");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public long getFlgProvvCliente() {
|
||||
return this.flgProvvCliente;
|
||||
}
|
||||
|
||||
public void setFlgProvvCliente(long flgProvvCliente) {
|
||||
this.flgProvvCliente = flgProvvCliente;
|
||||
}
|
||||
|
||||
public long getFlgProvvArticolo() {
|
||||
return this.flgProvvArticolo;
|
||||
}
|
||||
|
||||
public void setFlgProvvArticolo(long flgProvvArticolo) {
|
||||
this.flgProvvArticolo = flgProvvArticolo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TipoCliforCR extends CRAdapter implements Serializable {
|
||||
private long id_tipoClifor;
|
||||
|
||||
private String descrizioneS;
|
||||
|
||||
private String flgTipoS;
|
||||
|
||||
private long flgTipologiaS;
|
||||
|
||||
public TipoCliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoCliforCR() {}
|
||||
|
||||
public void setId_tipoClifor(long newId_causaleMagazzino) {
|
||||
this.id_tipoClifor = newId_causaleMagazzino;
|
||||
}
|
||||
|
||||
public void setDescrizioneS(String newDescrizione) {
|
||||
this.descrizioneS = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_tipoClifor() {
|
||||
return this.id_tipoClifor;
|
||||
}
|
||||
|
||||
public String getDescrizioneS() {
|
||||
return (this.descrizioneS == null) ? "" :
|
||||
this.descrizioneS.trim();
|
||||
}
|
||||
|
||||
public String getFlgTipoS() {
|
||||
return (this.flgTipoS == null) ? "" : this.flgTipoS;
|
||||
}
|
||||
|
||||
public long getFlgTipologiaS() {
|
||||
return this.flgTipologiaS;
|
||||
}
|
||||
|
||||
public void setFlgTipoS(String flgTipo) {
|
||||
this.flgTipoS = flgTipo;
|
||||
}
|
||||
|
||||
public void setFlgTipologiaS(long flgAgente) {
|
||||
this.flgTipologiaS = flgAgente;
|
||||
}
|
||||
}
|
||||
134
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoContratto.java
Normal file
134
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoContratto.java
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class TipoContratto extends _AnagAdapter implements Serializable {
|
||||
private long id_tipoContratto;
|
||||
|
||||
private String messaggioSms;
|
||||
|
||||
private Date dataFineValiditaContratto;
|
||||
|
||||
private long durataMesi;
|
||||
|
||||
private long flgPrepagato;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long ggInvioMsg;
|
||||
|
||||
public TipoContratto(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoContratto() {}
|
||||
|
||||
public void setId_tipoContratto(long newId_tipoContratto) {
|
||||
this.id_tipoContratto = newId_tipoContratto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setDataFineValiditaContratto(Date newDataFineValiditaContratto) {
|
||||
this.dataFineValiditaContratto = newDataFineValiditaContratto;
|
||||
}
|
||||
|
||||
public void setDurataMesi(long newMesiRinnovo) {
|
||||
this.durataMesi = newMesiRinnovo;
|
||||
}
|
||||
|
||||
public long getId_tipoContratto() {
|
||||
return this.id_tipoContratto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" :
|
||||
this.descrizione.trim();
|
||||
}
|
||||
|
||||
public Date getDataFineValiditaContratto() {
|
||||
return this.dataFineValiditaContratto;
|
||||
}
|
||||
|
||||
public long getDurataMesi() {
|
||||
return this.durataMesi;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(TipoContrattoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getPrepagato(long l_flgPrepagato) {
|
||||
switch ((int)l_flgPrepagato) {
|
||||
case 1:
|
||||
return "Prepagato";
|
||||
case 2:
|
||||
return "Contratto";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public void setFlgPrepagato(long flgPrepagato) {
|
||||
this.flgPrepagato = flgPrepagato;
|
||||
}
|
||||
|
||||
public long getFlgPrepagato() {
|
||||
return this.flgPrepagato;
|
||||
}
|
||||
|
||||
public String getPrepagato() {
|
||||
return getPrepagato(getFlgPrepagato());
|
||||
}
|
||||
|
||||
public String getMessaggioSms() {
|
||||
return (this.messaggioSms == null) ? "" : this.messaggioSms.trim();
|
||||
}
|
||||
|
||||
public void setMessaggioSms(String messaggioSms) {
|
||||
this.messaggioSms = messaggioSms;
|
||||
}
|
||||
|
||||
public long getGgInvioMsg() {
|
||||
return this.ggInvioMsg;
|
||||
}
|
||||
|
||||
public void setGgInvioMsg(long ggInvioMsg) {
|
||||
this.ggInvioMsg = ggInvioMsg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class TipoContrattoCR extends CRAdapter {
|
||||
private long id_tipoContratto;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private Date dataFineValiditaContratto;
|
||||
|
||||
private long durataMesi;
|
||||
|
||||
private long lastUpdId_user;
|
||||
|
||||
private Timestamp lastUpdTmst;
|
||||
|
||||
public TipoContrattoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoContrattoCR() {}
|
||||
|
||||
public void setId_tipoContratto(long newId_tipoContratto) {
|
||||
this.id_tipoContratto = newId_tipoContratto;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setDataFineValiditaContratto(Date newDataFineValiditaContratto) {
|
||||
this.dataFineValiditaContratto = newDataFineValiditaContratto;
|
||||
}
|
||||
|
||||
public void setDurataMesi(long newMesiRinnovo) {
|
||||
this.durataMesi = newMesiRinnovo;
|
||||
}
|
||||
|
||||
public void setLastUpdId_user(long newLastUpdId_user) {
|
||||
this.lastUpdId_user = newLastUpdId_user;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
|
||||
this.lastUpdTmst = newLastUpdTmst;
|
||||
}
|
||||
|
||||
public long getId_tipoContratto() {
|
||||
return this.id_tipoContratto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public Date getDataFineValiditaContratto() {
|
||||
return this.dataFineValiditaContratto;
|
||||
}
|
||||
|
||||
public long getDurataMesi() {
|
||||
return this.durataMesi;
|
||||
}
|
||||
|
||||
public long getLastUpdId_user() {
|
||||
return this.lastUpdId_user;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
}
|
||||
561
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoPagamento.java
Normal file
561
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/TipoPagamento.java
Normal file
|
|
@ -0,0 +1,561 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.contab.Documento;
|
||||
import com.ablia.contab.DocumentoScadenza;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class TipoPagamento extends _AnagAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1807466847085865884L;
|
||||
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private long periodicita;
|
||||
|
||||
private String codiceTenderCassa;
|
||||
|
||||
private long flgTipoPagamento;
|
||||
|
||||
private long flgAbilitatoCorriere;
|
||||
|
||||
private long giornoFisso;
|
||||
|
||||
private long primaRata;
|
||||
|
||||
private long nRate;
|
||||
|
||||
public static final long TP_RIM_DIRETTA = 3L;
|
||||
|
||||
public static final long WWW_ENTRAMBI_WWW = 2L;
|
||||
|
||||
public static final long PRIMA_SCADENZA_FINE_MESE = 1L;
|
||||
|
||||
public static final long PRIMA_SCADENZA_DATA_FATTURA = 2L;
|
||||
|
||||
public static final long TP_RIBA = 1L;
|
||||
|
||||
private String descrizione_it;
|
||||
|
||||
private long flgWww;
|
||||
|
||||
private long flgAbilitatoNegozio;
|
||||
|
||||
private long flgPrimaScadenza;
|
||||
|
||||
private long codiceCassaEpson;
|
||||
|
||||
public static final long TP_DIFFERITO = 4L;
|
||||
|
||||
public static final long WWW_SOLO_WWW = 1L;
|
||||
|
||||
public static final long WWW_NO_WWW = 0L;
|
||||
|
||||
public static final long TP_BONIFICO = 2L;
|
||||
|
||||
public static final long TP_CC = 5L;
|
||||
|
||||
public TipoPagamento(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoPagamento() {}
|
||||
|
||||
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||
this.id_tipoPagamento = newId_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setPeriodicita(long newPeriodicita) {
|
||||
this.periodicita = newPeriodicita;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setDescrizione_it(String newDescrizione_it) {
|
||||
this.descrizione_it = newDescrizione_it;
|
||||
}
|
||||
|
||||
public void setFlgTipoPagamento(long newFlgTipoPagamento) {
|
||||
this.flgTipoPagamento = newFlgTipoPagamento;
|
||||
}
|
||||
|
||||
public void setFlgPrimaScadenza(long newFlgPrimaScadenza) {
|
||||
this.flgPrimaScadenza = newFlgPrimaScadenza;
|
||||
}
|
||||
|
||||
public void setGiornoFisso(long newGiornoFisso) {
|
||||
this.giornoFisso = newGiornoFisso;
|
||||
}
|
||||
|
||||
public void setPrimaRata(long newPrimaRata) {
|
||||
this.primaRata = newPrimaRata;
|
||||
}
|
||||
|
||||
public void setNRate(long newNRate) {
|
||||
this.nRate = newNRate;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public long getPeriodicita() {
|
||||
return this.periodicita;
|
||||
}
|
||||
|
||||
public String getDescrizioneTipo() {
|
||||
String temp = String.valueOf(getTipoPagamento()) + " " + getPrimaScadenza() + (
|
||||
|
||||
(getPrimaRata() == 0L) ? " Vista fattura" : (" a " + getPrimaRata() + " gg"));
|
||||
if (getNRate() > 1L)
|
||||
temp = String.valueOf(temp) + " per " + getNRate() + " rate ogni " + getPeriodicitaDesc();
|
||||
if (getGiornoFisso() > 0L)
|
||||
temp = String.valueOf(temp) + " al " + getGiornoFisso() + " del mese";
|
||||
return temp;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getDescrizione_it() {
|
||||
return getDescrizione("it");
|
||||
}
|
||||
|
||||
public long getFlgTipoPagamento() {
|
||||
return this.flgTipoPagamento;
|
||||
}
|
||||
|
||||
public String getPeriodicitaDesc() {
|
||||
return getPeriodicitaDesc(getPeriodicita());
|
||||
}
|
||||
|
||||
public static final String getPrimaScadenza(long l_flgPrimaScadenza) {
|
||||
switch ((int)l_flgPrimaScadenza) {
|
||||
case 2:
|
||||
return "Data Fattura";
|
||||
case 1:
|
||||
return "Fine Mese";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public String getPrimaScadenza() {
|
||||
return getPrimaScadenza(getFlgPrimaScadenza());
|
||||
}
|
||||
|
||||
public String getTipoPagamento() {
|
||||
return getTipoPagamento(getFlgTipoPagamento());
|
||||
}
|
||||
|
||||
public long getFlgPrimaScadenza() {
|
||||
return this.flgPrimaScadenza;
|
||||
}
|
||||
|
||||
public long getGiornoFisso() {
|
||||
return this.giornoFisso;
|
||||
}
|
||||
|
||||
public long getPrimaRata() {
|
||||
return this.primaRata;
|
||||
}
|
||||
|
||||
public long getNRate() {
|
||||
return (this.nRate == 0L) ? 1L : this.nRate;
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<TipoPagamento> findByCR(TipoPagamentoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select distinct A.* from TIPO_PAGAMENTO AS A";
|
||||
String s_Sql_Order = " order by A.descrizione_it ";
|
||||
WcString wc = new WcString();
|
||||
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||
s_Sql_Find = "select distinct A.* , B.descrizione from TIPO_PAGAMENTO AS A left JOIN DESC_TXT_LANG AS B ON A.id_tipoPagamento = B.idTabella AND B.tabella = 'TIPO_PAGAMENTO' AND B.campo = 'descrizione' ";
|
||||
s_Sql_Order = " order by B.descrizione ";
|
||||
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||
StringBuffer txt = new StringBuffer("(");
|
||||
while (st.hasMoreTokens()) {
|
||||
String token = st.nextToken();
|
||||
txt.append("(B.descrizione like '%" + token + "%')");
|
||||
if (st.hasMoreTokens())
|
||||
txt.append(" and ");
|
||||
}
|
||||
txt.append(")");
|
||||
wc.addWc(txt.toString());
|
||||
}
|
||||
if (CR.getFlgTipoPagamento() > 0L)
|
||||
wc.addWc("A.flgTipoPagamento=" + CR.getFlgTipoPagamento());
|
||||
if (CR.getFlgWww() == 0L) {
|
||||
wc.addWc("(A.flgWww is null or A.flgWww=0)");
|
||||
} else if (CR.getFlgWww() > 0L) {
|
||||
wc.addWc("A.flgWww=" + CR.getFlgWww());
|
||||
}
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getCodiceTenderCassa() {
|
||||
return (this.codiceTenderCassa == null) ? "" : this.codiceTenderCassa.trim();
|
||||
}
|
||||
|
||||
public void setCodiceTenderCassa(String codiceTenderCassa) {
|
||||
this.codiceTenderCassa = codiceTenderCassa;
|
||||
}
|
||||
|
||||
public Vectumerator<TipoPagamento> findCodiciTender() {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_PAGAMENTO AS A";
|
||||
String s_Sql_Order = " order by A.codiceTenderCassa";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.codiceTenderCassa is not null");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizione(int l_length) {
|
||||
return subString(getDescrizione(), l_length);
|
||||
}
|
||||
|
||||
public static final String getPeriodicitaDesc(long l_periodicita) {
|
||||
switch ((int)l_periodicita) {
|
||||
case 0:
|
||||
return "Nessuna";
|
||||
case 1:
|
||||
return "30 gg";
|
||||
case 2:
|
||||
return "60 gg";
|
||||
case 3:
|
||||
return "90 gg";
|
||||
case 4:
|
||||
return "120 gg";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public static final String getTipoPagamento(long l_flgTipoPagamento) {
|
||||
switch ((int)l_flgTipoPagamento) {
|
||||
case 2:
|
||||
return "Bonifico";
|
||||
case 1:
|
||||
return "Ric. Banc.";
|
||||
case 3:
|
||||
return "Rim. Diretta";
|
||||
case 4:
|
||||
return "Differito";
|
||||
case 5:
|
||||
return "Carta di Credito";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public long getFlgWww() {
|
||||
return this.flgWww;
|
||||
}
|
||||
|
||||
public void setFlgWww(long flgWww) {
|
||||
this.flgWww = flgWww;
|
||||
}
|
||||
|
||||
public Vectumerator<TipoPagamento> findPagamentiWww(long l_flgRitiroNegozio) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from TIPO_PAGAMENTO AS A left JOIN DESC_TXT_LANG AS B ON A.id_tipoPagamento = B.idTabella AND B.tabella = 'TIPO_PAGAMENTO' AND B.campo = 'descrizione' ";
|
||||
String s_Sql_Order = " order by B.descrizione";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.flgWww>=1");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getWww() {
|
||||
return getWww(getFlgWww());
|
||||
}
|
||||
|
||||
public static final String getWww(long l_flgWww) {
|
||||
switch ((int)l_flgWww) {
|
||||
case 0:
|
||||
return "No Www";
|
||||
case 1:
|
||||
return "Solo Www";
|
||||
case 2:
|
||||
return "Sempre";
|
||||
}
|
||||
return "??";
|
||||
}
|
||||
|
||||
public long getFlgAbilitatoCorriere() {
|
||||
return this.flgAbilitatoCorriere;
|
||||
}
|
||||
|
||||
public void setFlgAbilitatoCorriere(long flgAbilitatoCorriere) {
|
||||
this.flgAbilitatoCorriere = flgAbilitatoCorriere;
|
||||
}
|
||||
|
||||
public long getFlgAbilitatoNegozio() {
|
||||
return this.flgAbilitatoNegozio;
|
||||
}
|
||||
|
||||
public void setFlgAbilitatoNegozio(long flgAbilitatoNegozio) {
|
||||
this.flgAbilitatoNegozio = flgAbilitatoNegozio;
|
||||
}
|
||||
|
||||
public boolean useDescLangTables() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return getDescrizione("it");
|
||||
}
|
||||
|
||||
public String getDescrizione(String lang) {
|
||||
if (lang.isEmpty())
|
||||
lang = "it";
|
||||
return getDescTxtLang("descrizione", lang);
|
||||
}
|
||||
|
||||
public String getMsgMailProcedi(String lang) {
|
||||
if (lang.isEmpty())
|
||||
lang = "it";
|
||||
return getDescTxtLang("msgMailProcedi", lang);
|
||||
}
|
||||
|
||||
public String getMsgMailAspetta(String lang) {
|
||||
if (lang.isEmpty())
|
||||
lang = "it";
|
||||
return getDescTxtLang("msgMailAspetta", lang);
|
||||
}
|
||||
|
||||
public long getCodiceCassaEpson() {
|
||||
return this.codiceCassaEpson;
|
||||
}
|
||||
|
||||
public void setCodiceCassaEpson(long codiceCassaEpson) {
|
||||
this.codiceCassaEpson = codiceCassaEpson;
|
||||
}
|
||||
|
||||
public Vectumerator<MeseEscluso> getMesiEsclusi() {
|
||||
MeseEsclusoCR CR = new MeseEsclusoCR(getApFull());
|
||||
MeseEscluso meseEscluso = new MeseEscluso(getApFull());
|
||||
CR.setId_tipoPagamento(getId_tipoPagamento());
|
||||
return meseEscluso.findByCR(CR, 0, 0);
|
||||
}
|
||||
|
||||
public int getMesiPrimaRata() {
|
||||
DoubleOperator dp = new DoubleOperator((float)getPrimaRata());
|
||||
dp.divide(30.0F);
|
||||
return (int)dp.getResult();
|
||||
}
|
||||
|
||||
public Vectumerator<DocumentoScadenza> getScadenzeDocumento(long id_documento) {
|
||||
DocumentoScadenza dp = new DocumentoScadenza(getApFull());
|
||||
DoubleOperator dop = new DoubleOperator();
|
||||
DoubleOperator totaleRate = new DoubleOperator();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Calendar calBasePrimaRata = Calendar.getInstance();
|
||||
Vectumerator<DocumentoScadenza> vec = new Vectumerator();
|
||||
Documento bean = new Documento(getApFull());
|
||||
bean.findByPrimaryKey(id_documento);
|
||||
double totaleDaPagare = bean.getTotaleDocumento();
|
||||
if (bean.getClifor().getFlgSplitPayment() == 1L)
|
||||
totaleDaPagare = bean.getImponibileTotale();
|
||||
if (bean.getTipoPagamento().getFlgTipoPagamento() == 1L ||
|
||||
bean.getTipoPagamento().getFlgTipoPagamento() == 2L ||
|
||||
bean.getTipoPagamento().getFlgTipoPagamento() == 3L) {
|
||||
Vectumerator<MeseEscluso> vecme = bean.getTipoPagamento().getMesiEsclusi();
|
||||
dop.add(totaleDaPagare);
|
||||
dop.divide((float)bean.getTipoPagamento().getNRate());
|
||||
dop.setScale(2, 5);
|
||||
cal.setTime(bean.getDataDocumento());
|
||||
if (bean.getTipoPagamento().getFlgPrimaScadenza() == 1L) {
|
||||
cal.set(5, 1);
|
||||
cal.add(2, 1);
|
||||
cal.add(6, -1);
|
||||
}
|
||||
if (bean.getTipoPagamento().getMesiPrimaRata() > 0) {
|
||||
cal.set(5, 1);
|
||||
cal.add(2, bean.getTipoPagamento().getMesiPrimaRata() + 1);
|
||||
cal.add(6, -1);
|
||||
}
|
||||
calBasePrimaRata.setTimeInMillis(cal.getTimeInMillis());
|
||||
if (bean.getTipoPagamento().getGiornoFisso() > 0L) {
|
||||
cal.add(5, 1);
|
||||
cal.set(5, (int)bean.getTipoPagamento().getGiornoFisso());
|
||||
}
|
||||
long giorniEscluso = isMeseEscluso(vecme, cal);
|
||||
if (giorniEscluso > -1L) {
|
||||
cal.add(2, 1);
|
||||
cal.set(5, (int)giorniEscluso);
|
||||
}
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(new Date(cal.getTimeInMillis()));
|
||||
dp.setImportoScadenza(dop.getResult());
|
||||
totaleRate.add(dop.getResult());
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
for (int i = 0; (long)i < bean.getTipoPagamento().getNRate() - 1L; i++) {
|
||||
cal.setTimeInMillis(calBasePrimaRata.getTimeInMillis());
|
||||
if (bean.getTipoPagamento().getFlgPrimaScadenza() == 1L) {
|
||||
cal.set(5, 1);
|
||||
cal.add(2, (int)bean.getTipoPagamento().getPeriodicita() + 1);
|
||||
cal.add(6, -1);
|
||||
} else {
|
||||
cal.add(2, (int)bean.getTipoPagamento().getPeriodicita());
|
||||
}
|
||||
calBasePrimaRata.setTimeInMillis(cal.getTimeInMillis());
|
||||
if (bean.getTipoPagamento().getGiornoFisso() > 0L) {
|
||||
cal.add(5, 1);
|
||||
cal.set(5, (int)bean.getTipoPagamento().getGiornoFisso());
|
||||
}
|
||||
giorniEscluso = isMeseEscluso(vecme, cal);
|
||||
if (giorniEscluso > -1L) {
|
||||
cal.add(2, 1);
|
||||
cal.set(5, (int)giorniEscluso);
|
||||
}
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(new Date(cal.getTimeInMillis()));
|
||||
if ((long)i == bean.getTipoPagamento().getNRate() - 2L) {
|
||||
DoubleOperator rataFinale = new DoubleOperator(totaleDaPagare);
|
||||
rataFinale.subtract(totaleRate.getResult());
|
||||
rataFinale.setScale(2, 5);
|
||||
dp.setImportoScadenza(rataFinale.getResult());
|
||||
} else {
|
||||
dp.setImportoScadenza(dop.getResult());
|
||||
totaleRate.add(dop.getResult());
|
||||
}
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
}
|
||||
} else {
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(bean.getDataDocumento());
|
||||
dp.setImportoScadenza(totaleDaPagare);
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
|
||||
private long isMeseEscluso(Vectumerator<MeseEscluso> vec, Calendar cal) {
|
||||
long ret = -1L;
|
||||
vec.moveFirst();
|
||||
while (vec.hasMoreElements()) {
|
||||
MeseEscluso m = (MeseEscluso)vec.nextElement();
|
||||
if ((long)(cal.get(2) + 1) == m.getMeseEscluso()) {
|
||||
ret = m.getGiornoEscluso();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Vectumerator<DocumentoScadenza> getScadenzeDocumentoOld(long id_documento) {
|
||||
DocumentoScadenza dp = new DocumentoScadenza(getApFull());
|
||||
DoubleOperator dop = new DoubleOperator();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Vectumerator<DocumentoScadenza> vec = new Vectumerator();
|
||||
Documento bean = new Documento(getApFull());
|
||||
bean.findByPrimaryKey(id_documento);
|
||||
if (bean.getTipoPagamento().getFlgTipoPagamento() == 1L) {
|
||||
Vectumerator<MeseEscluso> vecme = bean.getTipoPagamento().getMesiEsclusi();
|
||||
dop.add(bean.getTotaleDocumento());
|
||||
dop.divide((float)bean.getTipoPagamento().getNRate());
|
||||
cal.setTime(bean.getDataDocumento());
|
||||
if (bean.getTipoPagamento().getFlgPrimaScadenza() == 1L) {
|
||||
cal.set(5, 1);
|
||||
cal.add(2, 1);
|
||||
cal.add(6, -1);
|
||||
}
|
||||
if (bean.getTipoPagamento().getMesiPrimaRata() > 0)
|
||||
cal.add(2, bean.getTipoPagamento().getMesiPrimaRata());
|
||||
if (bean.getTipoPagamento().getGiornoFisso() > 0L) {
|
||||
cal.add(5, 1);
|
||||
cal.set(5, (int)bean.getTipoPagamento().getGiornoFisso());
|
||||
}
|
||||
long giorniEscluso = isMeseEscluso(vecme, cal);
|
||||
if (giorniEscluso > -1L) {
|
||||
cal.add(2, 1);
|
||||
cal.set(5, (int)giorniEscluso);
|
||||
}
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(new Date(cal.getTimeInMillis()));
|
||||
dp.setImportoScadenza(dop.getResult());
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
for (int i = 0; (long)i < bean.getTipoPagamento().getNRate() - 1L; i++) {
|
||||
cal.add(2, (int)bean.getTipoPagamento().getPeriodicita());
|
||||
if (bean.getTipoPagamento().getFlgPrimaScadenza() == 1L) {
|
||||
cal.set(5, 1);
|
||||
cal.add(2, 1);
|
||||
cal.add(6, -1);
|
||||
}
|
||||
if (bean.getTipoPagamento().getGiornoFisso() > 0L) {
|
||||
cal.add(5, 1);
|
||||
cal.set(5, (int)bean.getTipoPagamento().getGiornoFisso());
|
||||
}
|
||||
giorniEscluso = isMeseEscluso(vecme, cal);
|
||||
if (giorniEscluso > -1L) {
|
||||
cal.add(2, 1);
|
||||
cal.set(5, (int)giorniEscluso);
|
||||
}
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(new Date(cal.getTimeInMillis()));
|
||||
dp.setImportoScadenza(dop.getResult());
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
}
|
||||
} else {
|
||||
dp = new DocumentoScadenza(getApFull());
|
||||
dp.setDataScadenza(bean.getDataDocumento());
|
||||
dp.setImportoScadenza(bean.getTotaleDocumento());
|
||||
dp.setId_documento(id_documento);
|
||||
vec.add(dp);
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
|
||||
public ResParm save() {
|
||||
if (getNRate() == 0L)
|
||||
setNRate(1L);
|
||||
if (getNRate() == 1L)
|
||||
setPeriodicita(0L);
|
||||
if (getNRate() > 1L && getPeriodicita() == 0L)
|
||||
setPeriodicita(1L);
|
||||
return super.save();
|
||||
}
|
||||
|
||||
public static final String getFEModalitaPagamento(long l_flgTipoPagamento) {
|
||||
switch ((int)l_flgTipoPagamento) {
|
||||
case 2:
|
||||
case 4:
|
||||
return "MP05";
|
||||
case 1:
|
||||
return "MP12";
|
||||
case 5:
|
||||
return "MP08";
|
||||
case 3:
|
||||
return "MP01";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getFEModalitaPagamento() {
|
||||
return getFEModalitaPagamento(getFlgTipoPagamento());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class TipoPagamentoCR extends CRAdapter {
|
||||
private long id_tipoPagamento;
|
||||
|
||||
private long periodicita;
|
||||
|
||||
private String descrizione_it;
|
||||
|
||||
private String descrizione_en;
|
||||
|
||||
private long flgTipoPagamento;
|
||||
|
||||
private long flgPrimaScadenza;
|
||||
|
||||
private long giornoFisso;
|
||||
|
||||
private long primaRata;
|
||||
|
||||
private long nRate;
|
||||
|
||||
private long flgWww = -1L;
|
||||
|
||||
public TipoPagamentoCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public TipoPagamentoCR() {}
|
||||
|
||||
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||
this.id_tipoPagamento = newId_tipoPagamento;
|
||||
}
|
||||
|
||||
public void setPeriodicita(long newPeriodicita) {
|
||||
this.periodicita = newPeriodicita;
|
||||
}
|
||||
|
||||
public void setDescrizione_it(String newDescrizione_it) {
|
||||
this.descrizione_it = newDescrizione_it;
|
||||
}
|
||||
|
||||
public void setDescrizione_en(String newDescrizione_en) {
|
||||
this.descrizione_en = newDescrizione_en;
|
||||
}
|
||||
|
||||
public void setFlgTipoPagamento(long newFlgTipoPagamento) {
|
||||
this.flgTipoPagamento = newFlgTipoPagamento;
|
||||
}
|
||||
|
||||
public void setFlgPrimaScadenza(long newFlgPrimaScadenza) {
|
||||
this.flgPrimaScadenza = newFlgPrimaScadenza;
|
||||
}
|
||||
|
||||
public void setGiornoFisso(long newGiornoFisso) {
|
||||
this.giornoFisso = newGiornoFisso;
|
||||
}
|
||||
|
||||
public void setPrimaRata(long newPrimaRata) {
|
||||
this.primaRata = newPrimaRata;
|
||||
}
|
||||
|
||||
public void setNRate(long newNRate) {
|
||||
this.nRate = newNRate;
|
||||
}
|
||||
|
||||
public long getId_tipoPagamento() {
|
||||
return this.id_tipoPagamento;
|
||||
}
|
||||
|
||||
public long getPeriodicita() {
|
||||
return this.periodicita;
|
||||
}
|
||||
|
||||
public String getDescrizione_it() {
|
||||
return (this.descrizione_it == null) ? "" :
|
||||
this.descrizione_it.trim();
|
||||
}
|
||||
|
||||
public String getDescrizione_en() {
|
||||
return (this.descrizione_en == null) ? "" :
|
||||
this.descrizione_en.trim();
|
||||
}
|
||||
|
||||
public long getFlgTipoPagamento() {
|
||||
return this.flgTipoPagamento;
|
||||
}
|
||||
|
||||
public long getFlgPrimaScadenza() {
|
||||
return this.flgPrimaScadenza;
|
||||
}
|
||||
|
||||
public long getGiornoFisso() {
|
||||
return this.giornoFisso;
|
||||
}
|
||||
|
||||
public long getPrimaRata() {
|
||||
return this.primaRata;
|
||||
}
|
||||
|
||||
public long getNRate() {
|
||||
return this.nRate;
|
||||
}
|
||||
|
||||
public String getWww() {
|
||||
return TipoPagamento.getWww(getFlgWww());
|
||||
}
|
||||
|
||||
public static final String getTipoPagamento(long l_flgTipoPagamento) {
|
||||
return TipoPagamento.getTipoPagamento(l_flgTipoPagamento);
|
||||
}
|
||||
|
||||
public long getFlgWww() {
|
||||
return this.flgWww;
|
||||
}
|
||||
|
||||
public void setFlgWww(long flgWww) {
|
||||
this.flgWww = flgWww;
|
||||
}
|
||||
|
||||
public static final String getWww(long l_flgWww) {
|
||||
return TipoPagamento.getWww(l_flgWww);
|
||||
}
|
||||
}
|
||||
122
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/UserClifor.java
Normal file
122
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/UserClifor.java
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class UserClifor extends _AnagAdapter {
|
||||
private long id_userClifor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Users users;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
public UserClifor() {}
|
||||
|
||||
public UserClifor(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public long getId_userClifor() {
|
||||
return this.id_userClifor;
|
||||
}
|
||||
|
||||
public void setId_userClifor(long id_userClifor) {
|
||||
this.id_userClifor = id_userClifor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
public void setId_users(long id_users) {
|
||||
this.id_users = id_users;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long id_clifor) {
|
||||
this.id_clifor = id_clifor;
|
||||
}
|
||||
|
||||
public Vectumerator findByUser(long l_id_users) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from USER_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.id_users = " + l_id_users);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByUserClifor(long l_id_users, long l_id_clifor) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from USER_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc(" A.id_users = " + l_id_users);
|
||||
wc.addWc(" A.id_clifor = " + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Users getUsers() {
|
||||
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class, getId_users());
|
||||
return this.users;
|
||||
}
|
||||
|
||||
public void setUsers(Users users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
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 ResParm save() {
|
||||
UserClifor uc = new UserClifor(getApFull());
|
||||
uc.findByUserClifor(getId_users(), getId_clifor());
|
||||
if (uc.getDBState() == 0)
|
||||
return super.save();
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
public Vectumerator findByCR(UserCliforCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from USER_CLIFOR AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
|
||||
public class UserCliforCR extends _AnagAdapter {
|
||||
private long id_userClifor;
|
||||
|
||||
private long id_users;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private Users users;
|
||||
|
||||
private Clifor clifor;
|
||||
|
||||
public UserCliforCR() {}
|
||||
|
||||
public UserCliforCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public long getId_userClifor() {
|
||||
return this.id_userClifor;
|
||||
}
|
||||
|
||||
public void setId_userClifor(long id_userClifor) {
|
||||
this.id_userClifor = id_userClifor;
|
||||
}
|
||||
|
||||
public long getId_users() {
|
||||
return this.id_users;
|
||||
}
|
||||
|
||||
public void setId_users(long id_users) {
|
||||
this.id_users = id_users;
|
||||
}
|
||||
|
||||
public long getId_clifor() {
|
||||
return this.id_clifor;
|
||||
}
|
||||
|
||||
public void setId_clifor(long id_clifor) {
|
||||
this.id_clifor = id_clifor;
|
||||
}
|
||||
|
||||
public Users getUsers() {
|
||||
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class, getId_users());
|
||||
return this.users;
|
||||
}
|
||||
|
||||
public void setUsers(Users users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public Clifor getClifor() {
|
||||
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||
getId_clifor());
|
||||
return this.clifor;
|
||||
}
|
||||
|
||||
public void setClifor(Clifor clifor) {
|
||||
this.clifor = clifor;
|
||||
}
|
||||
}
|
||||
2025
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Users.java
Normal file
2025
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Users.java
Normal file
File diff suppressed because it is too large
Load diff
29
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/UsersCR.java
Normal file
29
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/UsersCR.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
|
||||
public class UsersCR extends com.ablia.common.UsersCR {
|
||||
private long flgOperatore;
|
||||
|
||||
public UsersCR() {}
|
||||
|
||||
public UsersCR(com.ablia.common.Users theUser) {
|
||||
super(theUser);
|
||||
}
|
||||
|
||||
public UsersCR(ApplParmFull newAp) {
|
||||
super(newAp);
|
||||
}
|
||||
|
||||
public UsersCR(ApplParmFull newAp, com.ablia.common.Users theUser) {
|
||||
super(newAp, theUser);
|
||||
}
|
||||
|
||||
public long getFlgOperatore() {
|
||||
return this.flgOperatore;
|
||||
}
|
||||
|
||||
public void setFlgOperatore(long flgOperatore) {
|
||||
this.flgOperatore = flgOperatore;
|
||||
}
|
||||
}
|
||||
215
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Vettore.java
Normal file
215
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Vettore.java
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.fattele.FEDatiAnagraficiInterface;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Vettore extends _AnagAdapter implements Serializable, FEDatiAnagraficiInterface {
|
||||
private long id_vettore;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String nominativo;
|
||||
|
||||
private String numeroCivico;
|
||||
|
||||
private String pIva;
|
||||
|
||||
private String codFiscale;
|
||||
|
||||
private String iscrizioneAlbo;
|
||||
|
||||
private Comune comune;
|
||||
|
||||
private String linkTracking;
|
||||
|
||||
private String id_nazione;
|
||||
|
||||
private Nazione nazione;
|
||||
|
||||
public Vettore(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Vettore() {}
|
||||
|
||||
public void setId_vettore(long newId_vettore) {
|
||||
this.id_vettore = newId_vettore;
|
||||
}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setNominativo(String newNominativo) {
|
||||
this.nominativo = newNominativo;
|
||||
}
|
||||
|
||||
public void setNumeroCivico(String newNumeroCivico) {
|
||||
this.numeroCivico = newNumeroCivico;
|
||||
}
|
||||
|
||||
public long getId_vettore() {
|
||||
return this.id_vettore;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getNominativo() {
|
||||
return (this.nominativo == null) ? "" : this.nominativo.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivico() {
|
||||
return (this.numeroCivico == null) ? "" : this.numeroCivico.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 void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(VettoreCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from VETTORE 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void setLinkTracking(String newLinkTraking) {
|
||||
this.linkTracking = newLinkTraking;
|
||||
}
|
||||
|
||||
public String getLinkTracking() {
|
||||
return (this.linkTracking == null) ? "" : this.linkTracking;
|
||||
}
|
||||
|
||||
public String getPIva() {
|
||||
return (this.pIva == null) ? "" : this.pIva.trim();
|
||||
}
|
||||
|
||||
public void setPIva(String pIva) {
|
||||
this.pIva = pIva;
|
||||
}
|
||||
|
||||
public String getCodFiscale() {
|
||||
return (this.codFiscale == null) ? "" : this.codFiscale.trim();
|
||||
}
|
||||
|
||||
public void setCodFiscale(String codFiscale) {
|
||||
this.codFiscale = codFiscale;
|
||||
}
|
||||
|
||||
public String getIscrizioneAlbo() {
|
||||
return (this.iscrizioneAlbo == null) ? "" : this.iscrizioneAlbo.trim();
|
||||
}
|
||||
|
||||
public void setIscrizioneAlbo(String iscrizioneAlbo) {
|
||||
this.iscrizioneAlbo = iscrizioneAlbo;
|
||||
}
|
||||
|
||||
public String getFEPartitaIva() {
|
||||
return getPIva();
|
||||
}
|
||||
|
||||
public String getFECodiceFiscale() {
|
||||
return getCodFiscale();
|
||||
}
|
||||
|
||||
public String getFEDenominazione() {
|
||||
return getNominativo();
|
||||
}
|
||||
|
||||
public String getFECognome() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFENome() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFETitolo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFECodEORI() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFEPaese() {
|
||||
return getId_nazione();
|
||||
}
|
||||
|
||||
public String getId_nazione() {
|
||||
return (this.id_nazione == null) ? "" : this.id_nazione.trim();
|
||||
}
|
||||
|
||||
public Nazione getNazione() {
|
||||
this.nazione = (Nazione)getSecondaryObject(this.nazione, Nazione.class, getId_nazione());
|
||||
return this.nazione;
|
||||
}
|
||||
|
||||
public void setId_nazione(String newId_nazione) {
|
||||
this.id_nazione = newId_nazione;
|
||||
setNazione(null);
|
||||
}
|
||||
|
||||
public void setNazione(Nazione newNazione) {
|
||||
this.nazione = newNazione;
|
||||
}
|
||||
|
||||
public boolean isFEPaeseCEE() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
86
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/VettoreCR.java
Normal file
86
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/VettoreCR.java
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class VettoreCR extends CRAdapter {
|
||||
private long id_vettore;
|
||||
|
||||
private long id_comune;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String indirizzo;
|
||||
|
||||
private String nominativo;
|
||||
|
||||
private String numeroCivico;
|
||||
|
||||
private Comune comune;
|
||||
|
||||
public VettoreCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public VettoreCR() {}
|
||||
|
||||
public void setId_vettore(long newId_vettore) {
|
||||
this.id_vettore = newId_vettore;
|
||||
}
|
||||
|
||||
public void setId_comune(long newId_comune) {
|
||||
this.id_comune = newId_comune;
|
||||
setComune(null);
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public void setIndirizzo(String newIndirizzo) {
|
||||
this.indirizzo = newIndirizzo;
|
||||
}
|
||||
|
||||
public void setNominativo(String newNominativo) {
|
||||
this.nominativo = newNominativo;
|
||||
}
|
||||
|
||||
public void setNumeroCivico(String newNumeroCivico) {
|
||||
this.numeroCivico = newNumeroCivico;
|
||||
}
|
||||
|
||||
public long getId_vettore() {
|
||||
return this.id_vettore;
|
||||
}
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||
}
|
||||
|
||||
public String getNominativo() {
|
||||
return (this.nominativo == null) ? "" : this.nominativo.trim();
|
||||
}
|
||||
|
||||
public String getNumeroCivico() {
|
||||
return (this.numeroCivico == null) ? "" : this.numeroCivico.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;
|
||||
}
|
||||
}
|
||||
73
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Zona.java
Normal file
73
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Zona.java
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Zona extends DBAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1459504014751L;
|
||||
|
||||
private long id_zona;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public Zona(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public Zona() {}
|
||||
|
||||
public void setId_zona(long newId_zona) {
|
||||
this.id_zona = newId_zona;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_zona() {
|
||||
return this.id_zona;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator<Zona> findByCR(ZonaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from ZONA 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ZonaCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ZonaCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class ZonaCR extends CRAdapter {
|
||||
private long id_zona;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
public ZonaCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ZonaCR() {}
|
||||
|
||||
public void setId_zona(long newId_zona) {
|
||||
this.id_zona = newId_zona;
|
||||
}
|
||||
|
||||
public void setDescrizione(String newDescrizione) {
|
||||
this.descrizione = newDescrizione;
|
||||
}
|
||||
|
||||
public long getId_zona() {
|
||||
return this.id_zona;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||
}
|
||||
}
|
||||
926
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/_AnagAdapter.java
Normal file
926
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/_AnagAdapter.java
Normal file
|
|
@ -0,0 +1,926 @@
|
|||
package com.ablia.anag;
|
||||
|
||||
import com.ablia.cart.Cart;
|
||||
import com.ablia.common.SimboliLavaggio;
|
||||
import com.ablia.common.TtFont;
|
||||
import com.ablia.contab.TipoDocumento;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.util.PdfFontFactory;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.lowagie.text.Cell;
|
||||
import com.lowagie.text.Chunk;
|
||||
import com.lowagie.text.Document;
|
||||
import com.lowagie.text.Element;
|
||||
import com.lowagie.text.Font;
|
||||
import com.lowagie.text.Image;
|
||||
import com.lowagie.text.Table;
|
||||
import com.lowagie.text.pdf.PdfPCell;
|
||||
import com.lowagie.text.pdf.PdfPTable;
|
||||
import com.lowagie.text.pdf.PdfWriter;
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class _AnagAdapter extends DBAdapter {
|
||||
public static String KEY_ENCODE_DIZ = "Xg3Z5sFQ";
|
||||
|
||||
public static final long SF_BOZZA = 0L;
|
||||
|
||||
public static final long SF_EMESSA = 1L;
|
||||
|
||||
public static final long SF_REG_IVA = 2L;
|
||||
|
||||
public static final String P_SEISOFT_CONTO_RM_IVA_ESENTE = "SEISOFT_CONTO_RM_IVA_ESENTE";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_NOL_AZ = "SEISOFT_CONTO_NOL_AZ";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_RM_IVA_VEND = "SEISOFT_CONTO_RM_IVA_VEND";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_NOL_PRIV = "SEISOFT_CONTO_NOL_PRIV";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_SPESE = "SEISOFT_CONTO_SPESE";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_VEND_AZ = "SEISOFT_CONTO_VEND_AZ";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_VEND_PRIV = "SEISOFT_CONTO_VEND_PRIV";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_VEND_PRIV_USATO = "SEISOFT_CONTO_VEND_PRIV_USATO";
|
||||
|
||||
public static final String P_SEISOFT_CONTO_VEND_AZ_USATO = "SEISOFT_CONTO_VEND_AZ_USATO";
|
||||
|
||||
public static final String P_ORDINI_WEB_ORE_ANNULLAMENTO = "ORDINI_WEB_ORE_ANNULLAMENTO";
|
||||
|
||||
public static final String P_QTA_MINIMA_VISIBILE = "QTA_MINIMA_VISIBILE";
|
||||
|
||||
public static final String P_WEB_SEND_ORDER_MAIL_CODE = "WEB_SEND_ORDER_MAIL_CODE";
|
||||
|
||||
public static final String P_VARIANTI = "VARIANTI";
|
||||
|
||||
public static final String P_MSG_AVVISO_RIP_SMS = "MSG_AVVISO_RIP_SMS";
|
||||
|
||||
public static final String P_MAIL_INVIO_DOC = "MAIL_INVIO_DOC";
|
||||
|
||||
public static final String P_ART_SIMBOLI_LAVAGGIO_DEFAULT = "ART_SIMBOLI_LAVAGGIO_DEFAULT";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_ATTACH_PATH = "CODA_MESSAGGI_ATTACH_PATH";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_MAIL_FROM = "CODA_MESSAGGI_MAIL_FROM";
|
||||
|
||||
public static final String P_PATH_IMG_TIPO = "PATH_IMG_TIPO";
|
||||
|
||||
public static final String P_PATH_IMG_TAB_TAG = "PATH_IMG_TAB_TAG";
|
||||
|
||||
public static final String P_SERIALI_UNIVOCI = "SERIALI_UNIVOCI";
|
||||
|
||||
public static final String P_CASSA_STAMPA_DISPLAY1 = "CASSA_STAMPA_DISPLAY1";
|
||||
|
||||
public static final String P_CASSA_STAMPA_PROMO = "CASSA_STAMPA_PROMO";
|
||||
|
||||
public static final String P_AZIENDA_CODICE_SIA = "AZIENDA_CODICE_SIA";
|
||||
|
||||
public static final String P_AZIENDA_PIVA = "AZIENDA_PIVA";
|
||||
|
||||
public static final String P_PATH_FILE_RIBA = "PATH_FILE_RIBA";
|
||||
|
||||
public static final String P_CODICE_TIPO_TESSUTO_STD = "CODICE_TIPO_TESSUTO_STD";
|
||||
|
||||
public static final String P_ANAG_DESC_COMPLETA_CON_TIPO = "ANAG_DESC_COMPLETA_CON_TIPO";
|
||||
|
||||
protected static final float[] colWidthsRighe20 = new float[] {
|
||||
5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F,
|
||||
5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F, 5.0F };
|
||||
|
||||
protected static final float[] colWidthsRighe40 = new float[] {
|
||||
2.5F, 2.5F, 2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F,
|
||||
2.5F, 2.5F, 2.5F, 2.5F, 2.5F, 2.5F, 2.5F };
|
||||
|
||||
public static final Font PDF_fGrandissimo = PdfFontFactory.PDF_fGrandissimo;
|
||||
|
||||
public static final Font PDF_fGrandissimoB = PdfFontFactory.PDF_fGrandissimoB;
|
||||
|
||||
public static final Font PDF_fGrandissimoBianco = PdfFontFactory.PDF_fGrandissimoBianco;
|
||||
|
||||
public static final Font PDF_fGrandissimoBlu = PdfFontFactory.PDF_fGrandissimoBlu;
|
||||
|
||||
public static final Font PDF_fGrandissimoRouge = PdfFontFactory.PDF_fGrandissimoRouge;
|
||||
|
||||
public static final Font PDF_fGrande = PdfFontFactory.PDF_fGrande;
|
||||
|
||||
public static final Font PDF_fGrandeB = PdfFontFactory.PDF_fGrandeB;
|
||||
|
||||
public static final Font PDF_fGrandeBianco = PdfFontFactory.PDF_fGrandeBianco;
|
||||
|
||||
public static final Font PDF_fGrandeBlu = PdfFontFactory.PDF_fGrandeBlu;
|
||||
|
||||
public static final Font PDF_fGrandeRouge = PdfFontFactory.PDF_fGrandeRouge;
|
||||
|
||||
public static final Font PDF_fIntestazione = PdfFontFactory.PDF_fIntestazione;
|
||||
|
||||
public static final Font PDF_fMedio = PdfFontFactory.PDF_fMedio;
|
||||
|
||||
public static final Font PDF_fMedioB = PdfFontFactory.PDF_fMedioB;
|
||||
|
||||
public static final Font PDF_fMedioBianco = PdfFontFactory.PDF_fMedioBianco;
|
||||
|
||||
public static final Font PDF_fMedioBlu = PdfFontFactory.PDF_fMedioBlu;
|
||||
|
||||
public static final Font PDF_fMedioRosso = PdfFontFactory.PDF_fMedioRosso;
|
||||
|
||||
public static final Font PDF_fMedioRouge = PdfFontFactory.PDF_fMedioRouge;
|
||||
|
||||
public static final Font PDF_fPiccolissimo = PdfFontFactory.PDF_fPiccolissimo;
|
||||
|
||||
public static final Font PDF_fPiccolissimo6 = PdfFontFactory.PDF_fPiccolissimo6;
|
||||
|
||||
public static final Font PDF_fPiccolissimoB = PdfFontFactory.PDF_fPiccolissimoB;
|
||||
|
||||
public static final Font PDF_fPiccolo = PdfFontFactory.PDF_fPiccolo;
|
||||
|
||||
public static final Font PDF_fPiccoloB = PdfFontFactory.PDF_fPiccoloB;
|
||||
|
||||
public static final Font PDF_fPiccoloBianco = PdfFontFactory.PDF_fPiccoloBianco;
|
||||
|
||||
public static final Font PDF_fPiccoloBlu = PdfFontFactory.PDF_fPiccoloBlu;
|
||||
|
||||
public static final Font PDF_fPiccoloRosso = PdfFontFactory.PDF_fPiccoloRosso;
|
||||
|
||||
public static final Font PDF_H_Grandissimo = PdfFontFactory.PDF_H_Grandissimo;
|
||||
|
||||
public static final Font PDF_H_GrandissimoB = PdfFontFactory.PDF_H_GrandissimoB;
|
||||
|
||||
public static final Font PDF_H_GrandissimoBianco = PdfFontFactory.PDF_H_GrandissimoBianco;
|
||||
|
||||
public static final Font PDF_H_GrandissimoBlu = PdfFontFactory.PDF_H_GrandissimoBlu;
|
||||
|
||||
public static final Font PDF_H_GrandissimoRouge = PdfFontFactory.PDF_H_GrandissimoRouge;
|
||||
|
||||
public static final Font PDF_H_Grande = PdfFontFactory.PDF_H_Grande;
|
||||
|
||||
public static final Font PDF_H_GrandeB = PdfFontFactory.PDF_H_GrandeB;
|
||||
|
||||
public static final Font PDF_H_GrandeBianco = PdfFontFactory.PDF_H_GrandeBianco;
|
||||
|
||||
public static final Font PDF_H_GrandeBlu = PdfFontFactory.PDF_H_GrandeBlu;
|
||||
|
||||
public static final Font PDF_H_GrandeRouge = PdfFontFactory.PDF_H_GrandeRouge;
|
||||
|
||||
public static final Font PDF_H_Intestazione = PdfFontFactory.PDF_H_Intestazione;
|
||||
|
||||
public static final Font PDF_H_Medio = PdfFontFactory.PDF_H_Medio;
|
||||
|
||||
public static final Font PDF_H_MedioB = PdfFontFactory.PDF_H_MedioB;
|
||||
|
||||
public static final Font PDF_H_MedioBianco = PdfFontFactory.PDF_H_MedioBianco;
|
||||
|
||||
public static final Font PDF_H_MedioBlu = PdfFontFactory.PDF_H_MedioBlu;
|
||||
|
||||
public static final Font PDF_H_MedioRosso = PdfFontFactory.PDF_H_MedioRosso;
|
||||
|
||||
public static final Font PDF_H_MedioRouge = PdfFontFactory.PDF_H_MedioRouge;
|
||||
|
||||
public static final Font PDF_H_Piccolissimo = PdfFontFactory.PDF_H_Piccolissimo;
|
||||
|
||||
public static final Font PDF_H_Piccolissimo6 = PdfFontFactory.PDF_H_Piccolissimo6;
|
||||
|
||||
public static final Font PDF_A_PiccolissimoB = PdfFontFactory.PDF_A_PiccolissimoB;
|
||||
|
||||
public static final Font PDF_A_Piccolo = PdfFontFactory.PDF_A_Piccolo;
|
||||
|
||||
public static final Font PDF_A_PiccoloB = PdfFontFactory.PDF_A_PiccoloB;
|
||||
|
||||
public static final Font PDF_A_PiccoloBianco = PdfFontFactory.PDF_A_PiccoloBianco;
|
||||
|
||||
public static final Font PDF_A_PiccoloBlu = PdfFontFactory.PDF_A_PiccoloBlu;
|
||||
|
||||
public static final Font PDF_A_PiccoloRosso = PdfFontFactory.PDF_A_PiccoloRosso;
|
||||
|
||||
protected PdfPTable pdfPcorpo;
|
||||
|
||||
protected Document document;
|
||||
|
||||
protected PdfWriter writer;
|
||||
|
||||
protected PdfPCell blankCell = new PdfPCell();
|
||||
|
||||
protected Table pdfcorpo;
|
||||
|
||||
public static final String P_ORDINI_WWW_USA_PROG_WWW = "ORDINI_WWW_USA_PROG_WWW";
|
||||
|
||||
public static final String P_ID_DOC_CASSA = "ID_DOC_CASSA";
|
||||
|
||||
public static final String P_LABEL_ANAG_A4_MARGINE = "LABEL_ANAG_A4_MARGINE";
|
||||
|
||||
public static final String P_LABEL_ANAG_A4_COL_ROW = "LABEL_ANAG_A4_COL_ROW";
|
||||
|
||||
public static final String P_LABEL_ART_A4_MARGINE = "LABEL_ART_A4_MARGINE";
|
||||
|
||||
public static final String P_LABEL_ART_A4_COL_ROW = "LABEL_ART_A4_COL_ROW";
|
||||
|
||||
public static final String P_LABEL_PK_LIST_A4_ZEBRA = "LABEL_PK_LIST_A4_ZEBRA";
|
||||
|
||||
public static final String P_LABEL_PK_LIST_A4_COL_ROW = "LABEL_PK_LIST_A4_COL_ROW";
|
||||
|
||||
public static final String P_LABEL_PK_LIST_A4_MARGINE = "LABEL_PK_LIST_A4_MARGINE";
|
||||
|
||||
public static final String P_LABEL_ART_FONT_SIZE = "LABEL_ART_FONT_SIZE";
|
||||
|
||||
public static final String P_LABEL_ART_SIZE = "LABEL_ART_SIZE";
|
||||
|
||||
public static final String P_SCONTO_3_PERCENTUALI = "SCONTO_3_PERCENTUALI";
|
||||
|
||||
public static final String P_STAMPA_BORDI_COLONNE_DOCUMENTO = "STAMPA_BORDI_COLONNE_DOCUMENTO";
|
||||
|
||||
public static final String P_DATA_FATTURA_PRIMA_DISPONIBILE = "DATA_FATTURA_PRIMA_DISPONIBILE";
|
||||
|
||||
public static final String P_DOC_POSIZIONE_NOTA = "DOC_POSIZIONE_NOTA";
|
||||
|
||||
public static final String P_BLOCCO_FATTURE_EMSTA = "BLOCCO_FATTURE_EMSTA";
|
||||
|
||||
public static final String P_DOC_BANCA_APPOGGIO_IBAN = "DOC_BANCA_APPOGGIO_IBAN";
|
||||
|
||||
public static final String P_DOC_BANCA_APPOGGIO_DESC = "DOC_BANCA_APPOGGIO_DESC";
|
||||
|
||||
public static final String P_USA_MAGAZZINO_SU_ARTICOLI = "USA_MAGAZZINO";
|
||||
|
||||
public static final String P_STORNO_ORDINE_A_FORNITORE = "STORNO_ORDINE_A_FORNITORE";
|
||||
|
||||
public static final Font PDF_fMedioGrigio = PdfFontFactory.PDF_fMedioGrigio;
|
||||
|
||||
public static final String P_CODA_MESSAGGI_USE_OPEN_TAG = "CODA_MESSAGGI_USE_OPEN_TAG";
|
||||
|
||||
public static final String P_CASSA_STAMPA_DISPLAY = "CASSA_STAMPA_DISPLAY";
|
||||
|
||||
public static final String P_TAGLIE = "TAGLIE";
|
||||
|
||||
public static final String P_PROGETTISTA_ARTICOLO = "PROGETTISTA_ARTICOLO";
|
||||
|
||||
public static final String P_CASSA_STAMPA_DISPLAY_TIMEOUT = "CASSA_STAMPA_DISPLAY_TIMEOUT";
|
||||
|
||||
public static final String P_DOC_BCC = "DOC_BCC";
|
||||
|
||||
public static final String P_OTTIMIZZO = "OTTIMIZZO";
|
||||
|
||||
public static final String P_PATH_IMG_ART = "PATH_IMG_ART";
|
||||
|
||||
public static final String P_MSG_ORDINE_SPEDITO = "MSG_ORDINE_SPEDITO";
|
||||
|
||||
public static final String P_ID_DOC_ORDINE = "ID_DOC_ORDINE";
|
||||
|
||||
public static final String P_ID_DOC_ORDINE_TAGLIO = "ID_DOC_ORDINE_TAGLIO";
|
||||
|
||||
public static final String P_LABEL_ART_ACC_FONT_SIZE = "LABEL_ART_ACC_FONT_SIZE";
|
||||
|
||||
public static final String P_LABEL_ART_A4_ZEBRA = "LABEL_ART_A4_ZEBRA";
|
||||
|
||||
public static final String P_LABEL_PK_LIST_FONT_SIZE = "LABEL_PK_LIST_FONT_SIZE";
|
||||
|
||||
public static final String P_LABEL_ANAG_SIZE = "LABEL_ANAG_SIZE";
|
||||
|
||||
public static final String P_LABEL_PK_LIST_SIZE = "LABEL_PK_LIST_SIZE";
|
||||
|
||||
public static final String P_LABEL_ANAG_FONT_SIZE = "LABEL_ANAG_FONT_SIZE";
|
||||
|
||||
public static final String P_ART_ATTACH_PATH = "ART_ATTACH_PATH";
|
||||
|
||||
public static final String P_TMPL_MSG_ATTACH_PATH = "TMPL_MSG_ATTACH_PATH";
|
||||
|
||||
public static final String P_MAIL_ADMIN_SCAD_CI = "MAIL_ADMIN_SCAD_CI";
|
||||
|
||||
public static final String P_ID_DOC_ORDINE_WWW = "ID_DOC_ORDINE_WWW";
|
||||
|
||||
public static final String P_ID_DOC_FT_NOLEGGIO = "ID_DOC_FT_NOLEGGIO";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_SMS_DELAY = "CODA_MESSAGGI_SMS_DELAY";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_USE_EMBEDDED_IMG = "CODA_MESSAGGI_USE_EMBEDDED_IMG";
|
||||
|
||||
public static final String CODA_MESSAGGI_IMG_MSG = "_img/_imgMsg";
|
||||
|
||||
public static final String P_MAILING_LIST_ON = "MAIL_LIST_ON";
|
||||
|
||||
public static final String P_CLIFOR_ATTACH_PATH = "CLIFOR_ATTACH_PATH";
|
||||
|
||||
public static final String P_DOC_ATTACH_PATH = "DOC_ATTACH_PATH";
|
||||
|
||||
public static final String P_PATH_IMG_BANNER = "PATH_IMG_BANNER";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_EMAIL_DELAY = "CODA_MESSAGGI_EMAIL_DELAY";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_IMG_URL_BASE = "CODA_MESSAGGI_IMG_URL_BASE";
|
||||
|
||||
public static final String P_SMS_SERVER = "SMS_SERVER";
|
||||
|
||||
public static final String P_CODA_MESSAGGI_PATH_IMG_MSG = "CODA_MESSAGGI_PATH_IMG_MSG";
|
||||
|
||||
public static final String P_MAILING_LIST_MAIL_CR = "MAIL_LIST_MAIL_CR";
|
||||
|
||||
public static final String P_MAILING_LIST_FILE_CR = "MAIL_LIST_FILE_CR";
|
||||
|
||||
public static final String P_MSG_AVVISO_PREN_EMAIL = "MSG_AVVISO_PREN_EMAIL";
|
||||
|
||||
public static final String P_MSG_AVVISO_PREN_SMS = "MSG_AVVISO_PREN_SMS";
|
||||
|
||||
public static final String P_RIP_NOTA_SCHEDA_RIPARAZIONE = "RIP_NOTA_SCHEDA_RIPARAZIONE";
|
||||
|
||||
public static final String P_RIP_NOTA_ACCETTAZIONE_PREVENTIVO = "RIP_NOTA_ACCETTAZIONE_PREVENTIVO";
|
||||
|
||||
public static final String P_DOC_ARTICOLI_CON_CODICE = "DOC_ARTICOLI_CON_CODICE";
|
||||
|
||||
public static final String P_ID_DOC_RIPARAZIONE = "ID_DOC_RIPARAZIONE";
|
||||
|
||||
public static final String P_MSG_AVVISO_RIP_EMAIL = "MSG_AVVISO_RIP_EMAIL";
|
||||
|
||||
public static final String P_HEAD_SLIP = "HEAD_SLIP";
|
||||
|
||||
public static final String P_ID_DOC_PRENOTAZIONE = "ID_DOC_PRENOTAZIONE";
|
||||
|
||||
public static final String P_ID_DOC_RICEVUTA = "ID_DOC_RICEVUTA";
|
||||
|
||||
public static final String P_COSTO_STIRO_DEFAULT = "COSTO_STIRO_DEFAULT";
|
||||
|
||||
public static final String P_COSTO_SPESE_FISSE_DEFAULT = "COSTO_SPESE_FISSE_DEFAULT";
|
||||
|
||||
public static final String P_PERC_RICARICO_DEFAULT = "PERC_RICARICO_DEFAULT";
|
||||
|
||||
public static final String P_DOC_FONT_ROW_SIZE = "DOC_FONT_ROW_SIZE";
|
||||
|
||||
public static final String P_PERC_RIT_ACCONTO = "PERC_RITENUTA_ACCONTO";
|
||||
|
||||
public static final String P_PERC_CONT_INTEGRATIVO = "PERC_CONT_INTEGRATIVO";
|
||||
|
||||
public static final String P_SMS_PORT = "SMS_PORT";
|
||||
|
||||
public static final String P_SMS_PDU = "SMS_PDU";
|
||||
|
||||
public static final String P_IMPORT_FILE = "ART_IMPORT_FILE";
|
||||
|
||||
public static final String P_MSG_EMAIL_FROM = "MSG_EMAIL_FROM";
|
||||
|
||||
public static final String P_PREZZO_CON_IVA = "PREZZO_CON_IVA";
|
||||
|
||||
public static final Font PDF_fPiccolissimo4B = PdfFontFactory.PDF_fPiccolissimo4B;
|
||||
|
||||
public static final Font PDF_fPiccolissimo5 = PdfFontFactory.PDF_fPiccolissimo5;
|
||||
|
||||
public static final Font PDF_fPiccolissimo6B = PdfFontFactory.PDF_fPiccolissimo6B;
|
||||
|
||||
public static final Font PDF_fPiccolissimo4 = PdfFontFactory.PDF_fPiccolissimo4;
|
||||
|
||||
public static final Font PDF_fPiccolissimo5B = PdfFontFactory.PDF_fPiccolissimo5B;
|
||||
|
||||
public static final String P_DESC_SCONTRINO_FULL = "DESC_SCONTRINO_FULL";
|
||||
|
||||
public static final String P_TAGLIE_LINGUE = "TAGLIE_LINGUE";
|
||||
|
||||
public static final String P_DOC_LEADROW = "DOC_LEADROW";
|
||||
|
||||
public static final String P_DOC_FIRMA_INVIO_FATTURA = "DOC_FIRMA_INVIO_FATTURA";
|
||||
|
||||
public static final String P_HEAD_DOC = "HEAD_DOC";
|
||||
|
||||
public static final String P_TIPO_PAG_SCONTRINO_CON_FATTURA = "TIPO_PAG_SC_CON_FT";
|
||||
|
||||
public static final String P_FOOT_DOC = "FOOT_DOC";
|
||||
|
||||
public static final String P_ESERCIZIO = "ESERCIZIO";
|
||||
|
||||
public static final String P_DBNAME2 = "DBNAME2";
|
||||
|
||||
public static final String P_DBDRIVER2 = "DBDRIVER2";
|
||||
|
||||
public static final String P_USER2 = "USER2";
|
||||
|
||||
public static final String P_PASSWORD2 = "PASSWORD2";
|
||||
|
||||
public static final String P_TESSUTI = "TESSUTI";
|
||||
|
||||
public static final String P_IMMOBILI = "IMMOBILI";
|
||||
|
||||
public static final String P_ASTE = "ASTE";
|
||||
|
||||
public static final String P_DESTINAZIONE = "DESTINAZIONE";
|
||||
|
||||
public static final String P_STAMPA_NOME_DOCUMENTO = "STAMPA_NOME_DOCUMENTO";
|
||||
|
||||
public static final String P_STAMPA_INDENTAZIONE = "STAMPA_INDENTAZIONE";
|
||||
|
||||
public static final String P_SMS_URL = "SMS_URL";
|
||||
|
||||
public static final String P_SMS_USER = "SMS_USER";
|
||||
|
||||
public static final String P_SMS_PASS = "SMS_PASS";
|
||||
|
||||
public static final String P_TIPO_FATTURE_VENDITA = "TIPO_FATTURE_VENDITA";
|
||||
|
||||
public static final String P_TIPO_FATTURE_ACQUISTO = "TIPO_FATTURE_ACQUISTO";
|
||||
|
||||
public static final String P_RIGA_DOC_CODICE_ARTICOLO_ESPLICITO = "RIGA_DOC_CODICE_ARTICOLO_ESPLICITO";
|
||||
|
||||
public static final String P_AGENTI_ON = "AGENTI_ON";
|
||||
|
||||
public static final String P_ATR_ON = "ATR_ON";
|
||||
|
||||
public static final String P_FATTURA_ELETTRONICA_ON = "FATTURA_ELETTRONICA_ON";
|
||||
|
||||
public static final String P_MNU_DOC_STD = "MNU_DOC_STD";
|
||||
|
||||
public static final String P_MNU_COAVE = "MNU_COAVE";
|
||||
|
||||
public static final String P_MNU_TESSITURA = "MNU_TESSITURA";
|
||||
|
||||
public static final String P_MNU_NEWSLETTER = "MNU_NEWSLETTER";
|
||||
|
||||
public static final String P_MNU_NEWS = "MNU_NEWS";
|
||||
|
||||
public static final String P_MNU_FILATI = "MNU_FILATI";
|
||||
|
||||
public static final String P_MNU_CONFEZIONE = "MNU_CONFEZIONE";
|
||||
|
||||
public static final String P_MNU_LAVORAZIONI = "MNU_LAVORAZIONI";
|
||||
|
||||
public static final String P_MNU_TESSUTI = "MNU_TESSUTI";
|
||||
|
||||
public static final String P_MNU_BANNER = "MNU_BANNER";
|
||||
|
||||
public static final String P_MNU_CONTRATTI = "MNU_CONTRATTI";
|
||||
|
||||
public static final String P_MNU_WWW = "MNU_WWW";
|
||||
|
||||
public static final String P_MNU_CONFIG_ANAG = "MNU_CONFIG_ANAG";
|
||||
|
||||
public static final String P_MNU_CONFIG_ART = "MNU_CONFIG_ART";
|
||||
|
||||
public static final String P_MNU_CONFIG_CONTAB = "MNU_CONFIG_CONTAB";
|
||||
|
||||
public static final String P_MNU_CONFIG_ADMIN = "MNU_CONFIG_ADMIN";
|
||||
|
||||
public static final String P_MNU_GEST_ARTICOLI = "MNU_GEST_ARTICOLI";
|
||||
|
||||
public static final String P_MNU_GEST_CONTATTI = "MNU_GEST_CONTATTI";
|
||||
|
||||
public static final String P_MNU_GEST_SCADENZE = "MNU_GEST_SCADENZE";
|
||||
|
||||
public static final String P_MNU_GEST_PAGAMENTI = "MNU_GEST_PAGAMENTI";
|
||||
|
||||
public static final String P_MNU_GEST_RIBA = "MNU_GEST_RIBA";
|
||||
|
||||
public static final String P_MNU_M_DOC_STD = "MNU_M_DOC_STD";
|
||||
|
||||
public static final String P_MNU_M_COAVE = "MNU_M_COAVE";
|
||||
|
||||
public static final String P_MNU_M_CASSA = "MNU_M_CASSA";
|
||||
|
||||
public static final String P_MNU_M_PRENOTAZIONI = "MNU_M_PRENOTAZIONI";
|
||||
|
||||
public static final String P_MNU_M_EBAY = "MNU_M_EBAY";
|
||||
|
||||
public static final String P_MNU_M_RIPARAZIONI = "MNU_M_RIPARAZIONI";
|
||||
|
||||
public static final String P_MNU_M_ORDINI = "MNU_M_ORDINI";
|
||||
|
||||
public static final String P_MNU_M_FILATI = "MNU_M_FILATI";
|
||||
|
||||
public static final String P_MNU_M_CONFEZIONE = "MNU_M_CONFEZIONE";
|
||||
|
||||
public static final String P_MNU_M_TESSUTI = "MNU_M_TESSUTI";
|
||||
|
||||
public static final String P_MNU_M_TESSITURA = "MNU_M_TESSITURA";
|
||||
|
||||
public static final String P_MNU_M_ARTICOLI = "MNU_M_ARTICOLI";
|
||||
|
||||
public _AnagAdapter() {}
|
||||
|
||||
public _AnagAdapter(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public long getCodiceIvaEsente() {
|
||||
return getParm("CODICE_IVA_ESENTE").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getCurrentEsercizio() {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
return (long)cal.get(1);
|
||||
}
|
||||
|
||||
protected String getAdminMail() {
|
||||
String temp = getParm("BCC").getTesto();
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected boolean useNullFor0() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected String getCheckOutMailMessage(String lang) {
|
||||
String temp = getParm(Cart.P_CHECKOUTMSG).getTesto();
|
||||
if (lang != null && !lang.isEmpty()) {
|
||||
int dot = temp.lastIndexOf(".");
|
||||
if (dot > 0)
|
||||
temp = String.valueOf(temp.substring(0, dot)) + "_" + lang.toLowerCase() + temp.substring(dot);
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected String getAllarmeOrdineEbayMessage() {
|
||||
return "/mailMessage/allarmeEbay.html";
|
||||
}
|
||||
|
||||
protected String getResoMailMessage(String lang) {
|
||||
String temp = getParm(Cart.P_RESOMSG).getTesto();
|
||||
if (lang != null && !lang.isEmpty()) {
|
||||
int dot = temp.lastIndexOf(".");
|
||||
if (dot > 0)
|
||||
temp = String.valueOf(temp.substring(0, dot)) + "_" + lang.toLowerCase() + temp.substring(dot);
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected void prepareNewPdfPcorpoDocument() {
|
||||
try {
|
||||
this.pdfPcorpo = new PdfPTable(40);
|
||||
this.pdfPcorpo.setWidthPercentage(100.0F);
|
||||
this.pdfPcorpo.setWidths(colWidthsRighe40);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public PdfPTable getPdfPcorpo() {
|
||||
return this.pdfPcorpo;
|
||||
}
|
||||
|
||||
public void setPdfPcorpo(PdfPTable corpo) {
|
||||
this.pdfPcorpo = corpo;
|
||||
}
|
||||
|
||||
public Document getDocument() {
|
||||
return this.document;
|
||||
}
|
||||
|
||||
public void setDocument(Document document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public PdfWriter getWriter() {
|
||||
return this.writer;
|
||||
}
|
||||
|
||||
public void setWriter(PdfWriter writer) {
|
||||
this.writer = writer;
|
||||
}
|
||||
|
||||
protected void prepareNewPdfCorpoDocument() {
|
||||
this.pdfcorpo = getNewPdfCorpoDocument();
|
||||
}
|
||||
|
||||
protected Table getNewPdfCorpoDocument() {
|
||||
Table l_pdfcorpo = null;
|
||||
try {
|
||||
l_pdfcorpo = new Table(40);
|
||||
l_pdfcorpo.setWidth(100.0F);
|
||||
l_pdfcorpo.setBorder(0);
|
||||
l_pdfcorpo.setBorderWidth(0.0F);
|
||||
l_pdfcorpo.setBorderColor(new Color(255, 255, 255));
|
||||
l_pdfcorpo.setPadding(2.0F);
|
||||
l_pdfcorpo.setSpacing(0.0F);
|
||||
l_pdfcorpo.setWidths(colWidthsRighe40);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e, 2);
|
||||
}
|
||||
return l_pdfcorpo;
|
||||
}
|
||||
|
||||
public Table getPdfcorpo() {
|
||||
return this.pdfcorpo;
|
||||
}
|
||||
|
||||
public void setPdfcorpo(Table pdfcorpo) {
|
||||
this.pdfcorpo = pdfcorpo;
|
||||
}
|
||||
|
||||
public TipoPagamento getTipoPagamentoScontrinoConFattura() {
|
||||
TipoPagamento tp = new TipoPagamento(getApFull());
|
||||
tp.findByPrimaryKey(getParm("TIPO_PAG_SC_CON_FT").getNumeroLong());
|
||||
return tp;
|
||||
}
|
||||
|
||||
protected int getDocFontRowSize() {
|
||||
return getParm("DOC_FONT_ROW_SIZE").getNumeroInt();
|
||||
}
|
||||
|
||||
protected int getDocFontRowSize(TipoDocumento tipoDocumento) {
|
||||
if (tipoDocumento.getDocFontSizeRow() > 0L)
|
||||
return (int)tipoDocumento.getDocFontSizeRow();
|
||||
return getParm("DOC_FONT_ROW_SIZE").getNumeroInt();
|
||||
}
|
||||
|
||||
protected int getDocLeadRow() {
|
||||
return getParm("DOC_LEADROW").getNumeroInt();
|
||||
}
|
||||
|
||||
protected long getDocPosizioneNota() {
|
||||
return getParm("DOC_POSIZIONE_NOTA").getNumeroLong();
|
||||
}
|
||||
|
||||
public boolean usaPrezzoConIva() {
|
||||
return getParm("PREZZO_CON_IVA").isTrue();
|
||||
}
|
||||
|
||||
protected int getImgLogoWidth() {
|
||||
return (int)getDocLogoWidth();
|
||||
}
|
||||
|
||||
public String getMailSubject() {
|
||||
if (getApFull() == null)
|
||||
return "";
|
||||
return getApFull().getResource("SUBJECT");
|
||||
}
|
||||
|
||||
protected SimboliLavaggio getSimboliLavaggioDefault() {
|
||||
String temp = getParm("ART_SIMBOLI_LAVAGGIO_DEFAULT").getTesto();
|
||||
if (temp.isEmpty())
|
||||
return null;
|
||||
try {
|
||||
SimboliLavaggio simboliLavaggio = new SimboliLavaggio();
|
||||
StringTokenizer st = new StringTokenizer(temp, ",");
|
||||
if (st.hasMoreTokens()) {
|
||||
temp = st.nextToken().trim();
|
||||
simboliLavaggio.setLavaggio(Long.valueOf(temp).longValue());
|
||||
}
|
||||
if (st.hasMoreTokens()) {
|
||||
temp = st.nextToken().trim();
|
||||
simboliLavaggio.setCandeggio(Long.valueOf(temp).longValue());
|
||||
}
|
||||
if (st.hasMoreTokens()) {
|
||||
temp = st.nextToken().trim();
|
||||
simboliLavaggio.setAsciugatura(Long.valueOf(temp).longValue());
|
||||
}
|
||||
if (st.hasMoreTokens()) {
|
||||
temp = st.nextToken().trim();
|
||||
simboliLavaggio.setStiratura(Long.valueOf(temp).longValue());
|
||||
}
|
||||
if (st.hasMoreTokens()) {
|
||||
temp = st.nextToken().trim();
|
||||
simboliLavaggio.setPulituraSecco(Long.valueOf(temp).longValue());
|
||||
}
|
||||
return simboliLavaggio;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected String getMessaggioAvvisoRiparazioneEmail() {
|
||||
return getParm("MSG_AVVISO_RIP_EMAIL").getTesto();
|
||||
}
|
||||
|
||||
public String getMessaggioDocumentiEmailFrom() {
|
||||
return getParm("MSG_EMAIL_FROM").getTesto();
|
||||
}
|
||||
|
||||
protected String getMessaggioAvvisoPrenotazioneSms() {
|
||||
return getParm("MSG_AVVISO_PREN_SMS").getTesto();
|
||||
}
|
||||
|
||||
protected String getMessaggioAvvisoRiparazioneSms() {
|
||||
return getParm("MSG_AVVISO_RIP_SMS").getTesto();
|
||||
}
|
||||
|
||||
protected String getSmsServer() {
|
||||
return getParm("SMS_SERVER").getTesto();
|
||||
}
|
||||
|
||||
protected int getSmsPort() {
|
||||
return getParm("SMS_PORT").getNumeroInt();
|
||||
}
|
||||
|
||||
protected float getRectDocumentoH(String L_TIPO) {
|
||||
return getRectDocumento(L_TIPO, 3);
|
||||
}
|
||||
|
||||
private float getRectDocumento(String L_TIPO, int theVaule) {
|
||||
StringTokenizer temp = new StringTokenizer(getParm(L_TIPO).getTesto(), ",");
|
||||
if (temp.countToken() != 4)
|
||||
return 0.0F;
|
||||
try {
|
||||
return Float.parseFloat(temp.getToken(theVaule));
|
||||
} catch (Exception e) {
|
||||
handleDebug(e, 2);
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
protected float getRectDocumentoY(String L_TIPO) {
|
||||
return getRectDocumento(L_TIPO, 1);
|
||||
}
|
||||
|
||||
protected float getRectDocumentoW(String L_TIPO) {
|
||||
return getRectDocumento(L_TIPO, 2);
|
||||
}
|
||||
|
||||
protected float getRectDocumentoX(String L_TIPO) {
|
||||
return getRectDocumento(L_TIPO, 0);
|
||||
}
|
||||
|
||||
protected boolean isSmsPdu() {
|
||||
return (getParm("SMS_PDU").getNumeroInt() == 1);
|
||||
}
|
||||
|
||||
public Font getFont(String baseFont, int size, int type, Color theColor) {
|
||||
return TtFont.getInstance(getApFull()).getFont(baseFont, size, type, theColor);
|
||||
}
|
||||
|
||||
protected int getStringValueCase(String l_colomnName) {
|
||||
return super.getStringValueCase(l_colomnName);
|
||||
}
|
||||
|
||||
protected long getId_docCassa() {
|
||||
return getParm("ID_DOC_CASSA").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docOrdine() {
|
||||
return getParm("ID_DOC_ORDINE").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getId_docOrdineTaglio() {
|
||||
return getParm("ID_DOC_ORDINE_TAGLIO").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docPrenotazione() {
|
||||
return getParm("ID_DOC_PRENOTAZIONE").getNumeroLong();
|
||||
}
|
||||
|
||||
protected long getId_docRiparazione() {
|
||||
return getParm("ID_DOC_RIPARAZIONE").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getCodiceIvaArt8() {
|
||||
return getParm("CODICE_IVA_ART8").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getCodiceIvaRegimeMargine() {
|
||||
return getParm("CODICE_IVA_REGIME_MARGINE").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getCodiceIvaVendStd() {
|
||||
return getParm("CODICE_IVA_STD_VEND").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getCodiceTipoTessutoStandard() {
|
||||
return getParm("CODICE_TIPO_TESSUTO_STD").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getCodiceIvaReverseCharge() {
|
||||
return getParm("CODICE_IVA_REVERSE_CHARGE").getNumeroLong();
|
||||
}
|
||||
|
||||
public String getPathAllegato() {
|
||||
return String.valueOf(getDocBase()) + getParm("CLIFOR_ATTACH_PATH").getTesto();
|
||||
}
|
||||
|
||||
public long getId_docOrdineWWW() {
|
||||
return getParm("ID_DOC_ORDINE_WWW").getNumeroLong();
|
||||
}
|
||||
|
||||
public long getId_docFtNoleggio() {
|
||||
return getParm("ID_DOC_FT_NOLEGGIO").getNumeroLong();
|
||||
}
|
||||
|
||||
public boolean isPercentualiSconto3() {
|
||||
return getParm("SCONTO_3_PERCENTUALI").isTrue();
|
||||
}
|
||||
|
||||
protected Document creaIntestazioneReportPdfPTable(String titolo, String sottoTitolo) {
|
||||
int cellLeading = 12;
|
||||
int pdfCorpoPadding = 2;
|
||||
try {
|
||||
PdfPCell rigaVuota = new PdfPCell();
|
||||
rigaVuota.setVerticalAlignment(4);
|
||||
rigaVuota.setHorizontalAlignment(0);
|
||||
rigaVuota.setBorder(0);
|
||||
rigaVuota.setColspan(40);
|
||||
this.pdfPcorpo = new PdfPTable(40);
|
||||
this.pdfPcorpo.setWidthPercentage(100.0F);
|
||||
this.pdfPcorpo.setWidths(colWidthsRighe40);
|
||||
if (new File(String.valueOf(getDocBase()) + getPathLogoDocumenti()).exists()) {
|
||||
Image imgLogo = Image.getInstance(String.valueOf(getDocBase()) + getPathLogoDocumenti());
|
||||
imgLogo.scaleToFit(100.0F, 100.0F);
|
||||
imgLogo.setAlignment(5);
|
||||
PdfPCell cell = new PdfPCell();
|
||||
cell.addElement(new Chunk(imgLogo, -10.0F, -15.0F));
|
||||
cell.setBorder(0);
|
||||
cell.setColspan(8);
|
||||
this.pdfPcorpo.addCell(cell);
|
||||
} else {
|
||||
PdfPCell cell = new PdfPCell();
|
||||
cell.setBorder(0);
|
||||
cell.setColspan(8);
|
||||
this.pdfPcorpo.addCell(cell);
|
||||
}
|
||||
PdfPCell pdfPCell1 = new PdfPCell();
|
||||
pdfPCell1.addElement(new Chunk("Report: " + titolo, PdfFontFactory.PDF_fGrandeB));
|
||||
pdfPCell1.addElement(new Chunk(sottoTitolo, PdfFontFactory.PDF_fMedio));
|
||||
pdfPCell1.setBorder(0);
|
||||
pdfPCell1.setVerticalAlignment(4);
|
||||
pdfPCell1.setColspan(27);
|
||||
this.pdfPcorpo.addCell(pdfPCell1);
|
||||
pdfPCell1 = new PdfPCell();
|
||||
pdfPCell1.addElement(new Chunk(getDataFormat().format(getToday()), PdfFontFactory.PDF_fGrandeB));
|
||||
pdfPCell1.setBorder(0);
|
||||
pdfPCell1.setVerticalAlignment(6);
|
||||
pdfPCell1.setColspan(5);
|
||||
this.pdfPcorpo.addCell(pdfPCell1);
|
||||
this.pdfPcorpo.addCell(rigaVuota);
|
||||
this.pdfPcorpo.setHeaderRows(2);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
return this.document;
|
||||
}
|
||||
|
||||
protected Document creaIntestazioneReport(String titolo, String sottoTitolo) {
|
||||
int cellLeading = 12;
|
||||
int pdfCorpoPadding = 2;
|
||||
try {
|
||||
Cell rigaVuota = new Cell(new Chunk(" ", PdfFontFactory.PDF_fPiccolissimo));
|
||||
rigaVuota.setVerticalAlignment(4);
|
||||
rigaVuota.setHorizontalAlignment(0);
|
||||
rigaVuota.setLeading((float)cellLeading);
|
||||
rigaVuota.setBorder(0);
|
||||
rigaVuota.setColspan(40);
|
||||
rigaVuota.setRowspan(1);
|
||||
Image imgLogo = Image.getInstance(String.valueOf(getDocBase()) + getPathLogoDocumenti());
|
||||
imgLogo.scaleToFit(50.0F, 100.0F);
|
||||
imgLogo.setAlignment(5);
|
||||
this.pdfcorpo = new Table(40);
|
||||
this.pdfcorpo.setWidth(100.0F);
|
||||
this.pdfcorpo.setPadding((float)pdfCorpoPadding);
|
||||
this.pdfcorpo.setSpacing(0.0F);
|
||||
this.pdfcorpo.setWidths(colWidthsRighe40);
|
||||
this.pdfcorpo.setBorder(0);
|
||||
Cell cell = new Cell();
|
||||
cell.add(new Chunk(imgLogo, 10.0F, 0.0F));
|
||||
cell.setLeading(12.0F);
|
||||
cell.setBorder(0);
|
||||
cell.setColspan(6);
|
||||
cell.setRowspan(1);
|
||||
this.pdfcorpo.addCell(cell);
|
||||
cell = new Cell(new Chunk("Report: " + titolo, PdfFontFactory.PDF_fGrandeB));
|
||||
cell.add(new Chunk("\n\n" + sottoTitolo, PdfFontFactory.PDF_fMedio));
|
||||
cell.setLeading(12.0F);
|
||||
cell.setBorder(0);
|
||||
cell.setVerticalAlignment(4);
|
||||
cell.setColspan(28);
|
||||
cell.setRowspan(1);
|
||||
this.pdfcorpo.addCell(cell);
|
||||
cell = new Cell(new Chunk(getDataFormat().format(getToday()), PdfFontFactory.PDF_fGrandeB));
|
||||
cell.setLeading(12.0F);
|
||||
cell.setBorder(0);
|
||||
cell.setVerticalAlignment(6);
|
||||
cell.setColspan(6);
|
||||
cell.setRowspan(1);
|
||||
this.pdfcorpo.addCell(cell);
|
||||
this.pdfcorpo.addCell(rigaVuota);
|
||||
this.document.add((Element)this.pdfcorpo);
|
||||
this.pdfcorpo = new Table(40);
|
||||
this.pdfcorpo.setWidth(100.0F);
|
||||
this.pdfcorpo.setPadding((float)pdfCorpoPadding);
|
||||
this.pdfcorpo.setSpacing(0.0F);
|
||||
this.pdfcorpo.setWidths(colWidthsRighe40);
|
||||
this.pdfcorpo.setBorder(0);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
return this.document;
|
||||
}
|
||||
|
||||
public boolean isFatturaElettronicaOn() {
|
||||
return getParm("FATTURA_ELETTRONICA_ON").isTrue();
|
||||
}
|
||||
|
||||
protected String getMessaggioAvvisoPrenotazioneEmail() {
|
||||
return getParm("MSG_AVVISO_PREN_EMAIL").getTesto();
|
||||
}
|
||||
|
||||
public double getConselImportoMinimo() {
|
||||
return getParm("CONSEL_IMPORTO_MINIMO").getNumeroDouble();
|
||||
}
|
||||
|
||||
public boolean isRata0Attiva() {
|
||||
return (getParm("CONSEL_RATA0").getNumeroLong() == 1L);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.ablia.anag.json;
|
||||
|
||||
public class JsonComune {
|
||||
private long id_comune;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private long lastUpdTmst;
|
||||
|
||||
public long getId_comune() {
|
||||
return this.id_comune;
|
||||
}
|
||||
|
||||
public void setId_comune(long id_tipologiaProdotto) {
|
||||
this.id_comune = id_tipologiaProdotto;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return this.descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public long getLastUpdTmst() {
|
||||
return this.lastUpdTmst;
|
||||
}
|
||||
|
||||
public void setLastUpdTmst(long lastUpdTmst) {
|
||||
this.lastUpdTmst = lastUpdTmst;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Aspetto;
|
||||
import com.ablia.anag.AspettoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Aspetto.abl"})
|
||||
public class AspettoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Aspetto(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new AspettoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Banca;
|
||||
import com.ablia.anag.BancaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Banca.abl"})
|
||||
public class BancaSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Banca(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new BancaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.CausaleTrasporto;
|
||||
import com.ablia.anag.CausaleTrasportoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/CausaleTrasporto.abl"})
|
||||
public class CausaleTrasportoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new CausaleTrasporto(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new CausaleTrasportoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Cliente;
|
||||
import com.ablia.anag.ClienteCR;
|
||||
import com.ablia.anag.TipoPagamento;
|
||||
import com.ablia.anag.TipoPagamentoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.util.ReturnItem;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anag/Cliente.abl"})
|
||||
public class ClienteSvlt extends CliforSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Cliente(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new ClienteCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("bean", getBean(req));
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(getApFull(req)).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("RI", new ReturnItem(req.getParameter("RI")));
|
||||
}
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return super.getBeanPageName(req);
|
||||
}
|
||||
|
||||
protected final String getBeanName(HttpServletRequest req) {
|
||||
return "clifor";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,559 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.AllegatoClifor;
|
||||
import com.ablia.anag.ClienteCR;
|
||||
import com.ablia.anag.Clifor;
|
||||
import com.ablia.anag.CliforCR;
|
||||
import com.ablia.anag.CliforTipoClifor;
|
||||
import com.ablia.anag.CliforTipoCliforCR;
|
||||
import com.ablia.anag.Contatto;
|
||||
import com.ablia.anag.Contratto;
|
||||
import com.ablia.anag.DestinazioneDiversa;
|
||||
import com.ablia.anag.Listino;
|
||||
import com.ablia.anag.TipoAllegatoClifor;
|
||||
import com.ablia.anag.TipoClifor;
|
||||
import com.ablia.anag.TipoCliforCR;
|
||||
import com.ablia.anag.TipoContratto;
|
||||
import com.ablia.anag.TipoPagamento;
|
||||
import com.ablia.anag.TipoPagamentoCR;
|
||||
import com.ablia.anag.Users;
|
||||
import com.ablia.contab.DocumentoPagamento;
|
||||
import com.ablia.contab.DocumentoPagamentoCR;
|
||||
import com.ablia.contab.IncassoPagamento;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.newsletter.CodaMessaggi;
|
||||
import com.ablia.newsletter.TemplateMsg;
|
||||
import com.ablia.util.AbMessages;
|
||||
import com.ablia.util.ReturnItem;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class CliforSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = null;
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_clifor");
|
||||
bean = new Clifor(apFull);
|
||||
try {
|
||||
bean.findByPrimaryKey(l_id);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
req.setAttribute("id_clifor", String.valueOf(bean.getId_clifor()));
|
||||
if (rp.getStatus()) {
|
||||
if (getAct(req).equals("addDD")) {
|
||||
DestinazioneDiversa row = new DestinazioneDiversa(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.addDestinazioneDiversa(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delDD")) {
|
||||
DestinazioneDiversa row = new DestinazioneDiversa(apFull);
|
||||
long l_id_destinazioneDiversa = getRequestLongParameter(req, "id_destinazioneDiversa");
|
||||
if (l_id_destinazioneDiversa != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delDestinazioneDiversa(row);
|
||||
sendMessage(req, "Cancellazione Destinazione Diversa Effettuata");
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modDD")) {
|
||||
DestinazioneDiversa row = new DestinazioneDiversa(apFull);
|
||||
long l_id_destinazioneDiversa = getRequestLongParameter(req, "id_destinazioneDiversa");
|
||||
if (l_id_destinazioneDiversa != 0L) {
|
||||
row.findByPrimaryKey(l_id_destinazioneDiversa);
|
||||
req.setAttribute("destinazioneDiversa", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addContratto")) {
|
||||
Contratto row = new Contratto(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.addContratto(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delContratto")) {
|
||||
Contratto row = new Contratto(apFull);
|
||||
long l_id_row = getRequestLongParameter(req, "id_contratto");
|
||||
if (l_id_row != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delContratto(row);
|
||||
sendMessage(req, "Cancellazione Contratto Effettuata");
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modContratto")) {
|
||||
Contratto row = new Contratto(apFull);
|
||||
long l_id_row = getRequestLongParameter(req, "id_contratto");
|
||||
if (l_id_row != 0L) {
|
||||
row.findByPrimaryKey(l_id_row);
|
||||
req.setAttribute("beanC", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addAllegato")) {
|
||||
AllegatoClifor row = new AllegatoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.addAllegato(row);
|
||||
rp.append(creaFileAllegato(bean, req, res));
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delAllegato")) {
|
||||
AllegatoClifor row = new AllegatoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.delAllegato(row);
|
||||
sendMessage(req, String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_OK")) + ": Allegato Cancellato");
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addTipologia")) {
|
||||
CliforTipoClifor row = new CliforTipoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.addTipologia(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delTipologia")) {
|
||||
CliforTipoClifor row = new CliforTipoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.delTipologia(row);
|
||||
sendMessage(req, String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_OK")) + ": Allegato Cancellato");
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delUser")) {
|
||||
Users row = new Users(apFull);
|
||||
long l_id_users = getRequestLongParameter(req, "id_users");
|
||||
if (l_id_users != 0L) {
|
||||
row.findByPrimaryKey(l_id_users);
|
||||
if (row.getId_clifor() == bean.getId_clifor()) {
|
||||
row.setId_clifor(0L);
|
||||
row.save();
|
||||
sendMessage(req,
|
||||
String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_OK")) + ": Utente non più legato al record.");
|
||||
} else {
|
||||
sendMessage(req, String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_FAIL")) +
|
||||
": Utente non legato al record cliente/Fornitore!");
|
||||
}
|
||||
} else {
|
||||
sendMessage(req, String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_FAIL")) + ": codice Utente nullo!");
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
} else {
|
||||
req.setAttribute("bean", bean);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = (Clifor)beanA;
|
||||
req.setAttribute("listaUserClifor", bean.findUsers(0, 0));
|
||||
req.setAttribute("listaDD", bean.getDestinazioniDiverse());
|
||||
req.setAttribute("listaListini", new Listino(apFull).findNoListinoBase());
|
||||
req.setAttribute("listaTipoContratto", new TipoContratto(apFull).findAll());
|
||||
req.setAttribute("listaContratti", bean.getContratti());
|
||||
req.setAttribute("listaDocumenti", bean.getDocumenti());
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("RI", new ReturnItem(req.getParameter("RI")));
|
||||
req.setAttribute("listaAllegati", bean.getAllegati(0L));
|
||||
req.setAttribute("listaTipiAllegatoClifor", new TipoAllegatoClifor(apFull).findAll());
|
||||
req.setAttribute("listaTipiAllegatoClifor", new TipoAllegatoClifor(apFull).findAll());
|
||||
TipoCliforCR CRT = new TipoCliforCR();
|
||||
CRT.setFlgTipoS(bean.getFlgTipo());
|
||||
req.setAttribute("listaTipiClifor", new TipoClifor(apFull).findByCR(CRT, 0, 0));
|
||||
CliforTipoCliforCR CRCTC = new CliforTipoCliforCR(apFull);
|
||||
CRCTC.setId_clifor(bean.getId_clifor());
|
||||
CRCTC.setFlgTipoClifor(bean.getFlgTipo());
|
||||
req.setAttribute("listaTipologie", new CliforTipoClifor(apFull).findByCR(CRCTC, 0, 0));
|
||||
DocumentoPagamentoCR CRdp = new DocumentoPagamentoCR();
|
||||
CRdp.setId_clifor(bean.getId_clifor());
|
||||
req.setAttribute("listaPagamenti", new DocumentoPagamento(apFull).findSaldiByCR(CRdp, 0, 0));
|
||||
req.setAttribute("listaClientiAssociati", new Clifor(apFull).findByAgente(bean.getId_clifor()));
|
||||
req.setAttribute("listaContatti", new Contatto(apFull).findByClifor(bean.getId_clifor()));
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
CliforCR CR = (CliforCR)CRA;
|
||||
req.setAttribute("listaTemplateMsg", new TemplateMsg(apFull).findAll());
|
||||
req.setAttribute("listaTipiClifor", new TipoClifor(apFull).findByTipo(CR.getFlgTipo()));
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Clifor(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new CliforCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(apFull).findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("RI", new ReturnItem(req.getParameter("RI")));
|
||||
req.setAttribute("listaTipoContratto", new TipoContratto(apFull).findAll());
|
||||
req.setAttribute("listaTipiClifor", new TipoClifor(apFull).findAll());
|
||||
}
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return super.getBeanPageName(req);
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
if (getCmd(req).equals("join")) {
|
||||
long l_id_anagrafica = getRequestLongParameter(req, "id_anagrafica");
|
||||
Clifor bean = new Clifor(apFull);
|
||||
bean.findByPrimaryKey(l_id_anagrafica);
|
||||
fillObject(req, bean);
|
||||
bean.save();
|
||||
ResParm rp = Clifor.unisciClifor(bean);
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Unione Record eseguita correttamente.");
|
||||
req.getSession().removeAttribute(getATTR_CRBEAN(req));
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getCmd(req).equals("creaCodaSms")) {
|
||||
ClienteCR CR = new ClienteCR();
|
||||
fillObject(req, CR);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
Vectumerator<Clifor> vec = bean.findByCR(CR, 0, 0);
|
||||
String l_msg = getRequestParameter(req, "testoMessaggio").trim();
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
ResParm rp = new ResParm(true);
|
||||
if (l_msg.isEmpty()) {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg("ERRORE! Testo del messaggio vuoto!");
|
||||
} else {
|
||||
while (vec.hasMoreElements()) {
|
||||
Clifor row = (Clifor)vec.nextElement();
|
||||
CodaMessaggi cm = new CodaMessaggi(apFull);
|
||||
if (!row.getCellulare().isEmpty()) {
|
||||
cm.setCellulare(row.getCellulare());
|
||||
cm.setFlgTipo(2L);
|
||||
cm.setDataCreazione(DBAdapter.getToday());
|
||||
cm.setTestoMessaggio(l_msg);
|
||||
cm.save();
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Creazione coda messaggi eseguita correttamente. Creati " + i + " messaggi sms. " + j +
|
||||
" Clienti senza cellulare impostato.");
|
||||
req.getSession().removeAttribute(getATTR_CRBEAN(req));
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
search(req, res);
|
||||
} else if (getCmd(req).equals("creaCodaMsg")) {
|
||||
creaCodaMessaggi(req, res);
|
||||
} else if (!getCmd(req).equals("rendiFlag")) {
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
public void _creaMList(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
CliforCR CR = new CliforCR(apFull);
|
||||
fillObject(req, CR);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
ResParm rp = bean.creaMailingListCR(CR);
|
||||
if (rp.getStatus()) {
|
||||
String fileML = getMailingListFileCR();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(rp.getMsg());
|
||||
sb.append("<br>");
|
||||
sb.append("<a href='../../" + fileML + "' download>File Mailing list: " + fileML + "</a><br>");
|
||||
sendHtmlMsgResponse(req, res, sb.toString());
|
||||
} else {
|
||||
sendHtmlMsgResponse(req, res, "Errore creazione mailing list!!");
|
||||
}
|
||||
}
|
||||
|
||||
protected void creaCodaMessaggi(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
CliforCR CR = new CliforCR(apFull);
|
||||
fillObject(req, CR);
|
||||
long l_id_templateMsg = getRequestLongParameter(req, "id_templateMsg");
|
||||
bean.creaCodaMessaggi(CR, l_id_templateMsg);
|
||||
sendMessage(req, "Coda messaggi creata...");
|
||||
search(req, res);
|
||||
}
|
||||
|
||||
protected ResParm creaFileAllegato(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
synchronized (this) {
|
||||
ResParm rp = new ResParm(true, "");
|
||||
Clifor bean = (Clifor)beanA;
|
||||
String targetDir = bean.getPathAllegato();
|
||||
File pathDir = new File(targetDir);
|
||||
if (!pathDir.exists())
|
||||
pathDir.mkdirs();
|
||||
String targetFile = String.valueOf(targetDir) + "/" + bean.getId_clifor() + "_";
|
||||
Vectumerator completeFileNames = (Vectumerator)req.getAttribute("completeAttachName");
|
||||
Vectumerator fileNames = (Vectumerator)req.getAttribute("attachName");
|
||||
if (completeFileNames.hasMoreElements()) {
|
||||
String sourceFile = (String)completeFileNames.nextElement();
|
||||
String fileName = (String)fileNames.elementAt(0);
|
||||
targetFile = String.valueOf(targetFile) + fileName;
|
||||
if (isFileExist(sourceFile)) {
|
||||
new File(targetFile).delete();
|
||||
new File(sourceFile).renameTo(new File(targetFile));
|
||||
}
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isLoadImageServlet() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void print(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
if (getAct(req).equals("lblInd")) {
|
||||
long l_id = 0L;
|
||||
Clifor bean = null;
|
||||
l_id = getRequestLongParameter(req, "id_clifor");
|
||||
bean = new Clifor(getApFull(req));
|
||||
bean.findByPrimaryKey(l_id);
|
||||
sendPdf(res, bean.creaPdfEtichettaZebra(""));
|
||||
} else {
|
||||
search(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void _checkPiva(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
Clifor bean = new Clifor(getApFull(req));
|
||||
bean.findByPrimaryKey(getRequestLongParameter(req, "id_clifor"));
|
||||
bean.setPIva(getRequestParameter(req, "pIva"));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!bean.isPivaComunitariaOk())
|
||||
sb.append("Partita Iva Comunitaria NON VERIFICATA! ");
|
||||
if (bean.isPIvaDuplicated())
|
||||
sb.append("Partita Iva duplicata!");
|
||||
if (sb.length() == 0) {
|
||||
req.setAttribute("res", "OK");
|
||||
} else {
|
||||
sb.insert(0, "ATTENZIONE! ");
|
||||
req.setAttribute("msg", sb.toString());
|
||||
}
|
||||
sendCmdJspPageResponse(req, res);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void _modDocumento(HttpServletRequest req, HttpServletResponse res) {
|
||||
IncassoPagamento ip = new IncassoPagamento(getApFull(req));
|
||||
fillObject(req, ip);
|
||||
req.setAttribute("listaIncassi", ip.findByDocumento(ip.getId_documento(), 0, 0));
|
||||
req.setAttribute("beanIP", ip);
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _modIncasso(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_incassoPagamento = getRequestLongParameter(req, "id_incassoPagamento");
|
||||
IncassoPagamento ip = new IncassoPagamento(getApFull(req));
|
||||
ip.findByPrimaryKey(id_incassoPagamento);
|
||||
req.setAttribute("listaIncassi", ip.findByDocumento(ip.getId_documento(), 0, 0));
|
||||
req.setAttribute("beanIP", ip);
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _addIncasso(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_incassoPagamento = getRequestLongParameter(req, "id_incassoPagamento");
|
||||
IncassoPagamento ip = new IncassoPagamento(getApFull(req));
|
||||
ip.findByPrimaryKey(id_incassoPagamento);
|
||||
fillObject(req, ip);
|
||||
ResParm rp = ip.save();
|
||||
req.setAttribute("listaIncassi", ip.findByDocumento(ip.getId_documento(), 0, 0));
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _delIncasso(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_incassoPagamento = getRequestLongParameter(req, "id_incassoPagamento");
|
||||
IncassoPagamento ip = new IncassoPagamento(getApFull(req));
|
||||
ip.findByPrimaryKey(id_incassoPagamento);
|
||||
ResParm rp = ip.delete();
|
||||
req.setAttribute("listaIncassi", ip.findByDocumento(ip.getId_documento(), 0, 0));
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _printLista(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
CliforCR CR = new CliforCR(getApFull());
|
||||
Clifor bean = new Clifor(getApFull());
|
||||
fillObject(req, CR);
|
||||
sendPdf(res, bean.creaPdfListaClifor(CR));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void _delAllegato(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
long l_id_clifor = getRequestLongParameter(req, "id_clifor");
|
||||
bean.findByPrimaryKey(l_id_clifor);
|
||||
AllegatoClifor row = new AllegatoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
bean.delAllegato(row);
|
||||
sendMessage(req, String.valueOf(AbMessages.getMessage(getLocale(req), "SAVE_OK")) + ": Allegato Cancellato");
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _delContatto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_contatto = getRequestLongParameter(req, "id_contatto");
|
||||
Contatto contatto = new Contatto(getApFull(req));
|
||||
contatto.findByPrimaryKey(id_contatto);
|
||||
ResParm rp = contatto.delete();
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _modifyContatto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_contatto = getRequestLongParameter(req, "id_contatto");
|
||||
Contatto contatto = new Contatto(getApFull(req));
|
||||
contatto.findByPrimaryKey(id_contatto);
|
||||
req.setAttribute("beanContatto", contatto);
|
||||
ResParm rp = contatto.save();
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _addContatto(HttpServletRequest req, HttpServletResponse res) {
|
||||
long id_contatto = getRequestLongParameter(req, "id_contatto");
|
||||
Contatto contatto = new Contatto(getApFull(req));
|
||||
contatto.findByPrimaryKey(id_contatto);
|
||||
fillObject(req, contatto);
|
||||
ResParm rp = contatto.save();
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _pivaCee(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
long l_id_clifor = getRequestLongParameter(req, "id_clifor");
|
||||
bean.findByPrimaryKey(l_id_clifor);
|
||||
if (bean.getId_clifor() > 0L) {
|
||||
String piva = DBAdapter.zeroLeft(bean.getId_clifor(), 11);
|
||||
req.setAttribute("codFisc", piva);
|
||||
} else {
|
||||
sendMessage(req, "Errore! Utente non ancora salvato");
|
||||
}
|
||||
req.setAttribute("act", "refresh");
|
||||
showBean(req, res);
|
||||
}
|
||||
|
||||
public void _printPdf(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
CliforCR CR = new CliforCR(getApFull());
|
||||
Clifor bean = new Clifor(getApFull());
|
||||
fillObject(req, CR);
|
||||
sendPdf(res, bean.creaPdfListaClifor(CR));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void _addAllegato(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
long l_id_clifor = getRequestLongParameter(req, "id_clifor");
|
||||
bean.findByPrimaryKey(l_id_clifor);
|
||||
String fileName = getRequestParameter(req, "fileNameOnServer_1");
|
||||
if (!fileName.isEmpty()) {
|
||||
String targetDir = bean.getPathAllegato();
|
||||
File pathDir = new File(targetDir);
|
||||
if (!pathDir.exists())
|
||||
pathDir.mkdirs();
|
||||
String targetFile = String.valueOf(targetDir) + "/" + bean.getId_clifor() + "_" + fileName;
|
||||
String sourceFile = String.valueOf(getDocBase()) + getPathTmp() + fileName;
|
||||
if (isFileExist(sourceFile)) {
|
||||
new File(targetFile).delete();
|
||||
new File(sourceFile).renameTo(new File(targetFile));
|
||||
}
|
||||
AllegatoClifor row = new AllegatoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
row.setNomeFile(fileName);
|
||||
ResParm rp = bean.addAllegato(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else {
|
||||
HashMap<String, String> uploadedImages = (HashMap<String, String>)req.getAttribute("_UFN");
|
||||
String currentFullFileName = "", currentFileName = "";
|
||||
if (!uploadedImages.isEmpty()) {
|
||||
Iterator<Map.Entry<String, String>> iterator = uploadedImages.entrySet().iterator();
|
||||
if (iterator.hasNext()) {
|
||||
Map.Entry<String, String> entry = iterator.next();
|
||||
currentFullFileName = entry.getValue();
|
||||
currentFileName = entry.getKey();
|
||||
}
|
||||
}
|
||||
fileName = currentFileName;
|
||||
String targetDir = bean.getPathAllegato();
|
||||
File pathDir = new File(targetDir);
|
||||
if (!pathDir.exists())
|
||||
pathDir.mkdirs();
|
||||
String targetFile = String.valueOf(targetDir) + "/" + bean.getId_clifor() + "_" + fileName;
|
||||
String sourceFile = currentFullFileName;
|
||||
if (isFileExist(sourceFile)) {
|
||||
new File(targetFile).delete();
|
||||
new File(sourceFile).renameTo(new File(targetFile));
|
||||
}
|
||||
AllegatoClifor row = new AllegatoClifor(apFull);
|
||||
fillObject(req, row);
|
||||
row.setNomeFile(fileName);
|
||||
ResParm rp = bean.addAllegato(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
public void _pivaExtraCee(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Clifor bean = new Clifor(apFull);
|
||||
long l_id_clifor = getRequestLongParameter(req, "id_clifor");
|
||||
bean.findByPrimaryKey(l_id_clifor);
|
||||
if (bean.getId_clifor() > 0L) {
|
||||
String piva = "EX" + DBAdapter.zeroLeft(bean.getId_clifor(), 9);
|
||||
req.setAttribute("codFisc", piva);
|
||||
} else {
|
||||
sendMessage(req, "Errore! Utente non ancora salvato");
|
||||
}
|
||||
req.setAttribute("act", "refresh");
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Comune;
|
||||
import com.ablia.anag.ComuneCR;
|
||||
import com.ablia.anag.Regione;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Comune.abl"})
|
||||
public class ComuneSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaRegione", new Regione(getApFull(req)).findAll());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Comune(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new ComuneCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Contatore;
|
||||
import com.ablia.anag.ContatoreCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Contatore.abl"})
|
||||
public class ContatoreSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Contatore(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new ContatoreCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Contratto;
|
||||
import com.ablia.anag.ContrattoCR;
|
||||
import com.ablia.anag.TipoContratto;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.newsletter.TemplateMsg;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anag/Contratto.abl"})
|
||||
public class ContrattoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaTipoContratto", new TipoContratto(getApFull(req))
|
||||
.findAll());
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipoContratto", new TipoContratto(apFull)
|
||||
.findAll());
|
||||
req.setAttribute("listaTemplateMsg", new TemplateMsg(apFull)
|
||||
.findAll());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Contratto(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new ContrattoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
req.setAttribute("listaTipoContratto", new TipoContratto(apFull)
|
||||
.findAll());
|
||||
Contratto bean = new Contratto(apFull);
|
||||
bean.setId_clifor(getRequestLongParameter(req, "id_clifor"));
|
||||
req.setAttribute("bean", bean);
|
||||
}
|
||||
|
||||
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
if (getCmd(req).equals("crea1CodaSmsD") ||
|
||||
getCmd(req).equals("crea1CodaSmsCR")) {
|
||||
long l_id = getRequestLongParameter(req, "id_contratto");
|
||||
Contratto bean = new Contratto(apFull);
|
||||
bean.findByPrimaryKey(l_id);
|
||||
ResParm rp = new ResParm(true);
|
||||
if (getCmd(req).equals("crea1CodaSmsD")) {
|
||||
ContrattoCR CR = new ContrattoCR(apFull);
|
||||
fillObject(req, CR);
|
||||
bean.save();
|
||||
}
|
||||
if (bean.getDBState() == 1) {
|
||||
rp = bean.creaCodaMessaggio();
|
||||
} else {
|
||||
rp.setStatus(false);
|
||||
rp.setMsg("Errore!. Impossibile salvare contratto");
|
||||
}
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req,
|
||||
"Creazione coda messaggio avvenuto con successo");
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
if (getCmd(req).equals("crea1CodaSmsD")) {
|
||||
showBean(req, res);
|
||||
} else {
|
||||
search(req, res);
|
||||
}
|
||||
} else if (getCmd(req).equals("creaCodaSms")) {
|
||||
Contratto bean = new Contratto(apFull);
|
||||
ContrattoCR CR = new ContrattoCR(apFull);
|
||||
fillObject(req, CR);
|
||||
ResParm rp = new ResParm(true);
|
||||
rp = bean.creaCodaMessaggiSms(CR);
|
||||
if (rp.getStatus()) {
|
||||
sendMessage(req, "Creazione coda messaggi ok. " +
|
||||
rp.getStatus());
|
||||
} else {
|
||||
sendMessage(req, rp.getMsg());
|
||||
}
|
||||
search(req, res);
|
||||
}
|
||||
super.otherCommands(req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Esercizio;
|
||||
import com.ablia.anag.EsercizioCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Esercizio.abl"})
|
||||
public class EsercizioSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Esercizio(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new EsercizioCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Festivita;
|
||||
import com.ablia.anag.FestivitaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Festivita.abl"})
|
||||
public class FestivitaSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = -6080652564320276641L;
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Festivita(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new FestivitaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Fornitore;
|
||||
import com.ablia.anag.FornitoreCR;
|
||||
import com.ablia.anag.TipoPagamento;
|
||||
import com.ablia.anag.TipoPagamentoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.util.ReturnItem;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anag/Fornitore.abl"})
|
||||
public class FornitoreSvlt extends CliforSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Fornitore(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new FornitoreCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("bean", getBean(req));
|
||||
req.setAttribute("listaTipoPagamento", new TipoPagamento(getApFull(req))
|
||||
.findByCR(new TipoPagamentoCR(), 0, 0));
|
||||
req.setAttribute("RI", new ReturnItem(
|
||||
req.getParameter("RI")));
|
||||
}
|
||||
|
||||
protected String getBeanPageName(HttpServletRequest req) {
|
||||
return super.getBeanPageName(req);
|
||||
}
|
||||
|
||||
protected final String getBeanName(HttpServletRequest req) {
|
||||
return "clifor";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Iva;
|
||||
import com.ablia.anag.IvaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Iva.abl"})
|
||||
public class IvaSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Iva(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new IvaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Listino;
|
||||
import com.ablia.anag.ListinoArticolo;
|
||||
import com.ablia.anag.ListinoCR;
|
||||
import com.ablia.anag.ListinoTipo;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.util.AbMessages;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Listino.abl"})
|
||||
public class ListinoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
|
||||
ApplParmFull apFull = getApFull(req);
|
||||
Listino bean = null;
|
||||
ResParm rp = new ResParm(true, "");
|
||||
long l_id = getRequestLongParameter(req, "id_listino");
|
||||
bean = new Listino(apFull);
|
||||
try {
|
||||
bean.findByPrimaryKey(l_id);
|
||||
fillObject(req, bean);
|
||||
rp = bean.save();
|
||||
req.setAttribute("bean", bean);
|
||||
req.setAttribute("id_listino", String.valueOf(bean.getId_listino()));
|
||||
if (rp.getStatus()) {
|
||||
if (getAct(req).equals("addLT")) {
|
||||
ListinoTipo row = new ListinoTipo(apFull);
|
||||
fillObject(req, row);
|
||||
rp = bean.addListinoTipo(row);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delLT")) {
|
||||
ListinoTipo row = new ListinoTipo(apFull);
|
||||
long l_id_listinoTipo = getRequestLongParameter(req, "id_listinoTipo");
|
||||
if (l_id_listinoTipo != 0L) {
|
||||
fillObject(req, row);
|
||||
bean.delListinoTipo(row);
|
||||
sendMessage(req, "Cancellazione Listino Tipo Effettuata");
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modLT")) {
|
||||
ListinoTipo row = new ListinoTipo(apFull);
|
||||
long l_id_listinoTipo = getRequestLongParameter(req, "id_listinoTipo");
|
||||
if (l_id_listinoTipo != 0L) {
|
||||
row.findByPrimaryKey(l_id_listinoTipo);
|
||||
req.setAttribute("listinoTipo", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addListinoArticolo")) {
|
||||
ListinoArticolo row = new ListinoArticolo(apFull);
|
||||
ListinoArticolo beanRow = new ListinoArticolo(apFull);
|
||||
fillObject(req, row);
|
||||
beanRow.findByArticoloListino(row.getId_articolo(), row.getId_listino());
|
||||
if (beanRow.getDBState() == 1) {
|
||||
beanRow.setPrezzoLA(row.getPrezzoLA());
|
||||
beanRow.setPercLA(row.getPercLA());
|
||||
beanRow.setPercLA1(row.getPercLA1());
|
||||
beanRow.setPercLA2(row.getPercLA2());
|
||||
beanRow.setPercLA3(row.getPercLA3());
|
||||
beanRow.setDataScadenzaOffertaLA(row.getDataScadenzaOffertaLA());
|
||||
beanRow.setPrezzoOffertaLA(row.getPrezzoOffertaLA());
|
||||
rp = beanRow.save();
|
||||
} else {
|
||||
row.setDBState(0);
|
||||
rp = row.save();
|
||||
}
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delListinoArticolo")) {
|
||||
ListinoArticolo row = new ListinoArticolo(apFull);
|
||||
if (getRequestLongParameter(req, "id_listinoArticolo") != 0L) {
|
||||
row.findByPrimaryKey(getRequestLongParameter(req, "id_listinoArticolo"));
|
||||
row.delete();
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modListinoArticolo")) {
|
||||
ListinoArticolo row = new ListinoArticolo(apFull);
|
||||
long l_id_listinoArticolo = getRequestLongParameter(req, "id_listinoArticolo");
|
||||
if (l_id_listinoArticolo != 0L) {
|
||||
row.findByPrimaryKey(l_id_listinoArticolo);
|
||||
req.setAttribute("listinoArticolo", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("addListinoArticoloVariante")) {
|
||||
long id_articolo = getRequestLongParameter(req, "id_articoloV");
|
||||
long id_articoloVariante = getRequestLongParameter(req, "id_articoloVarianteV");
|
||||
double prezzoLA = getRequestDoubleParameter(req, "prezzoLAV");
|
||||
double percLA = getRequestDoubleParameter(req, "percLAV");
|
||||
double percLA1 = getRequestDoubleParameter(req, "percLAV1");
|
||||
double percLA2 = getRequestDoubleParameter(req, "percLAV2");
|
||||
double percLA3 = getRequestDoubleParameter(req, "percLAV3");
|
||||
ListinoArticolo beanRow = new ListinoArticolo(apFull);
|
||||
beanRow.findByArticoloVarianteListino(id_articoloVariante, l_id);
|
||||
beanRow.setId_listino(l_id);
|
||||
beanRow.setId_articolo(id_articolo);
|
||||
beanRow.setId_articoloVariante(id_articoloVariante);
|
||||
beanRow.setPrezzoLA(prezzoLA);
|
||||
beanRow.setPercLA(percLA);
|
||||
beanRow.setPercLA1(percLA1);
|
||||
beanRow.setPercLA2(percLA2);
|
||||
beanRow.setPercLA3(percLA3);
|
||||
beanRow.setDataScadenzaOffertaLA(getRequestDateParameter(req, "dataScadenzaOffertaLAV"));
|
||||
beanRow.setPrezzoOffertaLA(getRequestDoubleParameter(req, "prezzoOffertaLAV"));
|
||||
rp = bean.addListinoArticoloVariante(beanRow);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("delListinoArticoloVariante")) {
|
||||
ListinoArticolo row = new ListinoArticolo(apFull);
|
||||
if (getRequestLongParameter(req, "id_listinoArticolo") != 0L) {
|
||||
row.findByPrimaryKey(getRequestLongParameter(req, "id_listinoArticolo"));
|
||||
row.delete();
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
} else if (getAct(req).equals("modListinoArticoloVariante")) {
|
||||
ListinoArticolo row = new ListinoArticolo(apFull);
|
||||
long l_id_listinoArticolo = getRequestLongParameter(req, "id_listinoArticolo");
|
||||
if (l_id_listinoArticolo != 0L) {
|
||||
row.findByPrimaryKey(l_id_listinoArticolo);
|
||||
req.setAttribute("listinoArticoloV", row);
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
|
||||
} else {
|
||||
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
|
||||
}
|
||||
showBean(req, res);
|
||||
}
|
||||
} else {
|
||||
req.setAttribute("bean", bean);
|
||||
sendMessage(req, rp.getMsg());
|
||||
showBean(req, res);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
|
||||
showBean(req, res);
|
||||
}
|
||||
}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
Listino bean = (Listino)beanA;
|
||||
req.setAttribute("listaLT", bean.getListinoTipo());
|
||||
req.setAttribute("listaLA", bean.getListinoArticolo(getPageNumber(req), getPageRow(req)));
|
||||
req.setAttribute("listaLAV", bean.getListinoArticoloVariante(getPageNumber(req), getPageRow(req)));
|
||||
}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Listino(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new ListinoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected int getPageRow(HttpServletRequest req) {
|
||||
return 99999999;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.MagFisico;
|
||||
import com.ablia.anag.MagFisicoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/MagFisico.abl"})
|
||||
public class MagFisicoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new MagFisico(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new MagFisicoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ResParm beforeSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
|
||||
ResParm rp = new ResParm(true);
|
||||
MagFisico mf = new MagFisico(getApFull(req));
|
||||
fillObject(req, mf);
|
||||
if (mf.getFlgTipo() == 3L) {
|
||||
if (mf.isMagOrdinatoValorizzato()) {
|
||||
rp.setMsg("ERRORE! Può essere selezionato solo un magazzino ordinato!");
|
||||
rp.setStatus(false);
|
||||
return rp;
|
||||
}
|
||||
return super.beforeSave(beanA, req, res);
|
||||
}
|
||||
return super.beforeSave(beanA, req, res);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Postazione;
|
||||
import com.ablia.common.Users;
|
||||
import com.ablia.servlet.Logon4Svlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/menu/Menu4.abl"})
|
||||
public class Menu4Svlt extends Logon4Svlt {
|
||||
private static final long serialVersionUID = -2542692347954883196L;
|
||||
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
if (getLoginUser(req) == null) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
if (getLoginUser(req).getFlgValido().equals("N")) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
if (getLoginUser(req).getId_userProfile() > 0L) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected Users getUser(HttpServletRequest req) {
|
||||
return new com.ablia.anag.Users(getApFull(req));
|
||||
}
|
||||
|
||||
protected long checkLoginName(HttpServletRequest req, HttpServletResponse res) {
|
||||
long result = super.checkLoginName(req, res);
|
||||
if (result == 5L) {
|
||||
String ip = req.getRemoteHost();
|
||||
Postazione pos = new Postazione(getApFull(req));
|
||||
pos.findByIp(ip);
|
||||
com.ablia.anag.Users bean = (com.ablia.anag.Users)getLoginUser(req);
|
||||
System.out.println("LOGIN EFFETTUATO: user:" + bean.getLogin() + " ip:" + ip);
|
||||
if (pos.getDBState() == 1) {
|
||||
bean.setId_postazione(pos.getId_postazione());
|
||||
req.getSession().setAttribute("utenteLogon", bean);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Postazione;
|
||||
import com.ablia.common.Users;
|
||||
import com.ablia.servlet.LogonSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/menu/Menu.abl"})
|
||||
public class MenuSvlt extends LogonSvlt {
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
if (getLoginUser(req) == null) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
if (getLoginUser(req).getFlgValido().equals("N")) {
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
if (getLoginUser(req).getId_userProfile() > 0L) {
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
return getJspPage(req).isEmpty() ? "/admin/menu/menu.jsp" : getJspPage(req);
|
||||
}
|
||||
|
||||
protected Users getUser(HttpServletRequest req) {
|
||||
return new com.ablia.anag.Users(getApFull(req));
|
||||
}
|
||||
|
||||
protected long checkLoginName(HttpServletRequest req, HttpServletResponse res) {
|
||||
long result = super.checkLoginName(req, res);
|
||||
if (result == 5L) {
|
||||
String ip = req.getRemoteHost();
|
||||
Postazione pos = new Postazione(getApFull(req));
|
||||
pos.findByIp(ip);
|
||||
com.ablia.anag.Users bean = (com.ablia.anag.Users)getLoginUser(req);
|
||||
System.out.println("LOGIN EFFETTUATO: user:" + bean.getLogin() + " ip:" + ip);
|
||||
if (pos.getDBState() == 1) {
|
||||
bean.setId_postazione(pos.getId_postazione());
|
||||
req.getSession().setAttribute("utenteLogon", bean);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Nazione;
|
||||
import com.ablia.anag.NazioneCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Nazione.abl"})
|
||||
public class NazioneSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Nazione(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new NazioneCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Porto;
|
||||
import com.ablia.anag.PortoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Porto.abl"})
|
||||
public class PortoSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Porto(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new PortoCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ablia.anag.servlet;
|
||||
|
||||
import com.ablia.anag.Postazione;
|
||||
import com.ablia.anag.PostazioneCR;
|
||||
import com.ablia.anag.RegCassa;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/anagConfig/Postazione.abl"})
|
||||
public class PostazioneSvlt extends _AnagAdapterSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
|
||||
req.setAttribute("listaRegCassa", new RegCassa(getApFull(req)).findAll());
|
||||
}
|
||||
|
||||
protected DBAdapter getBean(HttpServletRequest req) {
|
||||
return new Postazione(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new PostazioneCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
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