OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 177
Line 13... Line 13...
13
 
13
 
14
 package org.openconcerto.erp.core.finance.accounting.element;
14
 package org.openconcerto.erp.core.finance.accounting.element;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
-
 
18
import org.openconcerto.erp.core.finance.accounting.ui.AnalytiqueItemTable;
18
import org.openconcerto.erp.core.finance.accounting.ui.SaisieKmItemTable;
19
import org.openconcerto.erp.core.finance.accounting.ui.SaisieKmItemTable;
19
import org.openconcerto.erp.generationEcritures.GenerationMvtSaisieKm;
20
import org.openconcerto.erp.generationEcritures.GenerationMvtSaisieKm;
20
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.element.BaseSQLComponent;
22
import org.openconcerto.sql.element.BaseSQLComponent;
22
import org.openconcerto.sql.element.SQLComponent;
23
import org.openconcerto.sql.element.SQLComponent;
Line 112... Line 113...
112
        int idSaisie = 1;
113
        int idSaisie = 1;
113
        SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
114
        SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
114
        SQLTable ecrTable = base.getTable("ECRITURE");
115
        SQLTable ecrTable = base.getTable("ECRITURE");
115
        SQLTable compteTable = base.getTable("COMPTE_PCE");
116
        SQLTable compteTable = base.getTable("COMPTE_PCE");
116
        SQLTable saisieKmTable = base.getTable("SAISIE_KM_ELEMENT");
117
        SQLTable saisieKmTable = base.getTable("SAISIE_KM_ELEMENT");
-
 
118
        SQLTable assocTable = base.getTable("ASSOCIATION_ANALYTIQUE");
117
 
119
 
118
        SQLRowValues vals = new SQLRowValues(base.getTable("SAISIE_KM"));
120
        SQLRowValues vals = new SQLRowValues(base.getTable("SAISIE_KM"));
119
        vals.put("ID_MOUVEMENT", new Integer(idMvt));
121
        vals.put("ID_MOUVEMENT", new Integer(idMvt));
120
 
122
 
121
        SQLRow rowSaisieKm = vals.insert();
123
        SQLRow rowSaisieKm = vals.insert();
Line 150... Line 152...
150
                    valsTmp.put("NOM_PIECE", rowEcrTmp.getString("NOM_PIECE"));
152
                    valsTmp.put("NOM_PIECE", rowEcrTmp.getString("NOM_PIECE"));
151
                }
153
                }
152
                valsTmp.put("DEBIT", rowEcrTmp.getObject("DEBIT"));
154
                valsTmp.put("DEBIT", rowEcrTmp.getObject("DEBIT"));
153
                valsTmp.put("CREDIT", rowEcrTmp.getObject("CREDIT"));
155
                valsTmp.put("CREDIT", rowEcrTmp.getObject("CREDIT"));
154
                valsTmp.put("ID_ECRITURE", new Integer(rowEcrTmp.getID()));
156
                valsTmp.put("ID_ECRITURE", new Integer(rowEcrTmp.getID()));
-
 
157
 
-
 
158
                List<SQLRow> assocRows = rowEcrTmp.getReferentRows(assocTable);
-
 
159
                if (assocRows.size() > 0) {
-
 
160
                    for (int a = 0; a < assocRows.size(); a++) {
-
 
161
                        assocRows.get(a).createUpdateRow().put("ID_SAISIE_KM_ELEMENT", valsTmp);
-
 
162
                    }
-
 
163
                    valsTmp.put("ANALYTIQUE", AnalytiqueItemTable.getStringAssocs(valsTmp));
-
 
164
                }
-
 
165
 
155
                valsTmp.insert();
166
                valsTmp.commit();
156
            }
167
            }
157
 
168
 
158
            Object[] objTmp = (Object[]) myListEcriture.get(0);
169
            Object[] objTmp = (Object[]) myListEcriture.get(0);
159
            SQLRow rowEcrTmp = ecrTable.getRow(Integer.parseInt(objTmp[0].toString()));
170
            SQLRow rowEcrTmp = ecrTable.getRow(Integer.parseInt(objTmp[0].toString()));
160
            vals.put("NOM", rowEcrTmp.getString("NOM"));
171
            vals.put("NOM", rowEcrTmp.getString("NOM"));