OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 93 Rev 177
Line 14... Line 14...
14
 package org.openconcerto.erp.core.finance.payment.element;
14
 package org.openconcerto.erp.core.finance.payment.element;
15
 
15
 
16
import org.openconcerto.erp.core.common.element.BanqueSQLElement;
16
import org.openconcerto.erp.core.common.element.BanqueSQLElement;
17
import org.openconcerto.erp.core.common.ui.DeviseField;
17
import org.openconcerto.erp.core.common.ui.DeviseField;
18
import org.openconcerto.erp.core.finance.accounting.element.MouvementSQLElement;
18
import org.openconcerto.erp.core.finance.accounting.element.MouvementSQLElement;
-
 
19
import org.openconcerto.erp.core.finance.payment.component.ModeDeReglementSQLComponent;
19
import org.openconcerto.erp.core.finance.payment.ui.RegleMontantTable;
20
import org.openconcerto.erp.core.finance.payment.ui.RegleMontantTable;
20
import org.openconcerto.erp.generationEcritures.GenerationReglementAchat;
21
import org.openconcerto.erp.generationEcritures.GenerationReglementAchat;
21
import org.openconcerto.erp.preferences.ModeReglementDefautPrefPanel;
22
import org.openconcerto.erp.preferences.ModeReglementDefautPrefPanel;
22
import org.openconcerto.sql.Configuration;
23
import org.openconcerto.sql.Configuration;
23
import org.openconcerto.sql.element.BaseSQLComponent;
24
import org.openconcerto.sql.element.BaseSQLComponent;
Line 143... Line 144...
143
        c.gridy++;
144
        c.gridy++;
144
        c.gridwidth = GridBagConstraints.REMAINDER;
145
        c.gridwidth = GridBagConstraints.REMAINDER;
145
        this.addView("ID_MODE_REGLEMENT", BaseSQLComponent.REQ + ";" + BaseSQLComponent.DEC + ";" + BaseSQLComponent.SEP);
146
        this.addView("ID_MODE_REGLEMENT", BaseSQLComponent.REQ + ";" + BaseSQLComponent.DEC + ";" + BaseSQLComponent.SEP);
146
        final ElementSQLObject eltModeRegl = (ElementSQLObject) this.getView("ID_MODE_REGLEMENT");
147
        final ElementSQLObject eltModeRegl = (ElementSQLObject) this.getView("ID_MODE_REGLEMENT");
147
        this.add(eltModeRegl, c);
148
        this.add(eltModeRegl, c);
-
 
149
        ModeDeReglementSQLComponent modeReglComp;
-
 
150
        modeReglComp = (ModeDeReglementSQLComponent) eltModeRegl.getSQLChild();
-
 
151
        modeReglComp.addDateCompListener(this.date);
148
 
152
 
149
        this.addRequiredSQLObject(this.date, "DATE");
153
        this.addRequiredSQLObject(this.date, "DATE");
150
        this.addRequiredSQLObject(this.montant, "MONTANT");
154
        this.addRequiredSQLObject(this.montant, "MONTANT");
151
 
155
 
152
        final TableModelListener tableListener = new TableModelListener() {
156
        final TableModelListener tableListener = new TableModelListener() {
Line 185... Line 189...
185
                                        if (rowModeRegl != null) {
189
                                        if (rowModeRegl != null) {
186
                                            System.err.println("Set mode de règlement");
190
                                            System.err.println("Set mode de règlement");
187
                                            int idTypeRegl = rowModeRegl.getInt("ID_TYPE_REGLEMENT");
191
                                            int idTypeRegl = rowModeRegl.getInt("ID_TYPE_REGLEMENT");
188
                                            SQLTable tableModeRegl = Configuration.getInstance().getDirectory().getElement("MODE_REGLEMENT").getTable();
192
                                            SQLTable tableModeRegl = Configuration.getInstance().getDirectory().getElement("MODE_REGLEMENT").getTable();
189
                                            SQLRowValues rowVals = new SQLRowValues(tableModeRegl);
193
                                            SQLRowValues rowVals = new SQLRowValues(tableModeRegl);                                           
190
                                            if (idTypeRegl > TypeReglementSQLElement.TRAITE) {
-
 
191
                                                idTypeRegl = TypeReglementSQLElement.CHEQUE;
-
 
192
                                            }
-
 
193
                                            rowVals.put("ID_TYPE_REGLEMENT", idTypeRegl);
194
                                            rowVals.put("ID_TYPE_REGLEMENT", idTypeRegl);
194
                                            rowVals.put("COMPTANT", Boolean.TRUE);
195
                                            rowVals.put("COMPTANT", Boolean.TRUE);
195
                                            rowVals.put("AJOURS", 0);
196
                                            rowVals.put("AJOURS", 0);
196
                                            rowVals.put("LENJOUR", 0);
197
                                            rowVals.put("LENJOUR", 0);
197
                                            rowVals.put("ID_" + BanqueSQLElement.TABLENAME, rowModeRegl.getInt("ID_" + BanqueSQLElement.TABLENAME));
198
                                            rowVals.put("ID_" + BanqueSQLElement.TABLENAME, rowModeRegl.getInt("ID_" + BanqueSQLElement.TABLENAME));