OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 185
Line 1... Line 1...
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-2019 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.
Line 55... Line 55...
55
    // Journal OD
55
    // Journal OD
56
    private static final Integer journalOD = Integer.valueOf(JournalSQLElement.OD);
56
    private static final Integer journalOD = Integer.valueOf(JournalSQLElement.OD);
57
 
57
 
58
    private Map<String, SQLTable> mapTableSource = new HashMap<String, SQLTable>();
58
    private Map<String, SQLTable> mapTableSource = new HashMap<String, SQLTable>();
59
 
59
 
60
    public GenerationMvtFichePaye(int[] idFichePaye, String mois, String annee) throws SQLException {
60
    public GenerationMvtFichePaye(int[] idFichePaye, String mois, String annee, Date d) throws SQLException {
61
 
61
 
62
        setRowAnalytiqueSource(null);
62
        setRowAnalytiqueSource(null);
63
        SQLTable tableNet = Configuration.getInstance().getBase().getTable("RUBRIQUE_NET");
63
        SQLTable tableNet = Configuration.getInstance().getBase().getTable("RUBRIQUE_NET");
64
 
64
 
65
        SQLTable tableBrut = Configuration.getInstance().getBase().getTable("RUBRIQUE_BRUT");
65
        SQLTable tableBrut = Configuration.getInstance().getBase().getTable("RUBRIQUE_BRUT");
Line 71... Line 71...
71
        this.mapTableSource.put(tableComm.getName(), tableComm);
71
        this.mapTableSource.put(tableComm.getName(), tableComm);
72
 
72
 
73
        this.idFichePaye = idFichePaye;
73
        this.idFichePaye = idFichePaye;
74
        this.annee = annee;
74
        this.annee = annee;
75
        this.mois = mois;
75
        this.mois = mois;
-
 
76
        this.date = d;
76
        this.idMvt = getNewMouvement("", 1, 1, "Paye " + this.mois + " " + this.annee);
77
        this.idMvt = getNewMouvement("", 1, 1, "Paye " + this.mois + " " + this.annee);
77
        new Thread(GenerationMvtFichePaye.this).start();
78
        new Thread(GenerationMvtFichePaye.this).start();
78
    }
79
    }
79
 
80
 
80
    private void genereComptaFichePaye() throws Exception {
81
    private void genereComptaFichePaye() throws Exception {
Line 96... Line 97...
96
        }
97
        }
97
 
98
 
98
        // SQLRow rowFiche =
99
        // SQLRow rowFiche =
99
        // Configuration.getInstance().getBase().getTable("FICHE_PAYE").getRow(this.idFichePaye);
100
        // Configuration.getInstance().getBase().getTable("FICHE_PAYE").getRow(this.idFichePaye);
100
        // iniatilisation des valeurs de la map
101
        // iniatilisation des valeurs de la map
101
        this.date = new Date();
102
        // this.date = new Date();
102
 
103
 
103
        // SQLRow rowMois = tableMois.getRow(rowFiche.getInt("ID_MOIS"));
104
        // SQLRow rowMois = tableMois.getRow(rowFiche.getInt("ID_MOIS"));
104
        // SQLRow rowSal = tableSalarie.getRow(rowFiche.getInt("ID_SALARIE"));
105
        // SQLRow rowSal = tableSalarie.getRow(rowFiche.getInt("ID_SALARIE"));
105
        this.nom = "Paye " + this.mois + " " + this.annee;
106
        this.nom = "Paye " + this.mois + " " + this.annee;
106
        this.putValue("DATE", new java.sql.Date(this.date.getTime()));
107
        this.putValue("DATE", new java.sql.Date(this.date.getTime()));
Line 346... Line 347...
346
 
347
 
347
                int idCaisse = rowSource.getInt("ID_CAISSE_COTISATION");
348
                int idCaisse = rowSource.getInt("ID_CAISSE_COTISATION");
348
 
349
 
349
                Tuple2<Integer, Integer> t = mapCaisse.get(idCaisse);
350
                Tuple2<Integer, Integer> t = mapCaisse.get(idCaisse);
350
                // on recupere les comptes tiers et charge de la caisse associée
351
                // on recupere les comptes tiers et charge de la caisse associée
-
 
352
                int idCompteCharge;
-
 
353
                if (rowSource.getString("NUMERO_COMPTE_PCE_CHARGES") != null && rowSource.getString("NUMERO_COMPTE_PCE_CHARGES").trim().length() > 0) {
351
                int idCompteCharge = (t == null ? ComptePCESQLElement.getId("645") : t.get0());
354
                    idCompteCharge = ComptePCESQLElement.getId(rowSource.getString("NUMERO_COMPTE_PCE_CHARGES"));
352
                // }
355
                } else {
353
 
-
 
354
                // int idCompteTiers = rowCaisse.getInt("ID_COMPTE_PCE_TIERS");
356
                    idCompteCharge = (t == null ? ComptePCESQLElement.getId("645") : t.get0());
-
 
357
                }
355
                // if (idCompteTiers <= 1) {
358
                int idCompteTiers;
-
 
359
                if (rowSource.getString("NUMERO_COMPTE_PCE") != null && rowSource.getString("NUMERO_COMPTE_PCE").trim().length() > 0) {
356
                int idCompteTiers = (t == null ? ComptePCESQLElement.getId("437") : t.get1());
360
                    idCompteTiers = ComptePCESQLElement.getId(rowSource.getString("NUMERO_COMPTE_PCE"));
-
 
361
                } else {
357
                // int idCompteTiers = ComptePCESQLElement.getId("437");
362
                    idCompteTiers = (t == null ? ComptePCESQLElement.getId("437") : t.get1());
358
                // }
363
                }
359
 
364
 
360
                // Cotisations sal.
365
                // Cotisations sal.
361
                if (row.getObject("MONTANT_SAL_DED") != null && row.getFloat("MONTANT_SAL_DED") != 0) {
366
                if (row.getObject("MONTANT_SAL_DED") != null && row.getFloat("MONTANT_SAL_DED") != 0) {
362
 
367
 
363
                    Object montantCredObj = mapCompteCredSal.get(Integer.valueOf(idCompteTiers));
368
                    Object montantCredObj = mapCompteCredSal.get(Integer.valueOf(idCompteTiers));