OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 180 Rev 182
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 54... Line 54...
54
    }
54
    }
55
 
55
 
56
    private void insertValues(List<Tuple2<String, String>> values, SQLTable table) throws SQLException {
56
    private void insertValues(List<Tuple2<String, String>> values, SQLTable table) throws SQLException {
57
        SQLSelect sel = new SQLSelect();
57
        SQLSelect sel = new SQLSelect();
58
        sel.addSelect(table.getField("CODE"));
58
        sel.addSelect(table.getField("CODE"));
59
        List<String> codes = (List<String>) table.getDBSystemRoot().getDataSource().executeA(sel.asString());
59
        List<String> codes = (List<String>) table.getDBSystemRoot().getDataSource().executeCol(sel.asString());
60
        for (Tuple2<String, String> tuple2 : values) {
60
        for (Tuple2<String, String> tuple2 : values) {
61
            if (!codes.contains(tuple2.get0())) {
61
            if (!codes.contains(tuple2.get0())) {
62
                SQLRowValues rowVals = new SQLRowValues(table);
62
                SQLRowValues rowVals = new SQLRowValues(table);
63
                rowVals.put("CODE", tuple2.get0());
63
                rowVals.put("CODE", tuple2.get0());
64
                rowVals.put("NOM", tuple2.get1());
64
                rowVals.put("NOM", tuple2.get1());
Line 84... Line 84...
84
            root.getBase().getDataSource().execute(t.asString());
84
            root.getBase().getDataSource().execute(t.asString());
85
            root.refetchTable("SOCIETE_COMMON");
85
            root.refetchTable("SOCIETE_COMMON");
86
            root.getSchema().updateVersion();
86
            root.getSchema().updateVersion();
87
        }
87
        }
88
 
88
 
-
 
89
        if (!societeCommonT.contains("ORG_PROTECTION_SOCIAL_ID")) {
-
 
90
            AlterTable t = new AlterTable(societeCommonT);
-
 
91
            t.addVarCharColumn("ORG_PROTECTION_SOCIAL_ID", 256);
-
 
92
            root.getBase().getDataSource().execute(t.asString());
-
 
93
            root.refetchTable("SOCIETE_COMMON");
-
 
94
            root.getSchema().updateVersion();
-
 
95
        }
-
 
96
 
89
        SQLTable tableRubCot = root.getTable("RUBRIQUE_COTISATION");
97
        SQLTable tableRubCot = root.getTable("RUBRIQUE_COTISATION");
90
        if (!tableRubCot.contains("ASSIETTE_PLAFONNEE")) {
98
        if (!tableRubCot.contains("ASSIETTE_PLAFONNEE")) {
91
            AlterTable tableRub = new AlterTable(tableRubCot);
99
            AlterTable tableRub = new AlterTable(tableRubCot);
92
            tableRub.addBooleanColumn("ASSIETTE_PLAFONNEE", false, false);
100
            tableRub.addBooleanColumn("ASSIETTE_PLAFONNEE", false, false);
93
            root.getBase().getDataSource().execute(tableRub.asString());
101
            root.getBase().getDataSource().execute(tableRub.asString());
Line 158... Line 166...
158
                insertValues(v, table);
166
                insertValues(v, table);
159
            } catch (SQLException ex) {
167
            } catch (SQLException ex) {
160
                throw new IllegalStateException("Erreur lors de la création de la table " + "MOTIF_ARRET_TRAVAIL", ex);
168
                throw new IllegalStateException("Erreur lors de la création de la table " + "MOTIF_ARRET_TRAVAIL", ex);
161
            }
169
            }
162
        }
170
        }
163
        
171
 
164
        if (!root.contains("DIPLOME_PREPARE")) {
172
        if (!root.contains("DIPLOME_PREPARE")) {
165
            final SQLCreateTable createTableDiplome = new SQLCreateTable(root, "DIPLOME_PREPARE");
173
            final SQLCreateTable createTableDiplome = new SQLCreateTable(root, "DIPLOME_PREPARE");
166
            createTableDiplome.addVarCharColumn("CODE", 25);
174
            createTableDiplome.addVarCharColumn("CODE", 25);
167
            createTableDiplome.addVarCharColumn("NOM", 512);
175
            createTableDiplome.addVarCharColumn("NOM", 512);
168
 
176
 
Line 185... Line 193...
185
            } catch (SQLException ex) {
193
            } catch (SQLException ex) {
186
                throw new IllegalStateException("Erreur lors de la création de la table " + "DIPLOME_PREPARE", ex);
194
                throw new IllegalStateException("Erreur lors de la création de la table " + "DIPLOME_PREPARE", ex);
187
            }
195
            }
188
        }
196
        }
