OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 151
Line 70... Line 70...
70
    // Configuration.getInstance().getBase().getTable("PERIODE_VALIDITE");
70
    // Configuration.getInstance().getBase().getTable("PERIODE_VALIDITE");
71
 
71
 
72
    private SQLJavaEditor javaEdit = new SQLJavaEditor(VariablePayeSQLElement.getMapTree());
72
    private SQLJavaEditor javaEdit = new SQLJavaEditor(VariablePayeSQLElement.getMapTree());
73
 
73
 
74
    // liste des variable de paye à calculer
74
    // liste des variable de paye à calculer
75
    private BigDecimal salBrut, salBrutBase, salBrutCotis, salBrutTaxable, cotPat, cotSal, taxCmPat, taxCmSal, netImp, netAPayer, csg, csgSansAbattement, cice, allegmentCotisation, avantage;
75
    private BigDecimal salBrut, salBrutBase, salBrutCotis, salBrutTaxable, cotPat, cotSal, taxCmPat, taxCmSal, netImp, netAPayer, csg, csgSansAbattement, cice, allegmentCotisation, avantage,
-
 
76
            reduction;
76
 
77
 
77
    private Map<Integer, String> mapField;
78
    private Map<Integer, String> mapField;
78
 
79
 
79
    private final BigDecimal tauxCSG;
80
    private final BigDecimal tauxCSG;
80
 
81
 
81
    private boolean isValidated = false;
82
    private boolean isValidated = false;
82
    private int mois;
83
    private int mois;
83
 
84
 
84
    public FichePayeModel(int idFiche) {
85
    public FichePayeModel(int idFiche) {
85
 
-
 
86
        System.err.println("NEW FICHE PAYE MODEL");
86
        System.err.println("NEW FICHE PAYE MODEL");
87
        this.javaEdit.setModel(this);
87
        this.javaEdit.setModel(this);
88
        this.idFiche = idFiche;
88
        this.idFiche = idFiche;
89
        this.vectRubrique = new Vector<SQLRowValues>();
89
        this.vectRubrique = new Vector<SQLRowValues>();
90
        this.vectRowValsToDelete = new Vector<SQLRowValues>();
90
        this.vectRowValsToDelete = new Vector<SQLRowValues>();
Line 125... Line 125...
125
        this.mapField.put(new Integer(7), "IMPRESSION");
125
        this.mapField.put(new Integer(7), "IMPRESSION");
126
        this.mapField.put(new Integer(8), "IN_PERIODE");
126
        this.mapField.put(new Integer(8), "IN_PERIODE");
127
 
127
 
128
        SQLPreferences prefs = new SQLPreferences(tableFichePaye.getTable().getDBRoot());
128
        SQLPreferences prefs = new SQLPreferences(tableFichePaye.getTable().getDBRoot());
129
        this.tauxCSG = new BigDecimal(prefs.getDouble(PayeGlobalPreferencePanel.ASSIETTE_CSG, 0.9825D));
129
        this.tauxCSG = new BigDecimal(prefs.getDouble(PayeGlobalPreferencePanel.ASSIETTE_CSG, 0.9825D));
-
 
130
        final SQLTable tableValidite = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete().getTable("PERIODE_VALIDITE");
-
 
131
        SQLBackgroundTableCache.getInstance().getCacheForTable(tableValidite).reloadFromDbIfNeeded();
130
 
132
 
131
        // loadElement();
133
        // loadElement();
132
        // methodeTmp();
134
        // methodeTmp();
133
    }
135
    }
134
 
136
 
Line 191... Line 193...
191
         * }
193
         * }
192
         * 
194
         * 
193
         */
195
         */
194
        this.cice = null;
196
        this.cice = null;
195
        this.allegmentCotisation = BigDecimal.ZERO;
197
        this.allegmentCotisation = BigDecimal.ZERO;
-
 
198
        this.reduction = BigDecimal.ZERO;
196
        this.avantage = BigDecimal.ZERO;
199
        this.avantage = BigDecimal.ZERO;
197
        this.salBrut = BigDecimal.ZERO;
200
        this.salBrut = BigDecimal.ZERO;
198
        this.salBrutCotis = BigDecimal.ZERO;
201
        this.salBrutCotis = BigDecimal.ZERO;
199
        this.salBrutBase = BigDecimal.ZERO;
202
        this.salBrutBase = BigDecimal.ZERO;
200
        this.salBrutTaxable = BigDecimal.ZERO;
