OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
10
 * 
10
 * 
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.humanresources.payroll.element;
14
 package org.openconcerto.erp.core.humanresources.payroll.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.humanresources.payroll.ui.ContratPenibiliteTable;
18
import org.openconcerto.erp.core.humanresources.payroll.ui.ContratPenibiliteTable;
19
import org.openconcerto.erp.model.PrixHT;
19
import org.openconcerto.erp.model.PrixHT;
20
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.element.BaseSQLComponent;
21
import org.openconcerto.sql.element.BaseSQLComponent;
22
import org.openconcerto.sql.element.ElementSQLObject;
22
import org.openconcerto.sql.element.ElementSQLObject;
23
import org.openconcerto.sql.element.SQLComponent;
23
import org.openconcerto.sql.element.SQLComponent;
24
import org.openconcerto.sql.model.SQLBase;
24
import org.openconcerto.sql.model.SQLBase;
25
import org.openconcerto.sql.model.SQLRow;
25
import org.openconcerto.sql.model.SQLRow;
26
import org.openconcerto.sql.model.SQLRowAccessor;
26
import org.openconcerto.sql.model.SQLRowAccessor;
27
import org.openconcerto.sql.sqlobject.ElementComboBox;
27
import org.openconcerto.sql.sqlobject.ElementComboBox;
28
import org.openconcerto.ui.DefaultGridBagConstraints;
28
import org.openconcerto.ui.DefaultGridBagConstraints;
29
import org.openconcerto.ui.JDate;
29
import org.openconcerto.ui.JDate;
30
 
30
 
31
import java.awt.GridBagConstraints;
31
import java.awt.GridBagConstraints;
32
import java.awt.GridBagLayout;
32
import java.awt.GridBagLayout;
33
import java.util.ArrayList;
33
import java.util.ArrayList;
34
import java.util.List;
34
import java.util.List;
35
 
35
 
36
import javax.swing.BorderFactory;
36
import javax.swing.BorderFactory;
37
import javax.swing.JLabel;
37
import javax.swing.JLabel;
38
import javax.swing.JPanel;
38
import javax.swing.JPanel;
39
import javax.swing.JTextField;
39
import javax.swing.JTextField;
40
import javax.swing.SwingConstants;
40
import javax.swing.SwingConstants;
41
import javax.swing.event.DocumentEvent;
41
import javax.swing.event.DocumentEvent;
42
import javax.swing.event.DocumentListener;
42
import javax.swing.event.DocumentListener;
43
 
43
 