189
 
197
 
190
 
-
 
191
        if (!root.contains("TYPE_PREAVIS")) {
198
        if (!root.contains("TYPE_PREAVIS")) {
192
            final SQLCreateTable createTableMotif = new SQLCreateTable(root, "TYPE_PREAVIS");
199
            final SQLCreateTable createTableMotif = new SQLCreateTable(root, "TYPE_PREAVIS");
193
            createTableMotif.addVarCharColumn("CODE", 25);
200
            createTableMotif.addVarCharColumn("CODE", 25);
194
            createTableMotif.addVarCharColumn("NOM", 512);
201
            createTableMotif.addVarCharColumn("NOM", 512);
195
 
202
 
Line 1035... Line 1042...
1035
                v.add(Tuple2.create("100", "Contribution pour le financement des organisations syndicales de salariés et organisations professionnelles d'employeurs"));
1042
                v.add(Tuple2.create("100", "Contribution pour le financement des organisations syndicales de salariés et organisations professionnelles d'employeurs"));
1036
                v.add(Tuple2.create("101", "Association Mutualisation du Coût Inaptitude"));
1043
                v.add(Tuple2.create("101", "Association Mutualisation du Coût Inaptitude"));
1037
                v.add(Tuple2.create("102", "Cotisation Allocation Familiale - taux réduit"));
1044
                v.add(Tuple2.create("102", "Cotisation Allocation Familiale - taux réduit"));
1038
                v.add(Tuple2.create("103", "Contribution actions gratuites"));
1045
                v.add(Tuple2.create("103", "Contribution actions gratuites"));
1039
                v.add(Tuple2.create("226", "Assiette du Versement Transport"));
1046
                v.add(Tuple2.create("226", "Assiette du Versement Transport"));
-
 
1047
 
1040
                v.add(Tuple2.create("901", "Cotisation épargne retraite"));
1048
                v.add(Tuple2.create("901", "Cotisation épargne retraite"));
1041
 
1049
 
1042
                insertValues(v, table);
1050
                insertValues(v, table);
1043
 
1051
 
1044
                List<Tuple2<String, String>> vCodeBase = new ArrayList<Tuple2<String, String>>();
1052
                List<Tuple2<String, String>> vCodeBase = new ArrayList<Tuple2<String, String>>();
Line 1348... Line 1356...
1348
        }
1356
        }
1349
 
1357
 
1350
        // P19V01.2
1358
        // P19V01.2
1351
        final SQLTable tableCotInd = root.getTable("CODE_COTISATION_INDIVIDUELLE");
1359
        final SQLTable tableCotInd = root.getTable("CODE_COTISATION_INDIVIDUELLE");
1352
        List<Tuple2<String, String>> vCodeIndiv = new ArrayList<>();
1360
        List<Tuple2<String, String>> vCodeIndiv = new ArrayList<>();
1353
        vCodeIndiv.add(Tuple2.create("104", "Pénibilité Cotisation de base"));
1361
        vCodeIndiv.add(Tuple2.create("104", " Pénibilité Cotisation de base"));
1354
        vCodeIndiv.add(Tuple2.create("105", "Montant de cotisation Régime Unifié Agirc-Arrco y compris Apec"));
1362
        vCodeIndiv.add(Tuple2.create("105", " Montant de cotisation Régime Unifié Agirc Arrco, y compris Apec"));
1355
        vCodeIndiv.add(Tuple2.create("106", "Réduction générale des cotisations patronales Agirc-Arrco"));
1363
        vCodeIndiv.add(Tuple2.create("106", " Réduction générale des cotisations patronales de retraite complémentaire"));
-
 