203
        this.salBrutTaxable = BigDecimal.ZERO;
Line 768... Line 771...
768
                    this.cice = BigDecimal.ZERO;
771
                    this.cice = BigDecimal.ZERO;
769
                }
772
                }
770
            }
773
            }
771
            rowValsFiche.put("CICE", this.cice);
774
            rowValsFiche.put("CICE", this.cice);
772
            rowValsFiche.put("ALLEGEMENT_COTISATION", this.allegmentCotisation);
775
            rowValsFiche.put("ALLEGEMENT_COTISATION", this.allegmentCotisation);
-
 
776
            rowValsFiche.put("REDUCTION_GVT", this.reduction);
773
            rowValsFiche.put("AVANTAGE_NATURE", this.avantage);
777
            rowValsFiche.put("AVANTAGE_NATURE", this.avantage);
774
            try {
778
            try {
775
                rowValsFiche.update(this.idFiche);
779
                rowValsFiche.update(this.idFiche);
776
                // rowValsFiche.getGraph().store(StoreMode.COMMIT, false);
780
                // rowValsFiche.getGraph().store(StoreMode.COMMIT, false);
777
            } catch (SQLException e) {
781
            } catch (SQLException e) {
Line 1132... Line 1136...
1132
        rowVals.put("NOM", rowSource.getBoolean("NOM_VISIBLE") ? rowSource.getString("NOM") : "");
1136
        rowVals.put("NOM", rowSource.getBoolean("NOM_VISIBLE") ? rowSource.getString("NOM") : "");
1133
        rowVals.put("NB_BASE", (baseOb == null) ? null : new BigDecimal(baseOb.toString()));
1137
        rowVals.put("NB_BASE", (baseOb == null) ? null : new BigDecimal(baseOb.toString()));
1134
        rowVals.put("TAUX_SAL", (tauxSalOb == null) ? null : new BigDecimal(tauxSalOb.toString()));
1138
        rowVals.put("TAUX_SAL", (tauxSalOb == null) ? null : new BigDecimal(tauxSalOb.toString()));
1135
        rowVals.put("TAUX_PAT", (tauxPatOb == null) ? null : new BigDecimal(tauxPatOb.toString()));
1139
        rowVals.put("TAUX_PAT", (tauxPatOb == null) ? null : new BigDecimal(tauxPatOb.toString()));
1136
        rowVals.put("MONTANT_PAT", (montantPatOb == null) ? null : new BigDecimal(montantPatOb.toString()));
1140
        rowVals.put("MONTANT_PAT", (montantPatOb == null) ? null : new BigDecimal(montantPatOb.toString()));
1137
        rowVals.put("MONTANT_SAL_AJ", (montantAdOb == null) ? null : new BigDecimal(montantAdOb.toString()));
1141
        final BigDecimal montantAj = (montantAdOb == null) ? null : new BigDecimal(montantAdOb.toString());
-
 
1142
        rowVals.put("MONTANT_SAL_AJ", montantAj);
1138
        rowVals.put("MONTANT_SAL_DED", (montantDedOb == null) ? null : new BigDecimal(montantDedOb.toString()));
1143
        final BigDecimal montantDed = (montantDedOb == null) ? null : new BigDecimal(montantDedOb.toString());
-
 
1144
        rowVals.put("MONTANT_SAL_DED", montantDed);
1139
 
1145
 
1140
        boolean b = isEltImprimable(rowSource, rowVals);
1146
        boolean b = isEltImprimable(rowSource, rowVals);
1141
        // System.err.println("Impression --- > " + b);
1147
        // System.err.println("Impression --- > " + b);
1142
        rowVals.put("IMPRESSION", Boolean.valueOf(b));
1148
        rowVals.put("IMPRESSION", Boolean.valueOf(b));
1143
 
1149
 
-
 
1150
        if (rowSource.getBoolean("REDUCTION_GVT_COM")) {
-
 
1151
            if (montantAj != null) {
-
 
1152
                this.reduction = this.reduction.subtract(montantAj);
-
 
1153
            }
-
 
1154
            if (montantDed != null) {
-
 
1155
                this.reduction = this.reduction.add(montantDed);
-
 
1156
            }
-
 
1157
        }
-
 
1158
 
1144
        this.vectRubrique.add(rowVals);
1159
        this.vectRubrique.add(rowVals);
1145
    }
1160
    }
1146
 
1161
 
1147
    private void calculValue() {
1162
    private void calculValue() {
1148
 
1163