132 |
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.config;
|
|
|
15 |
|
156 |
ilm |
16 |
import org.openconcerto.sql.model.SQLRow;
|
132 |
ilm |
17 |
import org.openconcerto.sql.model.SQLRowValues;
|
156 |
ilm |
18 |
import org.openconcerto.sql.model.SQLSelect;
|
132 |
ilm |
19 |
import org.openconcerto.sql.model.SQLTable;
|
156 |
ilm |
20 |
import org.openconcerto.utils.Tuple2;
|
132 |
ilm |
21 |
import org.openconcerto.utils.Tuple3;
|
|
|
22 |
|
|
|
23 |
import java.sql.SQLException;
|
|
|
24 |
import java.util.ArrayList;
|
|
|
25 |
import java.util.List;
|
|
|
26 |
|
|
|
27 |
public class DsnBrutCode {
|
|
|
28 |
|
|
|
29 |
final List<Tuple3<String, String, String>> l;
|
|
|
30 |
|
|
|
31 |
public enum DsnTypeCodeBrut {
|
|
|
32 |
REMUNERATION("Rémunération"), AUTRE("Autre"), PRIME("Prime");
|
|
|
33 |
|
|
|
34 |
private final String name;
|
|
|
35 |
|
|
|
36 |
DsnTypeCodeBrut(String name) {
|
|
|
37 |
this.name = name;
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
public String getName() {
|
|
|
41 |
return name;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
public DsnBrutCode() {
|
|
|
47 |
l = new ArrayList<Tuple3<String, String, String>>();
|
|
|
48 |
// l.add(Tuple3.create("001", "Rémunération brute non plafonnée",
|
|
|
49 |
// DsnTypeCodeBrut.REMUNERATION.getName()));
|
|
|
50 |
l.add(Tuple3.create("010", "Salaire de base", DsnTypeCodeBrut.REMUNERATION.getName()));
|
|
|
51 |
l.add(Tuple3.create("011", "Heures supplémentaires ou complémentaires", DsnTypeCodeBrut.REMUNERATION.getName()));
|
|
|
52 |
l.add(Tuple3.create("012", "Heures d’équivalence", DsnTypeCodeBrut.REMUNERATION.getName()));
|
|
|
53 |
l.add(Tuple3.create("013", "Heures d’habillage, déshabillage, pause", DsnTypeCodeBrut.REMUNERATION.getName()));
|
|
|
54 |
|
|
|
55 |
l.add(Tuple3.create("001", "Indemnité spécifique de rupture conventionnelle", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
56 |
l.add(Tuple3.create("002", "Indemnité versée à l'occasion de la cessation forcée des fonctions des mandataires sociaux", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
57 |
l.add(Tuple3.create("003", "Indemnité légale de mise à la retraite par l'employeur", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
58 |
l.add(Tuple3.create("004", "Indemnité conventionnelle de mise à la retraite par l'employeur", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
59 |
l.add(Tuple3.create("005", "Indemnité légale de départ à la retraite du salarié", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
60 |
l.add(Tuple3.create("006", "Indemnité conventionnelle de départ à la retraite du salarié", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
61 |
l.add(Tuple3.create("007", "Indemnité légale de licenciement", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
62 |
l.add(Tuple3.create("008", "Indemnité légale supplémentaire de licenciement", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
63 |
l.add(Tuple3.create("009", "Indemnité légale spéciale de licenciement", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
64 |
l.add(Tuple3.create("010", "Indemnité légale spécifique de licenciement", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
65 |
l.add(Tuple3.create("011", "Indemnité légale de fin de CDD", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
66 |
l.add(Tuple3.create("012", "Indemnité légale de fin de mission", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
67 |
l.add(Tuple3.create("013", "Indemnité légale due aux journalistes", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
68 |
l.add(Tuple3.create("014", "Indemnité légale de clientèle", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
69 |
l.add(Tuple3.create("015", "Indemnité légale due au personnel naviguant de l'aviation civile", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
70 |
l.add(Tuple3.create("016", "Indemnité légale versée à l'apprenti", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
71 |
l.add(Tuple3.create("017", "Dommages et intérêts dus à un CDD", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
72 |
l.add(Tuple3.create("018", "Indemnité due en raison d'un sinistre", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
73 |
l.add(Tuple3.create("019", "Indemnité suite à clause de non concurrence", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
74 |
l.add(Tuple3.create("020", "Indemnité compensatrice de congés payés", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
75 |
l.add(Tuple3.create("021", "Indemnité conventionnelle (supplémentaire aux indemnités légales)", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
76 |
l.add(Tuple3.create("022", "Indemnité transactionnelle (supplémentaire aux indemnités conventionnelles)", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
77 |
l.add(Tuple3.create("023", "Indemnité compensatrice de préavis payé non effectué", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
78 |
l.add(Tuple3.create("025", "Indemnité compensatrice des droits acquis dans le cadre d’un compte épargne temps", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
79 |
l.add(Tuple3.create("026", "Prime exceptionnelle liée à l'activité avec période de rattachement spécifique", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
80 |
|
|
|
81 |
l.add(Tuple3.create("027", "Prime liée à l'activité avec période de rattachement spécifique", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
82 |
l.add(Tuple3.create("028", "Prime non liée à l'activité", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
83 |
l.add(Tuple3.create("029", "Prime liée au rachat des jours de RTT avec période de rattachement spécifique", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
84 |
l.add(Tuple3.create("030", "Prime rachat CET", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
85 |
l.add(Tuple3.create("031", "Prime de partage de profits avec période de rattachement spécifique", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
86 |
l.add(Tuple3.create("032", "Indemnité compensatrice de fin de contrat pour inaptitude suite AT ou Maladie Professionnelle", DsnTypeCodeBrut.PRIME.getName()));
|
|
|
87 |
|
|
|
88 |
l.add(Tuple3.create("01", "Somme versée par un tiers", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
89 |
l.add(Tuple3.create("02", "Avantage en nature : repas", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
90 |
l.add(Tuple3.create("03", "Avantage en nature : logement", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
91 |
l.add(Tuple3.create("04", "Avantage en nature : véhicule", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
92 |
l.add(Tuple3.create("05", "Avantage en nature : NTIC", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
93 |
l.add(Tuple3.create("06", "Avantage en nature : autres", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
94 |
l.add(Tuple3.create("07", "Frais professionnels remboursés au forfait", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
95 |
l.add(Tuple3.create("08", "Frais professionnels pris en charge par l'employeur", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
96 |
l.add(Tuple3.create("09", "Frais professionnels remboursés au réel", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
97 |
l.add(Tuple3.create("10", "Déduction forfaitaire spécifique", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
98 |
l.add(Tuple3.create("11", "Participation y compris supplément", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
99 |
l.add(Tuple3.create("12", "Intéressement y compris supplément", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
100 |
l.add(Tuple3.create("14", "Abondement au plan d'épargne entreprise", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
101 |
l.add(Tuple3.create("15", "Abondement au plan d'épargne interentreprises", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
102 |
l.add(Tuple3.create("16", "Abondement au plan d'épargne pour la retraite collectif", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
103 |
l.add(Tuple3.create("17", "Participation patronale au financement des titres-restaurant", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
104 |
l.add(Tuple3.create("18", "Participation patronale aux frais de transports publics", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
105 |
l.add(Tuple3.create("19", "Participation patronale aux frais de transports personnels", DsnTypeCodeBrut.AUTRE.getName()));
|
|
|
106 |
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
public List<Tuple3<String, String, String>> getCodes() {
|
|
|
110 |
return l;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
public void insertCode(SQLTable table) throws SQLException {
|
|
|
114 |
|
|
|
115 |
for (Tuple3<String, String, String> tuple3 : l) {
|
|
|
116 |
SQLRowValues rowVals = new SQLRowValues(table);
|
|
|
117 |
rowVals.put("CODE", tuple3.get0());
|
|
|
118 |
rowVals.put("NOM", tuple3.get1());
|
|
|
119 |
rowVals.put("TYPE", tuple3.get2());
|
|
|
120 |
rowVals.insert();
|
|
|
121 |
}
|
|
|
122 |
}
|
|
|
123 |
|
156 |
ilm |
124 |
public void updateTable(List<Tuple3<String, String, String>> values, SQLTable table) throws SQLException {
|
|
|
125 |
SQLSelect sel = new SQLSelect();
|
|
|
126 |
sel.addSelect(table.getField("CODE"));
|
|
|
127 |
sel.addSelect(table.getField("TYPE"));
|
|
|
128 |
List<SQLRow> existingRows = new ArrayList<>();
|
|
|
129 |
List<Tuple2<String, String>> existingCode = new ArrayList<>();
|
|
|
130 |
for (SQLRow sqlRow : existingRows) {
|
|
|
131 |
existingCode.add(Tuple2.create(sqlRow.getString("CODE"), sqlRow.getString("TYPE")));
|
|
|
132 |
}
|
|
|
133 |
for (Tuple3<String, String, String> tuple3 : values) {
|
|
|
134 |
if (!existingCode.contains(Tuple2.create(tuple3.get0(), tuple3.get2()))) {
|
|
|
135 |
SQLRowValues rowVals = new SQLRowValues(table);
|
|
|
136 |
rowVals.put("CODE", tuple3.get0());
|
|
|
137 |
rowVals.put("NOM", tuple3.get1());
|
|
|
138 |
rowVals.put("TYPE", tuple3.get2());
|
|
|
139 |
rowVals.insert();
|
|
|
140 |
}
|
|
|
141 |
}
|
|
|
142 |
}
|
132 |
ilm |
143 |
}
|