1364
        vCodeIndiv.add(Tuple2.create("107", " Forfait marin"));
-
 
1365
        vCodeIndiv.add(Tuple2.create("108", " Demi rôle marin"));
-
 
1366
        vCodeIndiv.add(Tuple2.create("109", " Exonération de cotisations salariales de retraite complémentaire au titre de l'emploi d'un apprenti"));
-
 
1367
        vCodeIndiv.add(Tuple2.create("110", " Exonération de cotisations patronales de retraite complémentaire applicable dans les DOM (LODEOM) SMIC 130% à 220%"));
-
 
1368
        vCodeIndiv.add(Tuple2.create("111", " Exonération de cotisations de retraite complémentaire applicable aux entreprises et associations d'aide à domicile"));
-
 
1369
        vCodeIndiv.add(Tuple2.create("112", " Exonération de cotisations patronales de retraite complémentaire applicable dans les DOM (LODEOM) SMIC 170% à 270%"));
-
 
1370
        vCodeIndiv.add(Tuple2.create("113", " Exonération de cotisations patronales de retraite complémentaire applicable dans les DOM (LODEOM) SMIC 170% à 350%"));
-
 
1371
        vCodeIndiv.add(Tuple2.create("114", " Montant de réduction des heures supplémentaires/complémentaires"));
-
 
1372
        vCodeIndiv.add(Tuple2.create("115", " Cotisation Assurance Maladie pour le Régime Local Alsace Moselle"));
-
 
1373
        vCodeIndiv.add(Tuple2.create("116", " Cotisation absente de la norme en cas de régularisation prud'homale"));
-
 
1374
        vCodeIndiv.add(Tuple2.create("128", " Contribution à la formation professionnelle (CFP)"));
-
 
1375
        vCodeIndiv.add(Tuple2.create("129", " Contribution dédiée au financement du Compte Professionnel de Formation pour les titulaires de CDD (CPFCDD)"));
-
 
1376
        vCodeIndiv.add(Tuple2.create("130", " Part principale de la taxe d'apprentissage"));
-
 
1377
        vCodeIndiv.add(Tuple2.create("131", " Cotisation régime unifié Agirc Arrco"));
-
 
1378
        vCodeIndiv.add(Tuple2.create("132", " Cotisation Apec"));
-
 
1379
        vCodeIndiv.add(Tuple2.create("133", " Contribution maladie spécifique Mayotte"));
-
 
1380
        vCodeIndiv.add(Tuple2.create("902", " Contribution à la formation professionnelle des Artisans assimilés salariés"));
-
 
1381
        vCodeIndiv.add(Tuple2.create("903", " Cotisation AFNCA"));
-
 
1382
        vCodeIndiv.add(Tuple2.create("904", " Cotisation ANEFA"));
-
 
1383
        vCodeIndiv.add(Tuple2.create("905", " Cotisation ASCPA"));
-
 
1384
        vCodeIndiv.add(Tuple2.create("906", " Cotisation PROVEA"));
-
 
1385
        vCodeIndiv.add(Tuple2.create("907", " Complément de cotisation Assurance Maladie"));
-
 
1386
        vCodeIndiv.add(Tuple2.create("908", " Taxe forfaitaire CDDU Assurance Chômage"));
-
 
1387
        vCodeIndiv.add(Tuple2.create("909", " Cotisation au titre du financement des régimes de retraites supplémentaires à prestation définies"));
-
 
1388
        vCodeIndiv.add(Tuple2.create("910", " Exonération de cotisations patronales pour les entreprises affectées par la crise sanitaire"));
-
 
1389
        vCodeIndiv.add(Tuple2.create("911", " Réduction de cotisations patronales pour les entreprises du secteur de la vigne affectées par la crise sanitaire"));
-
 
1390
        vCodeIndiv.add(Tuple2.create("912", " Exonération du forfait social à 10%"));
-
 
1391
        vCodeIndiv.add(Tuple2.create("913", " Potentielle nouvelle cotisation C"));
-
 
1392
        vCodeIndiv.add(Tuple2.create("914", " Potentielle nouvelle cotisation A"));
-
 
1393
        vCodeIndiv.add(Tuple2.create("915", " Potentielle nouvelle cotisation B"));
