187 lines
4.5 KiB
Java
187 lines
4.5 KiB
Java
package it.acxent.contab;
|
|
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.db.DBAdapterException;
|
|
import it.acxent.db.ResParm;
|
|
import it.acxent.db.WcString;
|
|
import it.acxent.util.Vectumerator;
|
|
import java.io.Serializable;
|
|
import java.sql.PreparedStatement;
|
|
import java.sql.SQLException;
|
|
|
|
public class PianoConti extends DBAdapter implements Serializable {
|
|
private static final long serialVersionUID = 8044331984020899695L;
|
|
|
|
private long id_pianoConti;
|
|
|
|
private String contoCompleto;
|
|
|
|
private String descrizione;
|
|
|
|
private long flgTipo;
|
|
|
|
private long flgCFBI;
|
|
|
|
private long flgMovimentabile;
|
|
|
|
private String mastro;
|
|
|
|
private String conto;
|
|
|
|
private String sottoconto;
|
|
|
|
private static final long TIPO_ECONOMICO = 0L;
|
|
|
|
private static final long TIPO_PATRIMONIALE = 1L;
|
|
|
|
private static final long CFBI_NESSUNO = 0L;
|
|
|
|
private static final long CFBI_CLIENTE = 1L;
|
|
|
|
private static final long CFBI_FORNITORE = 2L;
|
|
|
|
private static final long CFBI_BANCA = 3L;
|
|
|
|
private static final long CFBI_IVA = 4L;
|
|
|
|
public PianoConti(ApplParmFull newApplParmFull) {
|
|
super(newApplParmFull);
|
|
}
|
|
|
|
public PianoConti() {}
|
|
|
|
public long getId_pianoConti() {
|
|
return this.id_pianoConti;
|
|
}
|
|
|
|
public void setId_pianoConti(long id_incassoPagamento) {
|
|
this.id_pianoConti = id_incassoPagamento;
|
|
}
|
|
|
|
public String getConto() {
|
|
return (this.conto == null) ? "" : this.conto;
|
|
}
|
|
|
|
public void setConto(String conto) {
|
|
this.conto = conto;
|
|
}
|
|
|
|
public Vectumerator<PianoConti> findByCR(PianoContiCR CR, int pageNumber, int pageRows) {
|
|
String s_Sql_Find = "select A.* from PIANO_CONTI AS A";
|
|
String s_Sql_Order = " ORDER BY contoCompleto ";
|
|
WcString wc = new WcString();
|
|
if (!CR.getSearchTxt().trim().isEmpty())
|
|
wc.addWc(" A.Descrizione like '%" + CR.getSearchTxt() + "%'");
|
|
if (CR.getFlgMovimentabile() == 1L)
|
|
wc.addWc(" A.flgMovimentabile = 1 ");
|
|
try {
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
|
|
return findRows(stmt, pageNumber, pageRows);
|
|
} catch (SQLException e) {
|
|
handleDebug(e);
|
|
return AB_EMPTY_VECTUMERATOR;
|
|
}
|
|
}
|
|
|
|
protected void deleteCascade() {}
|
|
|
|
protected ResParm checkDeleteCascade() throws DBAdapterException, SQLException {
|
|
return null;
|
|
}
|
|
|
|
public String getDescrizione() {
|
|
return (this.descrizione == null) ? "" : this.descrizione;
|
|
}
|
|
|
|
public void setDescrizione(String descrizione) {
|
|
this.descrizione = descrizione;
|
|
}
|
|
|
|
public long getFlgTipo() {
|
|
return this.flgTipo;
|
|
}
|
|
|
|
public void setFlgTipo(long flgTipo) {
|
|
this.flgTipo = flgTipo;
|
|
}
|
|
|
|
public long getFlgCFBI() {
|
|
return this.flgCFBI;
|
|
}
|
|
|
|
public void setFlgCFBI(long flgCFBI) {
|
|
this.flgCFBI = flgCFBI;
|
|
}
|
|
|
|
public long getFlgMovimentabile() {
|
|
return this.flgMovimentabile;
|
|
}
|
|
|
|
public void setFlgMovimentabile(long flgMovimentabile) {
|
|
this.flgMovimentabile = flgMovimentabile;
|
|
}
|
|
|
|
public String getDescrizioneTipo() {
|
|
return getDescrizioneTipo(getFlgTipo());
|
|
}
|
|
|
|
public String getDescrizioneTipo(long flgTipo) {
|
|
String ret = "";
|
|
if (flgTipo == 0L) {
|
|
ret = "Economico";
|
|
} else if (flgTipo == 1L) {
|
|
ret = "Patrimoniale";
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public String getDescrizioneCFBI() {
|
|
return getDescrizioneCFBI(getFlgCFBI());
|
|
}
|
|
|
|
public String getDescrizioneCFBI(long flgCFBI) {
|
|
String ret = "";
|
|
if (flgCFBI == 0L) {
|
|
ret = "Nessuno";
|
|
} else if (flgCFBI == 1L) {
|
|
ret = "Cliente";
|
|
} else if (flgCFBI == 2L) {
|
|
ret = "Fornitore";
|
|
} else if (flgCFBI == 3L) {
|
|
ret = "Banca";
|
|
} else if (flgCFBI == 4L) {
|
|
ret = "Iva";
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
public String getContoCompleto() {
|
|
return (this.contoCompleto == null) ? "" : this.contoCompleto;
|
|
}
|
|
|
|
public void setContoCompleto(String contoCompleto) {
|
|
this.contoCompleto = contoCompleto;
|
|
}
|
|
|
|
public String getMastro() {
|
|
return (this.mastro == null) ? "" : this.mastro;
|
|
}
|
|
|
|
public void setMastro(String mastro) {
|
|
this.mastro = mastro;
|
|
}
|
|
|
|
public String getSottoconto() {
|
|
return (this.sottoconto == null) ? "" : this.sottoconto;
|
|
}
|
|
|
|
public void setSottoconto(String sottoconto) {
|
|
this.sottoconto = sottoconto;
|
|
}
|
|
|
|
protected void prepareSave(PreparedStatement ps) throws SQLException {
|
|
setContoCompleto(getMastro() + getMastro() + getConto());
|
|
super.prepareSave(ps);
|
|
}
|
|
}
|