OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Rev 174 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
Line 59... Line 59...
59
import org.openconcerto.ui.FormLayouter;
59
import org.openconcerto.ui.FormLayouter;
60
import org.openconcerto.ui.JDate;
60
import org.openconcerto.ui.JDate;
61
import org.openconcerto.ui.TitledSeparator;
61
import org.openconcerto.ui.TitledSeparator;
62
import org.openconcerto.ui.component.ITextArea;
62
import org.openconcerto.ui.component.ITextArea;
63
import org.openconcerto.utils.ExceptionHandler;
63
import org.openconcerto.utils.ExceptionHandler;
-
 
64
import org.openconcerto.utils.text.SimpleDocumentListener;
64
 
65
 
65
import java.awt.Color;
66
import java.awt.Color;
66
import java.awt.GridBagConstraints;
67
import java.awt.GridBagConstraints;
67
import java.awt.GridBagLayout;
68
import java.awt.GridBagLayout;
68
import java.beans.PropertyChangeEvent;
69
import java.beans.PropertyChangeEvent;
Line 328... Line 329...
328
                    System.err.println("SET WHERE ID_CLIENT = " + wantedID);
329
                    System.err.println("SET WHERE ID_CLIENT = " + wantedID);
329
                    if (wantedID != SQLRow.NONEXISTANT_ID && wantedID >= SQLRow.MIN_VALID_ID) {
330
                    if (wantedID != SQLRow.NONEXISTANT_ID && wantedID >= SQLRow.MIN_VALID_ID) {
330
 
331
 
331
                        final SQLRow rowClient = getTable().getForeignTable("ID_CLIENT").getRow(wantedID);
332
                        final SQLRow rowClient = getTable().getForeignTable("ID_CLIENT").getRow(wantedID);
332
 
333
 
-
 
334
                        if (rowClient.getObject("ID_CATEGORIE_COMPTABLE") != null && !rowClient.isForeignEmpty("ID_CATEGORIE_COMPTABLE")) {
-
 
335
                            table.setRowCatComptable(rowClient.getForeign("ID_CATEGORIE_COMPTABLE"));
-
 
336
                        } else {
-
 
337
                            table.setRowCatComptable(null);
-
 
338
                        }
-
 
339
 
333
                        if (!rowClient.isForeignEmpty("ID_COMMERCIAL")) {
340
                        if (!rowClient.isForeignEmpty("ID_COMMERCIAL")) {
334
                            comboCommercial.setValue(rowClient.getForeignID("ID_COMMERCIAL"));
341
                            comboCommercial.setValue(rowClient.getForeignID("ID_COMMERCIAL"));
335
                        }
342
                        }
336
                        int idClient = rowClient.getID();
343
                        int idClient = rowClient.getID();
337
                        comboContact.getRequest().setWhere(new Where(contactElement.getTable().getField("ID_CLIENT"), "=", idClient));
344
                        comboContact.getRequest().setWhere(new Where(contactElement.getTable().getField("ID_CLIENT"), "=", idClient));
338
                    } else {
345
                    } else {
-
 
346
                        table.setRowCatComptable(null);
339
                        comboContact.getRequest().setWhere(Where.FALSE);
347
                        comboContact.getRequest().setWhere(Where.FALSE);
340
                        // DevisSQLComponent.this.table.setTarif(null, false);
348
                        // DevisSQLComponent.this.table.setTarif(null, false);
341
                    }
349
                    }
342
                }
350
                }
343
            });
351
            });
Line 556... Line 564...
556
        this.allowEditable("T_TTC", false);
564
        this.allowEditable("T_TTC", false);
557
        this.allowEditable("T_SERVICE", false);
565
        this.allowEditable("T_SERVICE", false);
558
 
566
 
559
        JTextField poids = new JTextField();
567
        JTextField poids = new JTextField();
560
        SQLRequestComboBox boxTaxePort = new SQLRequestComboBox(false, 8);
568
        SQLRequestComboBox boxTaxePort = new SQLRequestComboBox(false, 8);
-
 
569
 
561
        // addSQLObject(poids, "T_POIDS");
570
        // addSQLObject(poids, "T_POIDS");
562
        final TotalPanel totalTTC = new TotalPanel(this.table, fieldEco, fieldHT, fieldTVA, fieldTTC, textPortHT, textRemiseHT, fieldService, fieldHA, fieldDevise, poids, null,
571
        final TotalPanel totalTTC = new TotalPanel(this.table, fieldEco, fieldHT, fieldTVA, fieldTTC, textPortHT, textRemiseHT, fieldService, fieldHA, fieldDevise, poids, null,
563
                (getTable().contains("ID_TAXE_PORT") ? boxTaxePort : null), null);
572
                (getTable().contains("ID_TAXE_PORT") ? boxTaxePort : null), null);
564
 
573
 
565
        // INfos
574
        // INfos
Line 954... Line 963...
954
        if (getTable().contains("ID_TAXE_PORT")) {
963
        if (getTable().contains("ID_TAXE_PORT")) {
955
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
964
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
956
            rowVals.put("ID_TAXE_PORT", taxeDefault.getID());
965
            rowVals.put("ID_TAXE_PORT", taxeDefault.getID());
957
        }
966
        }
958
 
967
 
-
 
968
        if (getTable().contains("ID_TAXE_FRAIS_DOCUMENT")) {
-
 
969
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
-
 
970
            rowVals.put("ID_TAXE_FRAIS_DOCUMENT", taxeDefault.getID());
-
 
971
        }
-
 
972
 
959
        return rowVals;
973
        return rowVals;
960
    }
974
    }
961
 
975
 
962
    @Override
976
    @Override
963
    protected void refreshAfterSelect(SQLRowAccessor r) {
977
    protected void refreshAfterSelect(SQLRowAccessor r) {