-
 
1394
 
1356
        insertValues(vCodeIndiv, tableCotInd);
1395
        insertValues(vCodeIndiv, tableCotInd);
1357
 
1396
 
1358
        final SQLTable tableCTP = root.getTable("CODE_CAISSE_TYPE_RUBRIQUE");
1397
        final SQLTable tableCTP = root.getTable("CODE_CAISSE_TYPE_RUBRIQUE");
1359
        List<Tuple2<String, String>> vCTP = new ArrayList<>();
1398
        List<Tuple2<String, String>> vCTP = new ArrayList<>();
1360
        vCTP.add(Tuple2.create("003", "Réduction cotisations salariale heures supplémentaires"));
1399
        vCTP.add(Tuple2.create("003", "Réduction cotisations salariale heures supplémentaires"));
1361
        vCTP.add(Tuple2.create("510", "Prime exceptionnelle de pouvoir d’achat"));
1400
        vCTP.add(Tuple2.create("510", "Prime exceptionnelle de pouvoir d’achat"));
1362
        vCTP.add(Tuple2.create("060", "RR Chômage CSG-CRDS taux plein"));
1401
        vCTP.add(Tuple2.create("060", "RR Chômage CSG-CRDS taux plein"));
-
 
1402
        vCTP.add(Tuple2.create("917", "MOBILITE ADD JOURNALISTE TX MINO 20%"));
-
 
1403
        vCTP.add(Tuple2.create("920", "EMPL AGRIC (1500 TONNES CANNE) RMI OM"));
-
 
1404
        vCTP.add(Tuple2.create("921", "MOBILITE ARTISTES TX MINORE 30%"));
-
 
1405
        vCTP.add(Tuple2.create("922", "ENTR.DE PRODUCTION D ELECTRICITE"));
-
 
1406
        vCTP.add(Tuple2.create("922", "ENTR.DE PRODUCTION D ELECTRICITE"));
-
 
1407
        vCTP.add(Tuple2.create("926", "AT SEULEMENT - GESTION TOTALE"));
-
 
1408
        vCTP.add(Tuple2.create("927", "MOBILITE ADD ARTISTES TX MINO 30%"));
-
 
1409
        vCTP.add(Tuple2.create("936", "CNIEG PRESTATION COMPL. INVALIDITE"));
-
 
1410
        vCTP.add(Tuple2.create("937", "COTISATIONS AGS CAS GENERAL U2"));
-
 
1411
        vCTP.add(Tuple2.create("938", "CONTRATS AIDES ATELIER INSERTION"));
-
 
1412
        vCTP.add(Tuple2.create("939", "ATELIER INSERTION MAYOTTE"));
-
 
1413
        vCTP.add(Tuple2.create("939", "ATELIER INSERTION MAYOTTE"));
-
 
1414
        vCTP.add(Tuple2.create("940", "CNIEG DROITS SPE. PASSES NON REGULES"));
-
 
1415
        vCTP.add(Tuple2.create("948", "CONTRAT EMPLOI SOLIDARITE"));
-
 
1416
        vCTP.add(Tuple2.create("950", "CONTRAT EMPLOI SOLIDARITE CAS PART"));
-
 
1417
        vCTP.add(Tuple2.create("951", "CONTRATS EMPLOI SOLIDARITE CAS PART"));
-
 
1418
        vCTP.add(Tuple2.create("952", "CONTRAT EMPLOI CONSOLIDE CAS GENERAL"));
-
 
1419
        vCTP.add(Tuple2.create("954", "CONTRAT EMPLOI CONSOLIDE CAS PART"));
-
 
1420
        vCTP.add(Tuple2.create("955", "CNIEG PETIT POOL"));
-
 
1421
        vCTP.add(Tuple2.create("959", "CFP ENTREPRISE < 11 SALARIES"));
-
 
1422
        vCTP.add(Tuple2.create("967", "CONTR.ROYALTIES ART.ET MANNEQUINS"));
-
 
1423
        vCTP.add(Tuple2.create("969", "COT.MAL.ROYALTIES ART.ETRANGER"));
-
 
