OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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