Line 18... |
Line 18... |
18 |
import org.openconcerto.erp.generationDoc.AbstractJOOReportsSheet;
|
18 |
import org.openconcerto.erp.generationDoc.AbstractJOOReportsSheet;
|
19 |
import org.openconcerto.sql.Configuration;
|
19 |
import org.openconcerto.sql.Configuration;
|
20 |
import org.openconcerto.sql.model.SQLRow;
|
20 |
import org.openconcerto.sql.model.SQLRow;
|
21 |
import org.openconcerto.sql.model.SQLSelect;
|
21 |
import org.openconcerto.sql.model.SQLSelect;
|
22 |
import org.openconcerto.sql.model.Where;
|
22 |
import org.openconcerto.sql.model.Where;
|
- |
|
23 |
import org.openconcerto.sql.users.UserManager;
|
23 |
import org.openconcerto.utils.GestionDevise;
|
24 |
import org.openconcerto.utils.GestionDevise;
|
24 |
|
25 |
|
25 |
import java.util.Date;
|
26 |
import java.util.Date;
|
26 |
import java.util.HashMap;
|
27 |
import java.util.HashMap;
|
27 |
import java.util.List;
|
28 |
import java.util.List;
|
Line 47... |
Line 48... |
47 |
|
48 |
|
48 |
/**
|
49 |
/**
|
49 |
* @return une Map contenant les valeurs à remplacer dans la template
|
50 |
* @return une Map contenant les valeurs à remplacer dans la template
|
50 |
*/
|
51 |
*/
|
51 |
protected Map<String, Object> createMap() {
|
52 |
protected Map<String, Object> createMap() {
|
- |
|
53 |
final Map<String, Object> map = new HashMap<String, Object>();
|
52 |
|
54 |
|
53 |
final SQLRow rowSoc = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
|
55 |
final SQLRow rowSoc = ((ComptaPropsConfiguration) Configuration.getInstance()).getRowSociete();
|
54 |
final SQLRow rowSocAdresse = rowSoc.getForeignRow("ID_ADRESSE_COMMON");
|
56 |
final SQLRow rowSocAdresse = rowSoc.getForeignRow("ID_ADRESSE_COMMON");
|
- |
|
57 |
SQLRow rowUser = rowSoc.getTable().getDBRoot().findTable("USER_COMMON").getRow(UserManager.getUser().getId());
|
- |
|
58 |
map.put("UserName", rowUser.getString("NOM"));
|
- |
|
59 |
map.put("UserFirstName", rowUser.getString("PRENOM"));
|
- |
|
60 |
if (rowUser.getTable().contains("MAIL")) {
|
- |
|
61 |
map.put("UserMail", rowUser.getString("MAIL"));
|
55 |
|
62 |
}
|
- |
|
63 |
if (rowUser.getTable().contains("TEL")) {
|
56 |
final Map<String, Object> map = new HashMap<String, Object>();
|
64 |
map.put("UserTel", rowUser.getString("TEL"));
|
57 |
|
65 |
}
|
58 |
// Infos societe
|
66 |
// Infos societe
|
59 |
map.put("SocieteType", rowSoc.getString("TYPE"));
|
67 |
map.put("SocieteType", rowSoc.getString("TYPE"));
|
60 |
map.put("SocieteNom", rowSoc.getString("NOM"));
|
68 |
map.put("SocieteNom", rowSoc.getString("NOM"));
|
61 |
map.put("SocieteAdresse", rowSocAdresse.getString("RUE"));
|
69 |
map.put("SocieteAdresse", rowSocAdresse.getString("RUE"));
|
62 |
map.put("SocieteCodePostal", rowSocAdresse.getString("CODE_POSTAL"));
|
70 |
map.put("SocieteCodePostal", rowSocAdresse.getString("CODE_POSTAL"));
|
Line 125... |
Line 133... |
125 |
Date dFacture = (Date) rowFacture.getObject("DATE");
|
133 |
Date dFacture = (Date) rowFacture.getObject("DATE");
|
126 |
SQLRow modeRegRow = rowFacture.getForeignRow("ID_MODE_REGLEMENT");
|
134 |
SQLRow modeRegRow = rowFacture.getForeignRow("ID_MODE_REGLEMENT");
|
127 |
Date dateEch = ModeDeReglementSQLElement.calculDate(modeRegRow.getInt("AJOURS"), modeRegRow.getInt("LENJOUR"), dFacture);
|
135 |
Date dateEch = ModeDeReglementSQLElement.calculDate(modeRegRow.getInt("AJOURS"), modeRegRow.getInt("LENJOUR"), dFacture);
|
128 |
map.put("FactureDateEcheance", dateFormat2.format(dateEch));
|
136 |
map.put("FactureDateEcheance", dateFormat2.format(dateEch));
|
129 |
|
137 |
|
130 |
SQLSelect sel = new SQLSelect(Configuration.getInstance().getBase());
|
138 |
SQLSelect sel = new SQLSelect();
|
131 |
sel.addSelect(this.rowRelance.getTable().getKey());
|
139 |
sel.addSelect(this.rowRelance.getTable().getKey());
|
132 |
sel.setWhere(new Where(this.rowRelance.getTable().getField("ID_SAISIE_VENTE_FACTURE"), "=", this.rowRelance.getInt("ID_SAISIE_VENTE_FACTURE")));
|
140 |
sel.setWhere(new Where(this.rowRelance.getTable().getField("ID_SAISIE_VENTE_FACTURE"), "=", this.rowRelance.getInt("ID_SAISIE_VENTE_FACTURE")));
|
133 |
sel.addFieldOrder(this.rowRelance.getTable().getField("DATE"));
|
141 |
sel.addFieldOrder(this.rowRelance.getTable().getField("DATE"));
|
134 |
@SuppressWarnings("unchecked")
|
142 |
@SuppressWarnings("unchecked")
|
135 |
List<Map<String, Number>> listResult = Configuration.getInstance().getBase().getDataSource().execute(sel.asString());
|
143 |
List<Map<String, Number>> listResult = Configuration.getInstance().getBase().getDataSource().execute(sel.asString());
|