1424
        vCTP.add(Tuple2.create("971", "CFP ENTREPRISE >= 11 SALARIES"));
-
 
1425
        vCTP.add(Tuple2.create("983", "CFP INTERMITTENTS DU SPECTACLE"));
-
 
1426
        vCTP.add(Tuple2.create("985", "PENALITE PENIBILITE"));
-
 
1427
        vCTP.add(Tuple2.create("987", "CONTRIBUTION CPF CDD "));
-
 
1428
        vCTP.add(Tuple2.create("992", "TA PRINCIPALE HORS ALSACE MOSELLE"));
-
 
1429
        vCTP.add(Tuple2.create("993", "TA ALSACE MOSELLE"));
-
 
1430
        vCTP.add(Tuple2.create("994", "TA DEDUCTION CFA ET OFFRE NOUVELLE"));
-
 
1431
        vCTP.add(Tuple2.create("995", "TA - SOLDE VERSEMENT LIBERATOIRE"));
-
 
1432
        vCTP.add(Tuple2.create("995", "TA - SOLDE VERSEMENT LIBERATOIRE"));
-
 
1433
        vCTP.add(Tuple2.create("996", "TA - DEDUCTION AU SOLDE CFA"));
-
 
1434
        vCTP.add(Tuple2.create("997", "TA - DEDUCTION SOLDE CREANCE ALTERN"));
-
 
1435
        vCTP.add(Tuple2.create("998", "CSA CONTRIBUTION ANNUELLE"));
1363
        insertValues(vCTP, tableCTP);
1436
        insertValues(vCTP, tableCTP);
1364
 
1437
 
1365
        final SQLTable tableTypeBrut = root.getTable("CODE_TYPE_RUBRIQUE_BRUT");
1438
        final SQLTable tableTypeBrut = root.getTable("CODE_TYPE_RUBRIQUE_BRUT");
1366
        List<Tuple3<String, String, String>> vbrutType = new ArrayList<>();
1439
        List<Tuple3<String, String, String>> vbrutType = new ArrayList<>();
1367
        vbrutType.add(Tuple3.create("016", "[FP] Heures affectées à un travail d’aide à domicile", DsnTypeCodeBrut.REMUNERATION.getName()));
1440
        vbrutType.add(Tuple3.create("016", "[FP] Heures affectées à un travail d’aide à domicile", DsnTypeCodeBrut.REMUNERATION.getName()));
1368
        vbrutType.add(Tuple3.create("017", "Heures supplémentaires ou complémentaires aléatoires", DsnTypeCodeBrut.REMUNERATION.getName()));
1441
        vbrutType.add(Tuple3.create("017", "Heures supplémentaires ou complémentaires aléatoires", DsnTypeCodeBrut.REMUNERATION.getName()));
1369
        vbrutType.add(Tuple3.create("018", "Heures supplémentaires structurelles", DsnTypeCodeBrut.REMUNERATION.getName()));
1442
        vbrutType.add(Tuple3.create("018", "Heures supplémentaires structurelles", DsnTypeCodeBrut.REMUNERATION.getName()));
1370
        vbrutType.add(Tuple3.create("019", "Heures d'activité partielle", DsnTypeCodeBrut.REMUNERATION.getName()));
1443
        vbrutType.add(Tuple3.create("019", "Heures d'activité partielle", DsnTypeCodeBrut.REMUNERATION.getName()));
1371
        vbrutType.add(Tuple3.create("020", "Heures affectées à un travail d’aide à domicile de publics fragiles", DsnTypeCodeBrut.REMUNERATION.getName()));
