OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 21 Rev 25
Line 42... Line 42...
42
import org.openconcerto.sql.sqlobject.ElementComboBox;
42
import org.openconcerto.sql.sqlobject.ElementComboBox;
43
import org.openconcerto.sql.sqlobject.ITextWithCompletion;
43
import org.openconcerto.sql.sqlobject.ITextWithCompletion;
44
import org.openconcerto.sql.sqlobject.JUniqueTextField;
44
import org.openconcerto.sql.sqlobject.JUniqueTextField;
45
import org.openconcerto.sql.sqlobject.SQLTextCombo;
45
import org.openconcerto.sql.sqlobject.SQLTextCombo;
46
import org.openconcerto.ui.DefaultGridBagConstraints;
46
import org.openconcerto.ui.DefaultGridBagConstraints;
-
 
47
import org.openconcerto.ui.FormLayouter;
47
import org.openconcerto.ui.TitledSeparator;
48
import org.openconcerto.ui.TitledSeparator;
48
import org.openconcerto.ui.component.ITextArea;
49
import org.openconcerto.ui.component.ITextArea;
49
 
50
 
50
import java.awt.Component;
51
import java.awt.Component;
51
import java.awt.Dimension;
52
import java.awt.Dimension;
Line 84... Line 85...
84
    protected boolean showMdr = true;
85
    protected boolean showMdr = true;
85
 
86
 
86
    protected List<String> getListFields() {
87
    protected List<String> getListFields() {
87
        final List<String> l = new ArrayList<String>();
88
        final List<String> l = new ArrayList<String>();
88
            l.add("CODE");
89
            l.add("CODE");
89
            l.add("FORME_JURIDIQUE");
90
            // l.add("FORME_JURIDIQUE");
90
        l.add("NOM");
91
        l.add("NOM");
-
 
92
        if (getTable().getFieldsName().contains("LOCALISATION")) {
-
 
93
            l.add("LOCALISATION");
-
 
94
        }
91
            l.add("RESPONSABLE");
95
            l.add("RESPONSABLE");
92
        l.add("ID_ADRESSE");
96
        l.add("ID_ADRESSE");
93
        l.add("TEL");
97
        l.add("TEL");
94
        l.add("FAX");
98
        l.add("FAX");
95
        l.add("MAIL");
99
        l.add("MAIL");
Line 113... Line 117...
113
 
117
 
114
    }
118
    }
115
 
119
 
116
    protected List<String> getComboFields() {
120
    protected List<String> getComboFields() {
117
        final List<String> l = new ArrayList<String>();
121
        final List<String> l = new ArrayList<String>();
118
        l.add("FORME_JURIDIQUE");
122
        // l.add("FORME_JURIDIQUE");
119
        l.add("NOM");
123
        l.add("NOM");
-
 
124
        if (getTable().getFieldsName().contains("LOCALISATION")) {
-
 
125
            l.add("LOCALISATION");
-
 
126
        } else {
120
        l.add("CODE");
127
            l.add("CODE");
-
 
128
        }
121
        return l;
129
        return l;
122
    }
130
    }
123
 
131
 
124
    protected List<String> getPrivateFields() {
132
    protected List<String> getPrivateFields() {
125
        final List<String> l = new ArrayList<String>();
133
        final List<String> l = new ArrayList<String>();
Line 232... Line 240...
232
                    c.weightx = 0.5;
240
                    c.weightx = 0.5;
233
                    DefaultGridBagConstraints.lockMinimumSize(boxPays);
241
                    DefaultGridBagConstraints.lockMinimumSize(boxPays);
234
                    this.add(boxPays, c);
242
                    this.add(boxPays, c);
235
                    this.addView(boxPays, "ID_PAYS");
243
                    this.addView(boxPays, "ID_PAYS");
236
                }
244
                }
-
 
245
                if (getTable().getFieldsName().contains("LOCALISATION")) {
-
 
246
                    c.gridy++;
-
 
247
                    c.gridx = 0;
-
 
248
                    c.weightx = 0;
-
 
249
                    JLabel comp2 = new JLabel(getLabelFor("LOCALISATION"));
-
 
250
                    comp2.setHorizontalAlignment(SwingConstants.RIGHT);
237
 
-
 
-
 
251
                    this.add(comp2, c);
-
 
252
                    JTextField loc = new JTextField();
-
 
253
                    c.gridx++;
-
 
254
                    c.weightx = 1;
-
 
255
                    // DefaultGridBagConstraints.lockMinimumSize(boxPays);
-
 
256
                    this.add(loc, c);
-
 
257
                    this.addView(loc, "LOCALISATION");
-
 
258
                }
238
                // Numero intracomm
259
                // Numero intracomm
239
                JLabel labelIntraComm = new JLabel("N° TVA");
260
                JLabel labelIntraComm = new JLabel("N° TVA");
240
                labelIntraComm.setHorizontalAlignment(SwingConstants.RIGHT);
261
                labelIntraComm.setHorizontalAlignment(SwingConstants.RIGHT);
241
                c.gridy++;
262
                c.gridy++;
242
                c.gridx = 0;
263
                c.gridx = 0;
Line 378... Line 399...
378
                });
399
                });
379
 
400
 
380
                // Secteur activité
401
                // Secteur activité
381
                final boolean customerIsKD;
402
                final boolean customerIsKD;
382
 
403
 
-
 
404
                // Champ Module
-
 
405
                c.gridx = 0;
-
 
406
                c.gridy++;
-
 
407
                c.gridwidth = GridBagConstraints.REMAINDER;
-
 
408
                final JPanel addP = new JPanel();
-
 
409
                this.setAdditionalFieldsPanel(new FormLayouter(addP, 1));
-
 
410
                this.add(addP, c);
-
 
411
 
-
 
412
                c.gridy++;
-
 
413
                c.gridwidth = 1;
-
 
414
 
383
                // Adresse
415
                // Adresse
384
                c.gridx = 0;
416
                c.gridx = 0;
385
                c.gridy++;
417
                c.gridy++;
386
                c.weightx = 1;
418
                c.weightx = 1;
387
                c.weighty = 0;
419
                c.weighty = 0;