44
public class InfosSalariePayeSQLElement extends ComptaSQLConfElement {
44
public class InfosSalariePayeSQLElement extends ComptaSQLConfElement {
45
 
45
 
46
    public InfosSalariePayeSQLElement() {
46
    public InfosSalariePayeSQLElement() {
47
        super("INFOS_SALARIE_PAYE", "une fiche d'informations salarié-paye", "fiches d'informations salariés-payes");
47
        super("INFOS_SALARIE_PAYE", "une fiche d'informations salarié-paye", "fiches d'informations salariés-payes");
48
    }
48
    }
49
 
49
 
50
    @Override
50
    @Override
51
    public boolean isPrivate() {
51
    public boolean isPrivate() {
52
        return true;
52
        return true;
53
    }
53
    }
54
 
54
 
55
    protected List<String> getListFields() {
55
    protected List<String> getListFields() {
56
        final List<String> l = new ArrayList<String>();
56
        final List<String> l = new ArrayList<String>();
57
        l.add("ID_IDCC");
57
        l.add("ID_IDCC");
58
        l.add("ID_SALARIE");
58
        l.add("ID_SALARIE");
59
        return l;
59
        return l;
60
    }
60
    }
61
 
61
 
62
    protected List<String> getComboFields() {
62
    protected List<String> getComboFields() {
63
        final List<String> l = new ArrayList<String>();
63
        final List<String> l = new ArrayList<String>();
64
        l.add("ID_SALARIE");
64
        l.add("ID_SALARIE");
65
        l.add("ID_CONTRAT_SALARIE");
65
        l.add("ID_CONTRAT_SALARIE");
66
        return l;
66
        return l;
67
    }
67
    }
68
 
68
 
69
    /*
69
    /*
70
     * (non-Javadoc)
70
     * (non-Javadoc)
71
     * 
71
     * 
72
     * @see org.openconcerto.devis.SQLElement#getComponent()
72
     * @see org.openconcerto.devis.SQLElement#getComponent()
73
     */
73
     */
74
    public SQLComponent createComponent() {
74
    public SQLComponent createComponent() {
75
        return new BaseSQLComponent(this) {
75
        return new BaseSQLComponent(this) {
76
 
76
 
77
            private JTextField dureeMois;
77
            private JTextField dureeMois;
78
            private JTextField dureeHebdo;
78
            private JTextField dureeHebdo;
79
 
79
 
80
            private DocumentListener listenerMois = new DocumentListener() {
80
            private DocumentListener listenerMois = new DocumentListener() {
81
 
81
 
82
                public void insertUpdate(DocumentEvent e) {
82
                public void insertUpdate(DocumentEvent e) {
83
                    updateHebdo();
83
                    updateHebdo();
84
                }
84
                }
85
 
85
 
86
                public void removeUpdate(DocumentEvent e) {
86
                public void removeUpdate(DocumentEvent e) {
87
                    updateHebdo();
87
                    updateHebdo();
88
                }
88
                }
89
 
89
 
90
                public void changedUpdate(DocumentEvent e) {
90
                public void changedUpdate(DocumentEvent e) {
91
                    updateHebdo();
91
                    updateHebdo();
92
                }
92
                }
93
            };
93
            };
94
 
94
 
95
            private DocumentListener listenerHebdo = new DocumentListener() {
95
            private DocumentListener listenerHebdo = new DocumentListener() {
96
 
96
 
97
                public void insertUpdate(DocumentEvent e) {
97
                public void insertUpdate(DocumentEvent e) {
98
                    updateMois();
98
                    updateMois();
99
                }
99
                }
100
 
100
 
101
                public void removeUpdate(DocumentEvent e) {
101
                public void removeUpdate(DocumentEvent e) {
102
                    updateMois();
102
                    updateMois();
103
                }
103
                }
104
 
104
 
105
                public void changedUpdate(DocumentEvent e) {
105
                public void changedUpdate(DocumentEvent e) {
106
                    updateMois();
106
                    updateMois();
107
                }
107
                }
108
            };
108
            };
109
 
109
 
110
            ContratPenibiliteTable tablePeni = new ContratPenibiliteTable();
110
            ContratPenibiliteTable tablePeni = new ContratPenibiliteTable();
111
 
111
 
112
            @Override
112
            @Override
113
            public int insert(SQLRow order) {
113
            public int insert(SQLRow order) {
114
                // TODO Auto-generated method stub
114
                // TODO Auto-generated method stub
115
                int id = super.insert(order);
115
                int id = super.insert(order);
116
                tablePeni.updateField("ID_INFOS_SALARIE_PAYE", id);
116
                tablePeni.updateField("ID_INFOS_SALARIE_PAYE", id);
117
                return id;
117
                return id;
118
            }
118
            }
119
 
119
 
120
            @Override
120
            @Override
121
            public void update() {
121
            public void update() {
122
                // TODO Auto-generated method stub
122
                // TODO Auto-generated method stub
123
                int id = getSelectedID();
123
                int id = getSelectedID();
124
                super.update();
124
                super.update();
125
                tablePeni.updateField("ID_INFOS_SALARIE_PAYE", id);
125
                tablePeni.updateField("ID_INFOS_SALARIE_PAYE", id);
126
            }
126
            }
127
 
127
 
128
            public void addViews() {
128
            public void addViews() {
129
                this.setLayout(new GridBagLayout());
129
                this.setLayout(new GridBagLayout());
130
                GridBagConstraints c = new DefaultGridBagConstraints();
130
                GridBagConstraints c = new DefaultGridBagConstraints();
131
 
131
 
132
                // Convention collective
132
                // Convention collective
133
                JLabel labelConvention = new JLabel(getLabelFor("ID_IDCC"));
133
                JLabel labelConvention = new JLabel(getLabelFor("ID_IDCC"));
134
                labelConvention.setHorizontalAlignment(SwingConstants.RIGHT);
134
                labelConvention.setHorizontalAlignment(SwingConstants.RIGHT);
135
                final ElementComboBox comboConvention = new ElementComboBox();
135
                final ElementComboBox comboConvention = new ElementComboBox();
136
 
136
 
137
                this.add(labelConvention, c);
137
                this.add(labelConvention, c);
138
                c.gridx++;
138
                c.gridx++;
139
                c.gridwidth = GridBagConstraints.REMAINDER;
139
                c.gridwidth = GridBagConstraints.REMAINDER;
140
                c.weightx = 1;
140
                c.weightx = 1;
141
                this.add(comboConvention, c);
141
                this.add(comboConvention, c);
142
                c.gridwidth = 1;
142
                c.gridwidth = 1;
143
 
143
 
144
                // Classement conventionnel
144
                // Classement conventionnel
145
                c.fill = GridBagConstraints.BOTH;
145
                c.fill = GridBagConstraints.BOTH;
146
                JPanel panelClassement = new JPanel();
146
                JPanel panelClassement = new JPanel();
147
                panelClassement.setOpaque(false);
147
                panelClassement.setOpaque(false);
148
                panelClassement.setBorder(BorderFactory.createTitledBorder("Classement conventionnel"));
148
                panelClassement.setBorder(BorderFactory.createTitledBorder("Classement conventionnel"));
149
                panelClassement.setLayout(new GridBagLayout());
149
                panelClassement.setLayout(new GridBagLayout());
150
                this.addView("ID_CLASSEMENT_CONVENTIONNEL", REQ + ";" + DEC + ";" + SEP);
150
                this.addView("ID_CLASSEMENT_CONVENTIONNEL", REQ + ";" + DEC + ";" + SEP);
151
                ElementSQLObject eltClassement = (ElementSQLObject) this.getView("ID_CLASSEMENT_CONVENTIONNEL");
151
                ElementSQLObject eltClassement = (ElementSQLObject) this.getView("ID_CLASSEMENT_CONVENTIONNEL");
152
                c.gridx = 0;
152
                c.gridx = 0;
153
                c.gridy = 0;
153
                c.gridy = 0;
154
                c.weightx = 1;
154
                c.weightx = 1;
155
                panelClassement.add(eltClassement, c);
155
                panelClassement.add(eltClassement, c);
156
 
156
 
157
                c.gridy = 1;
157
                c.gridy = 1;
158
                c.gridx = 0;
158
                c.gridx = 0;
159
                c.gridwidth = 2;
159
                c.gridwidth = 2;
160
                c.weightx = 0;
160
                c.weightx = 0;
161
                this.add(panelClassement, c);
161
                this.add(panelClassement, c);
162
 
162
 
163
                // Classement conventionnel
163
                // Classement conventionnel
164
                final SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
164
                final SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
165
                if (base.getTable("COEFF_PRIME") != null) {
165
                if (base.getTable("COEFF_PRIME") != null) {
166
                    c.fill = GridBagConstraints.BOTH;
166
                    c.fill = GridBagConstraints.BOTH;
167
                    JPanel panelCoeff = new JPanel();
167
                    JPanel panelCoeff = new JPanel();
168
                    panelCoeff.setOpaque(false);
168
                    panelCoeff.setOpaque(false);
169
                    panelCoeff.setBorder(BorderFactory.createTitledBorder("Coefficient prime"));
169
                    panelCoeff.setBorder(BorderFactory.createTitledBorder("Coefficient prime"));
170
                    panelCoeff.setLayout(new GridBagLayout());
170
                    panelCoeff.setLayout(new GridBagLayout());
171
                    this.addView("ID_COEFF_PRIME", REQ + ";" + DEC + ";" + SEP);
171
                    this.addView("ID_COEFF_PRIME", REQ + ";" + DEC + ";" + SEP);
172
                    ElementSQLObject eltCoeff = (ElementSQLObject) this.getView("ID_COEFF_PRIME");
172
                    ElementSQLObject eltCoeff = (ElementSQLObject) this.getView("ID_COEFF_PRIME");
173
                    c.gridx = 0;
173
                    c.gridx = 0;
174
                    c.gridy = 0;
174
                    c.gridy = 0;
175
                    c.weightx = 1;
175
                    c.weightx = 1;
176
                    panelCoeff.add(eltCoeff, c);
176
                    panelCoeff.add(eltCoeff, c);
177
                    c.gridy = 2;
177
                    c.gridy = 2;
178
                    c.gridx = 0;
178
                    c.gridx = 0;
179
                    c.gridwidth = 2;
179
                    c.gridwidth = 2;
180
                    c.weightx = 0;
180
                    c.weightx = 0;
181
                    this.add(panelCoeff, c);
181
                    this.add(panelCoeff, c);
182
                    c.gridwidth = 1;
182
                    c.gridwidth = 1;
183
                }
183
                }
184
                // Contrat
184
                // Contrat
185
                c.fill = GridBagConstraints.BOTH;
185
                c.fill = GridBagConstraints.BOTH;
186
                JPanel panelContrat = new JPanel();
186
                JPanel panelContrat = new JPanel();
187
                panelContrat.setOpaque(false);
187
                panelContrat.setOpaque(false);
188
                panelContrat.setBorder(BorderFactory.createTitledBorder("Contrat de travail"));
188
                panelContrat.setBorder(BorderFactory.createTitledBorder("Contrat de travail"));
189
                panelContrat.setLayout(new GridBagLayout());
189
                panelContrat.setLayout(new GridBagLayout());
190
                GridBagConstraints c2 = new DefaultGridBagConstraints();
190
                GridBagConstraints c2 = new DefaultGridBagConstraints();
191
                c2.fill = GridBagConstraints.HORIZONTAL;
191
                c2.fill = GridBagConstraints.HORIZONTAL;
192
                c2.weighty = 1;
192
                c2.weighty = 1;
193
                c2.weightx = 1;
193
                c2.weightx = 1;
194
                c2.anchor = GridBagConstraints.NORTH;
194
                c2.anchor = GridBagConstraints.NORTH;
195
                this.addView("ID_CONTRAT_SALARIE", REQ + ";" + DEC + ";" + SEP);
195
                this.addView("ID_CONTRAT_SALARIE", REQ + ";" + DEC + ";" + SEP);
196
                ElementSQLObject eltContrat = (ElementSQLObject) this.getView("ID_CONTRAT_SALARIE");
196
                ElementSQLObject eltContrat = (ElementSQLObject) this.getView("ID_CONTRAT_SALARIE");
197
                panelContrat.add(eltContrat, c2);
197
                panelContrat.add(eltContrat, c2);
198
 
198
 
199
                c.gridx = 2;
199
                c.gridx = 2;
200
                c.gridy = 1;
200
                c.gridy = 1;
201
                c.gridheight = 4;
201
                c.gridheight = 4;
202
                c.gridwidth = GridBagConstraints.REMAINDER;
202
                c.gridwidth = GridBagConstraints.REMAINDER;
203
                c.weightx = 1;
203
                c.weightx = 1;
204
                this.add(panelContrat, c);
204
                this.add(panelContrat, c);
205
                c.gridwidth = 1;
205
                c.gridwidth = 1;
206
                c.gridheight = 1;
206
                c.gridheight = 1;
207
 
207
 
208
                /***********************************************************************************
208
                /***********************************************************************************
209
                 * DATE ENTREE / SORTIE
209
                 * DATE ENTREE / SORTIE
210
                 **********************************************************************************/
210
                 **********************************************************************************/
211
                JPanel panelEntreeSortie = new JPanel();
211
                JPanel panelEntreeSortie = new JPanel();
212
                panelEntreeSortie.setOpaque(false);
212
                panelEntreeSortie.setOpaque(false);
213
                panelEntreeSortie.setBorder(BorderFactory.createTitledBorder("Entrée/Sortie"));
213
                panelEntreeSortie.setBorder(BorderFactory.createTitledBorder("Entrée/Sortie"));
214
                panelEntreeSortie.setLayout(new GridBagLayout());
214
                panelEntreeSortie.setLayout(new GridBagLayout());
215
 
215
 
216
                // Date d'arrivée dans la société
216
                // Date d'arrivée dans la société
217
                JLabel labelDateArrive = new JLabel(getLabelFor("DATE_ARRIVE"));
217
                JLabel labelDateArrive = new JLabel(getLabelFor("DATE_ARRIVE"));
218
                labelDateArrive.setHorizontalAlignment(SwingConstants.RIGHT);
218
                labelDateArrive.setHorizontalAlignment(SwingConstants.RIGHT);
219
                JDate dateArrive = new JDate(true);
219
                JDate dateArrive = new JDate(true);
220
                c.gridy = 0;
220
                c.gridy = 0;
221
                c.gridx = 0;
221
                c.gridx = 0;
222
                c.weightx = 0;
222
                c.weightx = 0;
223
                c.fill = GridBagConstraints.HORIZONTAL;
223
                c.fill = GridBagConstraints.HORIZONTAL;
224
                panelEntreeSortie.add(labelDateArrive, c);
224
                panelEntreeSortie.add(labelDateArrive, c);
225
                c.gridx++;
225
                c.gridx++;
226
                panelEntreeSortie.add(dateArrive, c);
226
                panelEntreeSortie.add(dateArrive, c);
227
 
227
 
228
                // Date de sortie
228
                // Date de sortie
229
                JLabel labelDateSortie = new JLabel(getLabelFor("DATE_SORTIE"));
229
                JLabel labelDateSortie = new JLabel(getLabelFor("DATE_SORTIE"));
230
                labelDateSortie.setHorizontalAlignment(SwingConstants.RIGHT);
230
                labelDateSortie.setHorizontalAlignment(SwingConstants.RIGHT);
231
                JDate dateSortie = new JDate();
231
                JDate dateSortie = new JDate();
232
 
232
 
233
                c.gridy++;
233
                c.gridy++;
234
                c.gridx = 0;
234
                c.gridx = 0;
235
                c.fill = GridBagConstraints.HORIZONTAL;
235
                c.fill = GridBagConstraints.HORIZONTAL;
236
                panelEntreeSortie.add(labelDateSortie, c);
236
                panelEntreeSortie.add(labelDateSortie, c);
237
                c.gridx++;
237
                c.gridx++;
238
                panelEntreeSortie.add(dateSortie, c);
238
                panelEntreeSortie.add(dateSortie, c);
239
 
239
 
240
                /*
240
                /*
241
                 * // Ancienneté JLabel labelAnc = new
241
                 * // Ancienneté JLabel labelAnc = new
242
                 * JLabel(Configuration.getInstance().getTranslator
242
                 * JLabel(Configuration.getInstance().getTranslator
243
                 * ().getLabelFor(InfosSalariePayeSQLElement
243
                 * ().getLabelFor(InfosSalariePayeSQLElement
244
                 * .this.getTable().getField("DATE_SORTIE")));
244
                 * .this.getTable().getField("DATE_SORTIE")));
245
                 * labelDateSortie.setHorizontalAlignment(SwingConstants.RIGHT); JTextField textAnc
245
                 * labelDateSortie.setHorizontalAlignment(SwingConstants.RIGHT); JTextField textAnc
246
                 * = new JTextField(5, false);
246
                 * = new JTextField(5, false);
247
                 * 
247
                 * 
248
                 * c.gridy++; c.gridx = 0; c.fill = GridBagConstraints.HORIZONTAL;
248
                 * c.gridy++; c.gridx = 0; c.fill = GridBagConstraints.HORIZONTAL;
249
                 * panelEntreeSortie.add(labelAnc, c); c.gridx++; panelEntreeSortie.add(textAnc, c);
249
                 * panelEntreeSortie.add(labelAnc, c); c.gridx++; panelEntreeSortie.add(textAnc, c);
250
                 */
250
                 */
251
                c.gridx = 0;
251
                c.gridx = 0;
252
                c.gridy = 3;
252
                c.gridy = 3;
253
                c.gridwidth = 2;
253
                c.gridwidth = 2;
254
                this.add(panelEntreeSortie, c);
254
                this.add(panelEntreeSortie, c);
255
                c.gridwidth = 1;
255
                c.gridwidth = 1;
256
 
256
 
257
                JPanel panelPeni = new JPanel();
257
                JPanel panelPeni = new JPanel();
258
                panelPeni.setOpaque(false);
258
                panelPeni.setOpaque(false);
259
                panelPeni.setBorder(BorderFactory.createTitledBorder("Pénibilité (S21.G00.34)"));
259
                panelPeni.setBorder(BorderFactory.createTitledBorder("Pénibilité (S21.G00.34)"));
260
                panelPeni.setLayout(new GridBagLayout());
260
                panelPeni.setLayout(new GridBagLayout());
261
                GridBagConstraints cPeni = new DefaultGridBagConstraints();
261
                GridBagConstraints cPeni = new DefaultGridBagConstraints();
262
                cPeni.weightx = 1;
262
                cPeni.weightx = 1;
263
                cPeni.weighty = 1;
263
                cPeni.weighty = 1;
264
                cPeni.fill = GridBagConstraints.BOTH;
264
                cPeni.fill = GridBagConstraints.BOTH;
265
 
265
 
266
                panelPeni.add(tablePeni, cPeni);
266
                panelPeni.add(tablePeni, cPeni);
267
                c.gridy++;
267
                c.gridy++;
268
                c.weighty = 1;
268
                c.weighty = 1;
269
                c.fill = GridBagConstraints.BOTH;
269
                c.fill = GridBagConstraints.BOTH;
270
                this.add(panelPeni, c);
270
                this.add(panelPeni, c);
271
                c.fill = GridBagConstraints.HORIZONTAL;
271
                c.fill = GridBagConstraints.HORIZONTAL;
272
 
272
 
273
                /***********************************************************************************
273
                /***********************************************************************************
274
                 * Valeurs de bases
274
                 * Valeurs de bases
275
                 **********************************************************************************/
275
                 **********************************************************************************/
276
                JPanel panelBase = new JPanel();
276
                JPanel panelBase = new JPanel();
277
                panelBase.setOpaque(false);
277
                panelBase.setOpaque(false);
278
                panelBase.setBorder(BorderFactory.createTitledBorder("Valeurs de base"));
278
                panelBase.setBorder(BorderFactory.createTitledBorder("Valeurs de base"));
279
                panelBase.setLayout(new GridBagLayout());
279
                panelBase.setLayout(new GridBagLayout());
280
 
280
 
281
                // Durée mensuelle
281
                // Durée mensuelle
282
                JLabel labelDureeMois = new JLabel(getLabelFor("DUREE_MOIS"));
282
                JLabel labelDureeMois = new JLabel(getLabelFor("DUREE_MOIS"));
283
                labelDureeMois.setHorizontalAlignment(SwingConstants.RIGHT);
283
                labelDureeMois.setHorizontalAlignment(SwingConstants.RIGHT);
284
                this.dureeMois = new JTextField();
284
                this.dureeMois = new JTextField();
285
                c.gridy = 0;
285
                c.gridy = 0;
286
                c.gridx = 0;
286
                c.gridx = 0;
287
                c.gridheight = 1;
287
                c.gridheight = 1;
288
                c.fill = GridBagConstraints.HORIZONTAL;
288
                c.fill = GridBagConstraints.HORIZONTAL;
289
                panelBase.add(labelDureeMois, c);
289
                panelBase.add(labelDureeMois, c);
290
                c.gridx++;
290
                c.gridx++;
291
                c.weightx = 1;
291
                c.weightx = 1;
292
                panelBase.add(this.dureeMois, c);
292
                panelBase.add(this.dureeMois, c);
293
 
293
 
294
                // Durée hebdomadaire
294
                // Durée hebdomadaire
295
                JLabel labelDureeHebdo = new JLabel(getLabelFor("DUREE_HEBDO"));
295
                JLabel labelDureeHebdo = new JLabel(getLabelFor("DUREE_HEBDO"));
296
                labelDureeHebdo.setHorizontalAlignment(SwingConstants.RIGHT);
296
                labelDureeHebdo.setHorizontalAlignment(SwingConstants.RIGHT);
297
                this.dureeHebdo = new JTextField();
297
                this.dureeHebdo = new JTextField();
298
                c.gridx++;
298
                c.gridx++;
299
                c.weightx = 0;
299
                c.weightx = 0;
300
                panelBase.add(labelDureeHebdo, c);
300
                panelBase.add(labelDureeHebdo, c);
301
                c.gridx++;
301
                c.gridx++;
302
                c.weightx = 1;
302
                c.weightx = 1;
303
                panelBase.add(this.dureeHebdo, c);
303
                panelBase.add(this.dureeHebdo, c);
304
 
304
 
305
                // Salaire de base
305
                // Salaire de base
306
                JLabel labelSalaireBase = new JLabel(getLabelFor("SALAIRE_MOIS"));
306
                JLabel labelSalaireBase = new JLabel(getLabelFor("SALAIRE_MOIS"));
307
                labelSalaireBase.setHorizontalAlignment(SwingConstants.RIGHT);
307
                labelSalaireBase.setHorizontalAlignment(SwingConstants.RIGHT);
308
                JTextField salaireBase = new JTextField();
308
                JTextField salaireBase = new JTextField();
309
                c.gridx++;
309
                c.gridx++;
310
                c.weightx = 0;
310
                c.weightx = 0;
311
                panelBase.add(labelSalaireBase, c);
311
                panelBase.add(labelSalaireBase, c);
312
                c.gridx++;
312
                c.gridx++;
313
                c.weightx = 1;
313
                c.weightx = 1;
314
                panelBase.add(salaireBase, c);
314
                panelBase.add(salaireBase, c);
315
 
315
 
316
                if (getTable().contains("PRIME_TRANSPORT")) {
316
                if (getTable().contains("PRIME_TRANSPORT")) {
317
 
317
 
318
                    // PRIME_TRANSPORT
318
                    // PRIME_TRANSPORT
319
                    JLabel labelTransport = new JLabel(getLabelFor("PRIME_TRANSPORT"));
319
                    JLabel labelTransport = new JLabel(getLabelFor("PRIME_TRANSPORT"));
320
                    labelTransport.setHorizontalAlignment(SwingConstants.RIGHT);
320
                    labelTransport.setHorizontalAlignment(SwingConstants.RIGHT);
321
 
321
 
322
                    c.gridy++;
322
                    c.gridy++;
323
                    c.gridx = 0;
323
                    c.gridx = 0;
324
                    c.gridheight = 1;
324
                    c.gridheight = 1;
325
                    c.fill = GridBagConstraints.HORIZONTAL;
325
                    c.fill = GridBagConstraints.HORIZONTAL;
326
                    panelBase.add(labelTransport, c);
326
                    panelBase.add(labelTransport, c);
327
                    c.gridx++;
327
                    c.gridx++;
328
                    c.weightx = 1;
328
                    c.weightx = 1;
329
                    JTextField fieldTransp = new JTextField();
329
                    JTextField fieldTransp = new JTextField();
330
                    panelBase.add(fieldTransp, c);
330
                    panelBase.add(fieldTransp, c);
331
                    addView(fieldTransp, "PRIME_TRANSPORT");
331
                    addView(fieldTransp, "PRIME_TRANSPORT");
332
 
332
 
333
                    // Durée hebdomadaire
333
                    // Durée hebdomadaire
334
                    JLabel labelPanier = new JLabel(getLabelFor("PRIME_PANIER"));
334
                    JLabel labelPanier = new JLabel(getLabelFor("PRIME_PANIER"));
335
                    labelPanier.setHorizontalAlignment(SwingConstants.RIGHT);
335
                    labelPanier.setHorizontalAlignment(SwingConstants.RIGHT);
336
                    JTextField fieldPanier = new JTextField();
336
                    JTextField fieldPanier = new JTextField();
337
                    c.gridx++;
337
                    c.gridx++;
338
                    c.weightx = 0;
338
                    c.weightx = 0;
339
                    panelBase.add(labelPanier, c);
339
                    panelBase.add(labelPanier, c);
340
                    c.gridx++;
340
                    c.gridx++;
341
                    c.weightx = 1;
341
                    c.weightx = 1;
342
                    panelBase.add(fieldPanier, c);
342
                    panelBase.add(fieldPanier, c);
343
                    addView(fieldPanier, "PRIME_PANIER");
343
                    addView(fieldPanier, "PRIME_PANIER");
344
 
344
 
345
                    // Salaire de base
345
                    // Salaire de base
346
                    JLabel labelLogement = new JLabel(getLabelFor("PRIME_LOGEMENT"));
346
                    JLabel labelLogement = new JLabel(getLabelFor("PRIME_LOGEMENT"));
347
                    labelLogement.setHorizontalAlignment(SwingConstants.RIGHT);
347
                    labelLogement.setHorizontalAlignment(SwingConstants.RIGHT);
348
                    JTextField fieldLogement = new JTextField();
348
                    JTextField fieldLogement = new JTextField();
349
                    c.gridx++;
349
                    c.gridx++;
350
                    c.weightx = 0;
350
                    c.weightx = 0;
351
                    panelBase.add(labelLogement, c);
351
                    panelBase.add(labelLogement, c);
352
                    c.gridx++;
352
                    c.gridx++;
353
                    c.weightx = 1;
353
                    c.weightx = 1;
354
                    panelBase.add(fieldLogement, c);
354
                    panelBase.add(fieldLogement, c);
355
                    addView(fieldLogement, "PRIME_LOGEMENT");
355
                    addView(fieldLogement, "PRIME_LOGEMENT");
356
 
356
 
357
                    // PRIME_TRANSPORT
357
                    // PRIME_TRANSPORT
358
                    JLabel labelCnam = new JLabel(getLabelFor("NUMERO_CNAM"));
358
                    JLabel labelCnam = new JLabel(getLabelFor("NUMERO_CNAM"));
359
                    labelCnam.setHorizontalAlignment(SwingConstants.RIGHT);
359
                    labelCnam.setHorizontalAlignment(SwingConstants.RIGHT);
360
                    c.gridy++;
360
                    c.gridy++;
361
                    c.gridx = 0;
361
                    c.gridx = 0;
362
                    c.gridheight = 1;
362
                    c.gridheight = 1;
363
                    c.fill = GridBagConstraints.HORIZONTAL;
363
                    c.fill = GridBagConstraints.HORIZONTAL;
364
                    panelBase.add(labelCnam, c);
364
                    panelBase.add(labelCnam, c);
365
                    c.gridx++;
365
                    c.gridx++;
366
                    c.weightx = 1;
366
                    c.weightx = 1;
367
                    JTextField fieldCnam = new JTextField();
367
                    JTextField fieldCnam = new JTextField();
368
                    panelBase.add(fieldCnam, c);
368
                    panelBase.add(fieldCnam, c);
369
                    addView(fieldCnam, "NUMERO_CNAM");
369
                    addView(fieldCnam, "NUMERO_CNAM");
370
 
370
 
371
                    // Durée hebdomadaire
371
                    // Durée hebdomadaire
372
                    JLabel labelCNSS = new JLabel(getLabelFor("NUMERO_CNSS"));
372
                    JLabel labelCNSS = new JLabel(getLabelFor("NUMERO_CNSS"));
373
                    labelCNSS.setHorizontalAlignment(SwingConstants.RIGHT);
373
                    labelCNSS.setHorizontalAlignment(SwingConstants.RIGHT);
374
                    JTextField fieldCnss = new JTextField();
374
                    JTextField fieldCnss = new JTextField();
375
                    c.gridx++;
375
                    c.gridx++;
376
                    c.weightx = 0;
376
                    c.weightx = 0;
377
                    panelBase.add(labelCNSS, c);
377
                    panelBase.add(labelCNSS, c);
378
                    c.gridx++;
378
                    c.gridx++;
379
                    c.weightx = 1;
379
                    c.weightx = 1;
380
                    panelBase.add(fieldCnss, c);
380
                    panelBase.add(fieldCnss, c);
381
                    addView(fieldCnss, "NUMERO_CNSS");
381
                    addView(fieldCnss, "NUMERO_CNSS");
382
 
382
 
383
                }
383
                }
384
                // Taux AT
384
                // Taux AT
385
                JLabel labelTauxAT = new JLabel(getLabelFor("TAUX_AT"));
385
                JLabel labelTauxAT = new JLabel(getLabelFor("TAUX_AT"));
386
                labelTauxAT.setHorizontalAlignment(SwingConstants.RIGHT);
386
                labelTauxAT.setHorizontalAlignment(SwingConstants.RIGHT);
387
                JTextField tauxAT = new JTextField();
387
                JTextField tauxAT = new JTextField();
388
                c.gridy++;
388
                c.gridy++;
389
                c.gridx = 0;
389
                c.gridx = 0;
390
                c.weightx = 0;
390
                c.weightx = 0;
391
                panelBase.add(labelTauxAT, c);
391
                panelBase.add(labelTauxAT, c);
392
                c.gridx++;
392
                c.gridx++;
393
                c.weightx = 1;
393
                c.weightx = 1;
394
                panelBase.add(tauxAT, c);
394
                panelBase.add(tauxAT, c);
395
 
395
 
396
                // Congés payés
396
                // Congés payés
397
                JLabel labelConges = new JLabel(getLabelFor("CONGES_PAYES"));
397
                JLabel labelConges = new JLabel(getLabelFor("CONGES_PAYES"));
398
                labelConges.setHorizontalAlignment(SwingConstants.RIGHT);
398
                labelConges.setHorizontalAlignment(SwingConstants.RIGHT);
399
                JTextField conges = new JTextField();
399
                JTextField conges = new JTextField();
400
                c.gridx++;
400
                c.gridx++;
401
                c.weightx = 0;
401
                c.weightx = 0;
402
                panelBase.add(labelConges, c);
402
                panelBase.add(labelConges, c);
403
                c.gridx++;
403
                c.gridx++;
404
                c.weightx = 1;
404
                c.weightx = 1;
405
                panelBase.add(conges, c);
405
                panelBase.add(conges, c);
406
 
406
 
407
                if (getTable().contains("BASE_FILLON_ANNUELLE")) {
407
                if (getTable().contains("BASE_FILLON_ANNUELLE")) {
408
                    JLabel labelFillon = new JLabel(getLabelFor("BASE_FILLON_ANNUELLE"));
408
                    JLabel labelFillon = new JLabel(getLabelFor("BASE_FILLON_ANNUELLE"));
409
                    labelFillon.setHorizontalAlignment(SwingConstants.RIGHT);
409
                    labelFillon.setHorizontalAlignment(SwingConstants.RIGHT);
410
                    JTextField fillon = new JTextField();
410
                    JTextField fillon = new JTextField();
411
                    c.gridx++;
411
                    c.gridx++;
412
                    c.weightx = 0;
412
                    c.weightx = 0;
413
                    panelBase.add(labelFillon, c);
413
                    panelBase.add(labelFillon, c);
414
                    c.gridx++;
414
                    c.gridx++;
415
                    c.weightx = 1;
415
                    c.weightx = 1;
416
                    panelBase.add(fillon, c);
416
                    panelBase.add(fillon, c);
417
                    addView(fillon, "BASE_FILLON_ANNUELLE");
417
                    addView(fillon, "BASE_FILLON_ANNUELLE");
418
                }
418
                }
419
 
419
 
420
                // Code AT
420
                // Code AT
421
                JLabel labelCodeAT = new JLabel(getLabelFor("CODE_AT"));
421
                JLabel labelCodeAT = new JLabel(getLabelFor("CODE_AT"));
422
                labelCodeAT.setHorizontalAlignment(SwingConstants.RIGHT);
422
                labelCodeAT.setHorizontalAlignment(SwingConstants.RIGHT);
423
                JTextField CodeAT = new JTextField();
423
                JTextField CodeAT = new JTextField();
424
                c.gridy++;
424
                c.gridy++;
425
                c.gridx = 0;
425
                c.gridx = 0;
426
                c.weightx = 0;
426
                c.weightx = 0;
427
                panelBase.add(labelCodeAT, c);
427
                panelBase.add(labelCodeAT, c);
428
                c.gridx++;
428
                c.gridx++;
429
                c.weightx = 1;
429
                c.weightx = 1;
430
                panelBase.add(CodeAT, c);
430
                panelBase.add(CodeAT, c);
431
                addView(CodeAT, "CODE_AT", REQ);
431
                addView(CodeAT, "CODE_AT", REQ);
432
 
432
 
433
                // Code section AT
433
                // Code section AT
434
                JLabel labelSectionAT = new JLabel(getLabelFor("CODE_SECTION_AT"));
434
                JLabel labelSectionAT = new JLabel(getLabelFor("CODE_SECTION_AT"));
435
                labelSectionAT.setHorizontalAlignment(SwingConstants.RIGHT);
435
                labelSectionAT.setHorizontalAlignment(SwingConstants.RIGHT);
436
                JTextField sectionAT = new JTextField();
436
                JTextField sectionAT = new JTextField();
437
                c.gridx++;
437
                c.gridx++;
438
                c.weightx = 0;
438
                c.weightx = 0;
439
                panelBase.add(labelSectionAT, c);
439
                panelBase.add(labelSectionAT, c);
440
                c.gridx++;
440
                c.gridx++;
441
                c.weightx = 1;
441
                c.weightx = 1;
442
                panelBase.add(sectionAT, c);
442
                panelBase.add(sectionAT, c);
443
                addView(sectionAT, "CODE_SECTION_AT");
443
                addView(sectionAT, "CODE_SECTION_AT");
444
 
444
 
-
 
445
                if (getTable().contains("DUREE_FORFAIT")) {
-
 
446
                    JLabel labelForfait = new JLabel(getLabelFor("DUREE_FORFAIT"));
-
 
447
                    labelForfait.setHorizontalAlignment(SwingConstants.RIGHT);
-
 
448
                    JTextField forfait = new JTextField();
-
 
449
                    c.gridx++;
-
 
450
                    c.weightx = 0;
-
 
451
                    panelBase.add(labelForfait, c);
-
 
452
                    c.gridx++;
-
 
453
                    c.weightx = 1;
-
 
454
                    panelBase.add(forfait, c);
-
 
455
                    addView(forfait, "DUREE_FORFAIT");
-
 
456
                }
-
 
457
 
445
                c.gridy = 5;
458
                c.gridy = 5;
446
                c.gridx = 0;
459
                c.gridx = 0;
447
                c.gridwidth = GridBagConstraints.REMAINDER;
460
                c.gridwidth = GridBagConstraints.REMAINDER;
448
                c.weighty = 1;
461
                c.weighty = 1;
449
                c.weightx = 1;
462
                c.weightx = 1;
450
                c.anchor = GridBagConstraints.NORTHWEST;
463
                c.anchor = GridBagConstraints.NORTHWEST;
451
                this.add(panelBase, c);
464
                this.add(panelBase, c);
452
 
465
 
453
                this.addRequiredSQLObject(comboConvention, "ID_IDCC");
466
                this.addRequiredSQLObject(comboConvention, "ID_IDCC");
454
                this.addRequiredSQLObject(dateArrive, "DATE_ARRIVE");
467
                this.addRequiredSQLObject(dateArrive, "DATE_ARRIVE");
455
                this.addSQLObject(dateSortie, "DATE_SORTIE");
468
                this.addSQLObject(dateSortie, "DATE_SORTIE");
456
                this.addRequiredSQLObject(this.dureeHebdo, "DUREE_HEBDO");
469
                this.addRequiredSQLObject(this.dureeHebdo, "DUREE_HEBDO");
457
                this.addRequiredSQLObject(this.dureeMois, "DUREE_MOIS");
470
                this.addRequiredSQLObject(this.dureeMois, "DUREE_MOIS");
458
                this.addRequiredSQLObject(tauxAT, "TAUX_AT");
471
                this.addRequiredSQLObject(tauxAT, "TAUX_AT");
459
                this.addRequiredSQLObject(conges, "CONGES_PAYES");
472
                this.addRequiredSQLObject(conges, "CONGES_PAYES");
460
                this.addRequiredSQLObject(salaireBase, "SALAIRE_MOIS");
473
                this.addRequiredSQLObject(salaireBase, "SALAIRE_MOIS");
461
                // this.addRequiredSQLObject(textAnc, "ANCIENNETE");
474
                // this.addRequiredSQLObject(textAnc, "ANCIENNETE");
462
 
475
 
463
                // Listener
476
                // Listener
464
                this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
477
                this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
465
                this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
478
                this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
466
            }
479
            }
467
 
480
 
468
            private void updateHebdo() {
481
            private void updateHebdo() {
469
 
482
 
470
                if (this.dureeMois.getText().trim().length() == 0) {
483
                if (this.dureeMois.getText().trim().length() == 0) {
471
                    return;
484
                    return;
472
                } else {
485
                } else {
473
 
486
 
474
                    this.dureeHebdo.getDocument().removeDocumentListener(this.listenerHebdo);
487
                    this.dureeHebdo.getDocument().removeDocumentListener(this.listenerHebdo);
475
 
488
 
476
                    this.dureeHebdo.setText(String.valueOf(new PrixHT(Float.parseFloat(this.dureeMois.getText()) / (52.0 / 12.0)).getValue()));
489
                    this.dureeHebdo.setText(String.valueOf(new PrixHT(Float.parseFloat(this.dureeMois.getText()) / (52.0 / 12.0)).getValue()));
477
 
490
 
478
                    this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
491
                    this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
479
                }
492
                }
480
            }
493
            }
481
 
494
 
482
            private void updateMois() {
495
            private void updateMois() {
483
 
496
 
484
                if (this.dureeHebdo.getText().trim().length() == 0) {
497
                if (this.dureeHebdo.getText().trim().length() == 0) {
485
                    return;
498
                    return;
486
                } else {
499
                } else {
487
 
500
 
488
                    this.dureeMois.getDocument().removeDocumentListener(this.listenerMois);
501
                    this.dureeMois.getDocument().removeDocumentListener(this.listenerMois);
489
 
502
 
490
                    this.dureeMois.setText(String.valueOf(new PrixHT(Float.parseFloat(this.dureeHebdo.getText()) * (52.0 / 12.0)).getValue()));
503
                    this.dureeMois.setText(String.valueOf(new PrixHT(Float.parseFloat(this.dureeHebdo.getText()) * (52.0 / 12.0)).getValue()));
491
 
504
 
492
                    this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
505
                    this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
493
                }
506
                }
494
            }
507
            }
495
 
508
 
496
            @Override
509
            @Override
497
            public void select(SQLRowAccessor r) {
510
            public void select(SQLRowAccessor r) {
498
                this.dureeMois.getDocument().removeDocumentListener(this.listenerMois);
511
                this.dureeMois.getDocument().removeDocumentListener(this.listenerMois);
499
                this.dureeHebdo.getDocument().removeDocumentListener(this.listenerHebdo);
512
                this.dureeHebdo.getDocument().removeDocumentListener(this.listenerHebdo);
500
 
513
 
501
                super.select(r);
514
                super.select(r);
502
 
515
 
503
                if (r != null) {
516
                if (r != null) {
504
                    tablePeni.insertFrom("ID_INFOS_SALARIE_PAYE", r.getID());
517
                    tablePeni.insertFrom("ID_INFOS_SALARIE_PAYE", r.getID());
505
                }
518
                }
506
 
519
 
507
                this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
520
                this.dureeMois.getDocument().addDocumentListener(this.listenerMois);
508
                this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
521
                this.dureeHebdo.getDocument().addDocumentListener(this.listenerHebdo);
509
            }
522
            }
510
        };
523
        };
511
    }
524
    }
512
 
525
 
513
    @Override
526
    @Override
514
    protected String createCode() {
527
    protected String createCode() {
515
        return createCodeOfPackage() + ".info";
528
        return createCodeOfPackage() + ".info";
516
    }
529
    }
517
}
530
}