1444
        vbrutType.add(Tuple3.create("020", "Heures affectées à un travail d’aide à domicile de publics fragiles", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1445
 
-
 
1446
        vbrutType.add(Tuple3.create("021", "[FP] Taux de rémunération de la situation administrative", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1447
        vbrutType.add(Tuple3.create("022", "Potentiel nouveau type de rémunération B", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1448
        vbrutType.add(Tuple3.create("023", "Potentiel nouveau type de rémunération C", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1449
        vbrutType.add(Tuple3.create("025", "Heures correspondant à du chômage intempéries", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1450
        vbrutType.add(Tuple3.create("026", "Heures supplémentaires exonérées", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1451
        vbrutType.add(Tuple3.create("027", "Potentiel nouveau type de rémunération A", DsnTypeCodeBrut.REMUNERATION.getName()));
-
 
1452
 
1372
        DsnBrutCode dsnBurCode = new DsnBrutCode();
1453
        DsnBrutCode dsnBurCode = new DsnBrutCode();
1373
        dsnBurCode.updateTable(vbrutType, tableTypeBrut);
1454
        dsnBurCode.updateTable(vbrutType, tableTypeBrut);
1374
 
1455
 
-
 
1456
        // P21
-
 
1457
        final SQLTable tableArret = root.getTable("MOTIF_ARRET_TRAVAIL");
-
 
1458
        List<Tuple2<String, String>> vArret = new ArrayList<Tuple2<String, String>>();
-
 
1459
        vArret.add(Tuple2.create("09", "adoption"));
-
 
1460
        vArret.add(Tuple2.create("15", "temps partiel thérapeutique (risque maladie)"));
-
 
1461
        vArret.add(Tuple2.create("16", "temps partiel thérapeutique (risque accident de travail)"));
-
 
1462
        vArret.add(Tuple2.create("17", "temps partiel thérapeutique (risque accident de trajet)"));
-
 
1463
        vArret.add(Tuple2.create("18", "temps partiel thérapeutique (risque maladie professionnelle)"));
-
 
1464
        insertValues(vArret, tableArret);
-
 
1465
 
-
 
1466
        if (!root.contains("CODE_CAISSE_CONGES_PAYES")) {
-
 
1467
            final SQLCreateTable createTableCode = new SQLCreateTable(root, "CODE_CAISSE_CONGES_PAYES");
-
 
1468
            createTableCode.addVarCharColumn("CODE", 25);
-
 
1469
            createTableCode.addVarCharColumn("NOM", 512);
-
 
1470
 
-
 
1471
            try {
-
 
1472
                root.getBase().getDataSource().execute(createTableCode.asString());
-
 
1473
                insertUndef(createTableCode);
-
 
1474
                root.refetchTable("CODE_CAISSE_CONGES_PAYES");
-
 
1475
                root.getSchema().updateVersion();
-
 
1476
 
-
 
1477
            } catch (SQLException ex) {
-
 
1478
                throw new IllegalStateException("Erreur lors de la création de la table " + "CODE_CAISSE_CONGES_PAYES", ex);
-
 
1479
            }
-
 
1480
        }
-
 
1481
 
-
 
1482
        if (!root.contains("MOTIF_NON_ASSUJETIS_TA")) {
-
 
1483
            final SQLCreateTable createTableCode = new SQLCreateTable(root, "MOTIF_NON_ASSUJETIS_TA");
-
 
1484
            createTableCode.addVarCharColumn("CODE", 25);
-
 
1485
            createTableCode.addVarCharColumn("NOM", 512);
-
 
1486
 
-
 
1487
            try {
-
 
1488
                root.getBase().getDataSource().execute(createTableCode.asString());
-
 
1489
                insertUndef(createTableCode);
-
 
1490
                root.refetchTable("MOTIF_NON_ASSUJETIS_TA");
-
 
1491
                root.getSchema().updateVersion();
-
 
1492
 
-
 
1493
                final SQLTable tableMotif = root.getTable("MOTIF_NON_ASSUJETIS_TA");
-
 
1494
                List<Tuple2<String, String>> vMotif = new ArrayList<Tuple2<String, String>>();
-
 
1495
                vMotif.add(Tuple2.create("001", "Non assujetti par choix du régime fiscal (option IR en catégorie BNC)"));
-
 
1496
                vMotif.add(Tuple2.create("002", "Collectivités publiques"));
-
 
1497
                vMotif.add(Tuple2.create("003", "Etablissements publics de recherche et les établissements publics d'enseignement supérieurs"));
-
 
1498
                vMotif.add(Tuple2.create("004", "Personnes morales créées pour la gestion d'un pôle de recherche et d'enseignement supérieur ou d'un réseau thématique de recherche avancée"));
-
 
1499
                vMotif.add(Tuple2.create("005", "Fondations reconnues d'utilité public du secteur de la recherche"));
-
 
1500
                vMotif.add(Tuple2.create("006", "Sociétés et personnes morales ayant pour objet exclusif l'enseignement"));
-
 
1501
                vMotif.add(Tuple2.create("007", "Associations sans but lucratif"));
-
 
1502
                vMotif.add(Tuple2.create("008", "Syndicats professionnels"));
-
 
1503
                vMotif.add(Tuple2.create("009", "Entreprises sans établissement en France (ESEF)"));
-
 
1504
                vMotif.add(Tuple2.create("010", "Sociétés civiles de moyens (SCM) non commerciale"));
-
 
1505
                vMotif.add(Tuple2.create("011", "Personnes physiques ou morales assujetties aux BNC ou BA"));
-
 
1506
                vMotif.add(Tuple2.create("012", "Les coopératives agricoles"));
-
 
1507
                vMotif.add(Tuple2.create("013", "Les coopératives artisanales, transport (y compris fluvial et maritime) et leurs unions"));
-
 
1508
                vMotif.add(Tuple2.create("014", "Les groupements d'employeurs dont agricoles"));
-
 
1509
                vMotif.add(Tuple2.create("015", "Les sociétés civiles agricoles"));
-
 
1510
                vMotif.add(Tuple2.create("016", "Les mutuelles et organismes mutualistes"));
-
 
1511
                vMotif.add(Tuple2.create("017",
-
 
1512
                        "Les organismes HLM, SA de crédit immobilier (I et au II de l'article L. 422-4 du code de la construction et de l'habitation ) et unions d'économie sociale"));
-
 
1513
                vMotif.add(Tuple2.create("018", "Les sociétés coopératives de construction désignées à l'article L. 432-2 du code de la construction et de l'habitation."));
-
 
1514
                vMotif.add(Tuple2.create("019", "Organismes chargés de l'organisation en France d'une compétition sportive internationale en France (Article L6131-1 du code du travail)"));
-
 
1515
 
-
 
1516
                insertValues(vMotif, tableMotif);
-
 
1517
            } catch (SQLException ex) {
-
 
1518
                throw new IllegalStateException("Erreur lors de la création de la table " + "MOTIF_NON_ASSUJETIS_TA", ex);
-
 
1519
            }
-
 
1520
        }
-
 
1521
        if (!societeCommonT.contains("ASSUJETTISSEMENT_TA")) {
-
 
1522
            AlterTable alterSoc = new AlterTable(societeCommonT);
-
 
1523
            alterSoc.addBooleanColumn("ASSUJETTISSEMENT_TA", Boolean.TRUE, false);
-
 
1524
            alterSoc.addBooleanColumn("ASSUJETTISSEMENT_CFP", Boolean.TRUE, false);
-
 
1525
            alterSoc.addBooleanColumn("ASSUJETTISSEMENT_CFP_CDD", Boolean.TRUE, false);
-
 
1526
            alterSoc.addForeignColumn("ID_MOTIF_NON_ASSUJETIS_TA", root.findTable("MOTIF_NON_ASSUJETIS_TA"));
-
 
1527
 
-
 
1528
            root.getBase().getDataSource().execute(alterSoc.asString());
-
 
1529
            root.getSchema().updateVersion();
-
 
1530
        }
1375
    }
1531
    }
1376
 
1532
 
1377
    public void updateDSN(final DBRoot root) throws SQLException {
1533
    public void updateDSN(final DBRoot root) throws SQLException {
1378
        final SQLTable tableCodeStatutCat = root.getTable("CODE_STATUT_CATEGORIEL");
1534
        final SQLTable tableCodeStatutCat = root.getTable("CODE_STATUT_CATEGORIEL");
1379
        SQLRow rowNonCadre = tableCodeStatutCat.getRow(4);
1535
        SQLRow rowNonCadre = tableCodeStatutCat.getRow(4);
Line 1676... Line 1832...
1676
            AlterTable alter = new AlterTable(tableContrat);
1832
            AlterTable alter = new AlterTable(tableContrat);
1677
            alter.addForeignColumn("ID_CODE_SUSPENSION", root.findTable("CODE_SUSPENSION"));
1833
            alter.addForeignColumn("ID_CODE_SUSPENSION", root.findTable("CODE_SUSPENSION"));
1678
            root.getBase().getDataSource().execute(alter.asString());
1834
            root.getBase().getDataSource().execute(alter.asString());
1679
            root.getSchema().updateVersion();
1835
            root.getSchema().updateVersion();
1680
        }
1836
        }
1681
        
1837
 
1682
        if (!tableContrat.contains("ID_DIPLOME_PREPARE")) {
1838
        if (!tableContrat.contains("ID_DIPLOME_PREPARE")) {
1683
            updateContrat = true;
1839
            updateContrat = true;
1684
            AlterTable alter = new AlterTable(tableContrat);
1840
            AlterTable alter = new AlterTable(tableContrat);
1685
            alter.addForeignColumn("ID_DIPLOME_PREPARE", root.findTable("DIPLOME_PREPARE"));
1841
            alter.addForeignColumn("ID_DIPLOME_PREPARE", root.findTable("DIPLOME_PREPARE"));
1686
            root.getBase().getDataSource().execute(alter.asString());
1842
            root.getBase().getDataSource().execute(alter.asString());
Line 1880... Line 2036...
1880
 
2036
 
1881
            } catch (SQLException ex) {
2037
            } catch (SQLException ex) {
1882
                throw new IllegalStateException("Erreur lors de la création de la table " + "CODE_PENIBILITE_CONTRAT_SALARIE", ex);
2038
                throw new IllegalStateException("Erreur lors de la création de la table " + "CODE_PENIBILITE_CONTRAT_SALARIE", ex);
1883
            }
2039
            }
1884
        }
2040
        }
-
 
2041
 
-
 
2042
        if (!root.contains("ARRET_CHOMAGE_INTEMPERIE")) {
-
 
2043
 
-
 
2044
            final SQLCreateTable createTableSal = new SQLCreateTable(root, "ARRET_CHOMAGE_INTEMPERIE");
-
 
2045
            final SQLTable tableInfosSalarie = root.getTable("INFOS_SALARIE_PAYE");
-
 
2046
            createTableSal.addForeignColumn("ID_INFOS_SALARIE_PAYE", tableInfosSalarie);
-
 
2047
            createTableSal.addForeignColumn("ID_CODE_AMENAGEMENT_PARTIEL", root.findTable("CODE_AMENAGEMENT_PARTIEL"));
-
 
2048
            createTableSal.addForeignColumn("ID_CODE_SUSPENSION", root.findTable("CODE_SUSPENSION"));
-
 
2049
            createTableSal.addColumn("DATE_DEBUT_SUSPENSION", "date");
-
 
2050
            createTableSal.addColumn("DATE_FIN_SUSPENSION", "date");
-
 
2051
 
-
 
2052
            try {
-
 
2053
                root.getBase().getDataSource().execute(createTableSal.asString());
-
 
2054
                insertUndef(createTableSal);
-
 
2055
                root.refetchTable("ARRET_CHOMAGE_INTEMPERIE");
-
 
2056
                root.getSchema().updateVersion();
-
 
2057
            } catch (SQLException ex) {
-
 
2058
                throw new IllegalStateException("Erreur lors de la création de la table " + "ARRET_CHOMAGE_INTEMPERIE", ex);
-
 
2059
            }
-
 
2060
        }
-
 
2061
 
-
 
2062
        if (!tableContrat.contains("ID_CODE_CAISSE_CONGES_PAYES")) {
-
 
2063
            AlterTable alterContrat = new AlterTable(tableContrat);
-
 
2064
            alterContrat.addForeignColumn("ID_CODE_CAISSE_CONGES_PAYES", root.findTable("CODE_CAISSE_CONGES_PAYES"));
-
 
2065
            alterContrat.addDecimalColumn("TAUX_FRAIS_PROFESSIONNELS", 16, 4, null, true);
-
 
2066
            root.getBase().getDataSource().execute(alterContrat.asString());
-
 
2067
            root.getSchema().updateVersion();
-
 
2068
        }
-
 
2069
 
1885
    }
2070
    }
1886
 
2071
 
1887
}
2072
}