OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 144 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.report;
14
 package org.openconcerto.erp.core.humanresources.payroll.report;
15
 
15
 
16
import org.openconcerto.utils.i18n.TranslationManager;
16
import org.openconcerto.utils.i18n.TranslationManager;
17
 
17
 
18
import java.util.HashMap;
18
import java.util.HashMap;
19
import java.util.Map;
19
import java.util.Map;
20
 
20
 
21
public enum LignePayeSimplifiee {
21
public enum LignePayeSimplifiee {
22
 
22
 
23
    SANTE_SECURITE("sante.securite"), SANTE_COMPLEMENAIRE_DECES("sante.complementaire.deces"), SANTE_COMPLEMENAIRE_SANTE("sante.complementaire.sante"), ACCIDENTS_TRAVAIL(
23
    SANTE_SECURITE("sante.securite"), SANTE_COMPLEMENAIRE_DECES("sante.complementaire.deces"), SANTE_COMPLEMENAIRE_SANTE("sante.complementaire.sante"), ACCIDENTS_TRAVAIL(
24
            "accident.accident"), RETRAITE_SECURITE_PLAF("retraite.securite.plaf"), RETRAITE_SECURITE_NON_PLAF("retraite.securite.non.plaf"), RETRAITE_COMPLEMENTAIRE_T1(
24
            "accident.accident"), RETRAITE_SECURITE_PLAF("retraite.securite.plaf"), RETRAITE_SECURITE_NON_PLAF("retraite.securite.non.plaf"), RETRAITE_COMPLEMENTAIRE_T1(
25
                    "retraite.tranche1"), RETRAITE_COMPLEMENTAIRE_T2("retraite.tranche2"), RETRAITE_COMPLEMENTAIRE_TA("retraite.trancheA"), RETRAITE_COMPLEMENTAIRE_GMP(
25
                    "retraite.tranche1"), RETRAITE_COMPLEMENTAIRE_T2("retraite.tranche2"), RETRAITE_COMPLEMENTAIRE_TA_2019_REMOVE("retraite.trancheA"), RETRAITE_COMPLEMENTAIRE_GMP_2019_REMOVE(
26
                            "retraite.GMP"), RETRAITE_COMPLEMENTAIRE_TB("retraite.trancheB"), RETRAITE_COMPLEMENTAIRE_TC("retraite.trancheC"), RETRAITE_SUPPLEMENTAIRE(
26
                            "retraite.GMP"), RETRAITE_COMPLEMENTAIRE_TB_2019_REMOVE("retraite.trancheB"), RETRAITE_COMPLEMENTAIRE_TC_2019_REMOVE("retraite.trancheC"), RETRAITE_SUPPLEMENTAIRE(
27
                                    "retraite.supplementaire"), FAMILLE_ALLOCATIONS("famille.famille.allocations"), ASSURANCE_CHOMAGE_CHOMAGE("chomage.chomage"), ASSURANCE_CHOMAGE_APEC(
27
                                    "retraite.supplementaire"), FAMILLE_ALLOCATIONS("famille.famille.allocations"), ASSURANCE_CHOMAGE_CHOMAGE("chomage.chomage"), ASSURANCE_CHOMAGE_APEC(
28
                                            "chomage.apec"), COTISATIONS_STATUAIRES("cotisations.statuaires.ligne"), AUTRES_CONTRIBUTIONS("autres.contributions.ligne"), CSG_NON_IMP(
28
                                            "chomage.apec"), COTISATIONS_STATUAIRES("cotisations.statuaires.ligne"), AUTRES_CONTRIBUTIONS("autres.contributions.ligne"), CSG_NON_IMP(
29
                                                    "csg.nonimp.ligne"), CSG_IMP("csg.imp.ligne"), ALLEGEMENT_COTISATIONS("allegement.cotisations.ligne"), IGNORE("paye.simplifie.ignore");
29
                                                    "csg.nonimp.ligne"), CSG_IMP("csg.imp.ligne"), ALLEGEMENT_COTISATIONS("allegement.cotisations.ligne"), IGNORE("paye.simplifie.ignore");
30
 
30
 
31
    private final String id;
31
    private final String id;
32
 
32
 
33
    private LignePayeSimplifiee(String id) {
33
    private LignePayeSimplifiee(String id) {
34
        this.id = id;
34
        this.id = id;
35
    }
35
    }
36
 
36
 
37
    public String getId() {
37
    public String getId() {
38
        return id;
38
        return id;
39
    }
39
    }
40
 
40
 
41
    public String getTranslation() {
41
    public String getTranslation() {
42
        final String translationForItem = TranslationManager.getInstance().getTranslationForItem(getId());
42
        final String translationForItem = TranslationManager.getInstance().getTranslationForItem(getId());
43
 
43
 
44
        return (translationForItem == null || translationForItem.trim().length() == 0) ? getId() : translationForItem;
44
        return (translationForItem == null || translationForItem.trim().length() == 0) ? getId() : translationForItem;
45
    }
45
    }
46
 
46
 
47
    private static final Map<String, LignePayeSimplifiee> idToEnum = new HashMap<String, LignePayeSimplifiee>();
47
    private static final Map<String, LignePayeSimplifiee> idToEnum = new HashMap<String, LignePayeSimplifiee>();
48
    static {
48
    static {
49
        for (LignePayeSimplifiee e : values())
49
        for (LignePayeSimplifiee e : values())
50
            idToEnum.put(e.getId(), e);
50
            idToEnum.put(e.getId(), e);
51
    }
51
    }
52
 
52
 
53
    public static LignePayeSimplifiee fromID(String id) {
53
    public static LignePayeSimplifiee fromID(String id) {
54
        return idToEnum.get(id);
54
        return idToEnum.get(id);
55
    }
55
    }
56
 
56
 
57
    @Override
57
    @Override
58
    public String toString() {
58
    public String toString() {
59
        return getTranslation();
59
        return getTranslation();
60
    }
60
    }
61
 
61
 
62
}
62
}