18 |
ilm |
1 |
/*
|
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
|
|
3 |
*
|
|
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
|
|
5 |
*
|
|
|
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
|
|
|
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.
|
|
|
10 |
*
|
|
|
11 |
* When distributing the software, include this License Header Notice in each file.
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
package org.openconcerto.erp.core.humanresources.payroll.element;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
|
|
17 |
import org.openconcerto.sql.element.BaseSQLComponent;
|
|
|
18 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
19 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
|
|
20 |
|
|
|
21 |
import java.awt.GridBagConstraints;
|
|
|
22 |
import java.awt.GridBagLayout;
|
|
|
23 |
import java.util.ArrayList;
|
|
|
24 |
import java.util.List;
|
|
|
25 |
|
|
|
26 |
import javax.swing.JLabel;
|
|
|
27 |
import javax.swing.JTextField;
|
|
|
28 |
|
|
|
29 |
public class CumulsCongesSQLElement extends ComptaSQLConfElement {
|
|
|
30 |
public CumulsCongesSQLElement() {
|
|
|
31 |
super("CUMULS_CONGES", "un cumul de congés", "cumuls de congés");
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
public List<String> getListFields() {
|
|
|
35 |
final List<String> l = new ArrayList<String>();
|
|
|
36 |
l.add("RESTANT");
|
|
|
37 |
l.add("ACQUIS");
|
|
|
38 |
return l;
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
protected List<String> getComboFields() {
|
|
|
42 |
final List<String> l = new ArrayList<String>();
|
|
|
43 |
l.add("RESTANT");
|
|
|
44 |
l.add("ACQUIS");
|
|
|
45 |
return l;
|
|
|
46 |
}
|
|
|
47 |
|
132 |
ilm |
48 |
@Override
|
|
|
49 |
public boolean isPrivate() {
|
|
|
50 |
return true;
|
|
|
51 |
}
|
|
|
52 |
|
18 |
ilm |
53 |
/*
|
|
|
54 |
* (non-Javadoc)
|
|
|
55 |
*
|
|
|
56 |
* @see org.openconcerto.devis.SQLElement#getComponent()
|
|
|
57 |
*/
|
|
|
58 |
public SQLComponent createComponent() {
|
|
|
59 |
return new BaseSQLComponent(this) {
|
|
|
60 |
public void addViews() {
|
|
|
61 |
|
|
|
62 |
this.setLayout(new GridBagLayout());
|
|
|
63 |
|
|
|
64 |
GridBagConstraints cPanel = new DefaultGridBagConstraints();
|
|
|
65 |
|
|
|
66 |
// Conges restant du 1 juin N-1 au 31 mai N
|
|
|
67 |
JLabel labelRestant = new JLabel(getLabelFor("RESTANT"));
|
|
|
68 |
this.add(labelRestant, cPanel);
|
|
|
69 |
JTextField textRestant = new JTextField(4);
|
|
|
70 |
cPanel.gridx++;
|
|
|
71 |
cPanel.weightx = 1;
|
|
|
72 |
this.add(textRestant, cPanel);
|
|
|
73 |
cPanel.weightx = 0;
|
|
|
74 |
|
|
|
75 |
// Conges acquis du 1 juin N au 31 mai N+1
|
|
|
76 |
cPanel.gridx = 0;
|
|
|
77 |
cPanel.gridy++;
|
|
|
78 |
JLabel labelAcquis = new JLabel(getLabelFor("ACQUIS"));
|
|
|
79 |
this.add(labelAcquis, cPanel);
|
|
|
80 |
|
|
|
81 |
JTextField textAcquis = new JTextField(4);
|
|
|
82 |
cPanel.gridx++;
|
|
|
83 |
cPanel.weighty = 1;
|
|
|
84 |
cPanel.weightx = 1;
|
|
|
85 |
this.add(textAcquis, cPanel);
|
|
|
86 |
|
|
|
87 |
this.addSQLObject(textAcquis, "ACQUIS");
|
|
|
88 |
this.addSQLObject(textRestant, "RESTANT");
|
|
|
89 |
}
|
|
|
90 |
};
|
|
|
91 |
}
|
57 |
ilm |
92 |
|
|
|
93 |
@Override
|
|
|
94 |
protected String createCode() {
|
156 |
ilm |
95 |
return createCodeOfPackage() + ".vacation.total";
|
57 |
ilm |
96 |
}
|
18 |
ilm |
97 |
}
|