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 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 180 Rev 182
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.
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.config;
14
 package org.openconcerto.erp.config;
15
 
15
 
16
import static java.util.Arrays.asList;
16
import static java.util.Arrays.asList;
17
 
17
 
18
import org.openconcerto.erp.core.common.element.AdresseCommonSQLElement;
18
import org.openconcerto.erp.core.common.element.AdresseCommonSQLElement;
19
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
19
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
20
import org.openconcerto.erp.core.common.element.BanqueSQLElement;
20
import org.openconcerto.erp.core.common.element.BanqueSQLElement;
21
import org.openconcerto.erp.core.common.element.DepartementSQLElement;
21
import org.openconcerto.erp.core.common.element.DepartementSQLElement;
22
import org.openconcerto.erp.core.common.element.LangueSQLElement;
22
import org.openconcerto.erp.core.common.element.LangueSQLElement;
23
import org.openconcerto.erp.core.common.element.MoisSQLElement;
23
import org.openconcerto.erp.core.common.element.MoisSQLElement;
24
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
24
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
25
import org.openconcerto.erp.core.common.element.PaysSQLElement;
25
import org.openconcerto.erp.core.common.element.PaysSQLElement;
26
import org.openconcerto.erp.core.common.element.SocieteCommonSQLElement;
26
import org.openconcerto.erp.core.common.element.SocieteCommonSQLElement;
27
import org.openconcerto.erp.core.common.element.StyleSQLElement;
27
import org.openconcerto.erp.core.common.element.StyleSQLElement;
28
import org.openconcerto.erp.core.common.element.TitrePersonnelSQLElement;
28
import org.openconcerto.erp.core.common.element.TitrePersonnelSQLElement;
29
import org.openconcerto.erp.core.customerrelationship.customer.element.AgenceSQLElement;
29
import org.openconcerto.erp.core.customerrelationship.customer.element.AgenceSQLElement;
30
import org.openconcerto.erp.core.customerrelationship.customer.element.ClientDepartementSQLElement;
30
import org.openconcerto.erp.core.customerrelationship.customer.element.ClientDepartementSQLElement;
31
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactAdministratifSQLElement;
31
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactAdministratifSQLElement;
32
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactFournisseurSQLElement;
32
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactFournisseurSQLElement;
33
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSQLElement;
33
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSQLElement;
34
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSalarieSQLElement;
34
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSalarieSQLElement;
35
import org.openconcerto.erp.core.customerrelationship.customer.element.CompteClientTransactionSQLELement;
35
import org.openconcerto.erp.core.customerrelationship.customer.element.CompteClientTransactionSQLELement;
36
import org.openconcerto.erp.core.customerrelationship.customer.element.CourrierClientSQLElement;
36
import org.openconcerto.erp.core.customerrelationship.customer.element.CourrierClientSQLElement;
37
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerCategorySQLElement;
37
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerCategorySQLElement;
38
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
38
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
39
import org.openconcerto.erp.core.customerrelationship.customer.element.ModeleCourrierClientSQLElement;
39
import org.openconcerto.erp.core.customerrelationship.customer.element.ModeleCourrierClientSQLElement;
40
import org.openconcerto.erp.core.customerrelationship.customer.element.ReferenceClientSQLElement;
40
import org.openconcerto.erp.core.customerrelationship.customer.element.ReferenceClientSQLElement;
41
import org.openconcerto.erp.core.customerrelationship.customer.element.RelanceSQLElement;
41
import org.openconcerto.erp.core.customerrelationship.customer.element.RelanceSQLElement;
42
import org.openconcerto.erp.core.customerrelationship.customer.element.TypeLettreRelanceSQLElement;
42
import org.openconcerto.erp.core.customerrelationship.customer.element.TypeLettreRelanceSQLElement;
43
import org.openconcerto.erp.core.customerrelationship.mail.EmailTemplateSQLElement;
43
import org.openconcerto.erp.core.customerrelationship.mail.EmailTemplateSQLElement;
44
import org.openconcerto.erp.core.edm.AttachmentSQLElement;
44
import org.openconcerto.erp.core.edm.AttachmentSQLElement;
45
import org.openconcerto.erp.core.finance.accounting.element.AssociationAnalytiqueSQLElement;
45
import org.openconcerto.erp.core.finance.accounting.element.AssociationAnalytiqueSQLElement;
46
import org.openconcerto.erp.core.finance.accounting.element.AssociationCompteAnalytiqueSQLElement;
46
import org.openconcerto.erp.core.finance.accounting.element.AssociationCompteAnalytiqueSQLElement;
47
import org.openconcerto.erp.core.finance.accounting.element.AxeAnalytiqueSQLElement;
47
import org.openconcerto.erp.core.finance.accounting.element.AxeAnalytiqueSQLElement;
48
import org.openconcerto.erp.core.finance.accounting.element.CategorieComptableSQLElement;
48
import org.openconcerto.erp.core.finance.accounting.element.CategorieComptableSQLElement;
49
import org.openconcerto.erp.core.finance.accounting.element.ComptePCESQLElement;
49
import org.openconcerto.erp.core.finance.accounting.element.ComptePCESQLElement;
50
import org.openconcerto.erp.core.finance.accounting.element.ComptePCGSQLElement;
50
import org.openconcerto.erp.core.finance.accounting.element.ComptePCGSQLElement;
51
import org.openconcerto.erp.core.finance.accounting.element.DeviseHistoriqueSQLElement;
51
import org.openconcerto.erp.core.finance.accounting.element.DeviseHistoriqueSQLElement;
52
import org.openconcerto.erp.core.finance.accounting.element.EcritureSQLElement;
52
import org.openconcerto.erp.core.finance.accounting.element.EcritureSQLElement;
53
import org.openconcerto.erp.core.finance.accounting.element.ExerciceCommonSQLElement;
53
import org.openconcerto.erp.core.finance.accounting.element.ExerciceCommonSQLElement;
54
import org.openconcerto.erp.core.finance.accounting.element.FraisDocumentSQLElement;
54
import org.openconcerto.erp.core.finance.accounting.element.FraisDocumentSQLElement;
55
import org.openconcerto.erp.core.finance.accounting.element.JournalSQLElement;
55
import org.openconcerto.erp.core.finance.accounting.element.JournalSQLElement;
56
import org.openconcerto.erp.core.finance.accounting.element.MouvementSQLElement;
56
import org.openconcerto.erp.core.finance.accounting.element.MouvementSQLElement;
57
import org.openconcerto.erp.core.finance.accounting.element.NatureCompteSQLElement;
57
import org.openconcerto.erp.core.finance.accounting.element.NatureCompteSQLElement;
58
import org.openconcerto.erp.core.finance.accounting.element.PieceSQLElement;
58
import org.openconcerto.erp.core.finance.accounting.element.PieceSQLElement;
59
import org.openconcerto.erp.core.finance.accounting.element.PosteAnalytiqueSQLElement;
59
import org.openconcerto.erp.core.finance.accounting.element.PosteAnalytiqueSQLElement;
60
import org.openconcerto.erp.core.finance.accounting.element.RepartitionAnalytiqueSQLElement;
60
import org.openconcerto.erp.core.finance.accounting.element.RepartitionAnalytiqueSQLElement;
61
import org.openconcerto.erp.core.finance.accounting.element.SaisieKmItemSQLElement;
61
import org.openconcerto.erp.core.finance.accounting.element.SaisieKmItemSQLElement;
62
import org.openconcerto.erp.core.finance.accounting.element.SaisieKmSQLElement;
62
import org.openconcerto.erp.core.finance.accounting.element.SaisieKmSQLElement;
63
import org.openconcerto.erp.core.finance.accounting.element.TypeComptePCGSQLElement;
63
import org.openconcerto.erp.core.finance.accounting.element.TypeComptePCGSQLElement;
64
import org.openconcerto.erp.core.finance.accounting.model.Currency;
64
import org.openconcerto.erp.core.finance.accounting.model.Currency;
65
import org.openconcerto.erp.core.finance.payment.element.ChequeAEncaisserSQLElement;
65
import org.openconcerto.erp.core.finance.payment.element.ChequeAEncaisserSQLElement;
66
import org.openconcerto.erp.core.finance.payment.element.ChequeAvoirClientSQLElement;
66
import org.openconcerto.erp.core.finance.payment.element.ChequeAvoirClientSQLElement;
67
import org.openconcerto.erp.core.finance.payment.element.ChequeFournisseurSQLElement;
67
import org.openconcerto.erp.core.finance.payment.element.ChequeFournisseurSQLElement;
68
import org.openconcerto.erp.core.finance.payment.element.DepotChequeElementSQLElement;
68
import org.openconcerto.erp.core.finance.payment.element.DepotChequeElementSQLElement;
69
import org.openconcerto.erp.core.finance.payment.element.DepotChequeSQLElement;
69
import org.openconcerto.erp.core.finance.payment.element.DepotChequeSQLElement;
70
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantElementSQLElement;
70
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantElementSQLElement;
71
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantSQLElement;
71
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantSQLElement;
72
import org.openconcerto.erp.core.finance.payment.element.ModeDeReglementSQLElement;
72
import org.openconcerto.erp.core.finance.payment.element.ModeDeReglementSQLElement;
73
import org.openconcerto.erp.core.finance.payment.element.ReglerMontantElementSQLElement;
73
import org.openconcerto.erp.core.finance.payment.element.ReglerMontantElementSQLElement;
74
import org.openconcerto.erp.core.finance.payment.element.ReglerMontantSQLElement;
74
import org.openconcerto.erp.core.finance.payment.element.ReglerMontantSQLElement;
75
import org.openconcerto.erp.core.finance.payment.element.SDDMessageSQLElement;
75
import org.openconcerto.erp.core.finance.payment.element.SDDMessageSQLElement;
76
import org.openconcerto.erp.core.finance.payment.element.SEPAMandateSQLElement;
76
import org.openconcerto.erp.core.finance.payment.element.SEPAMandateSQLElement;
77
import org.openconcerto.erp.core.finance.payment.element.TypeReglementSQLElement;
77
import org.openconcerto.erp.core.finance.payment.element.TypeReglementSQLElement;
78
import org.openconcerto.erp.core.finance.tax.element.EcoTaxeSQLElement;
78
import org.openconcerto.erp.core.finance.tax.element.EcoTaxeSQLElement;
79
import org.openconcerto.erp.core.finance.tax.element.TaxeComplementaireSQLElement;
79
import org.openconcerto.erp.core.finance.tax.element.TaxeComplementaireSQLElement;
80
import org.openconcerto.erp.core.finance.tax.element.TaxeSQLElement;
80
import org.openconcerto.erp.core.finance.tax.element.TaxeSQLElement;
81
import org.openconcerto.erp.core.humanresources.employe.element.CommercialSQLElement;
81
import org.openconcerto.erp.core.humanresources.employe.element.CommercialSQLElement;
82
import org.openconcerto.erp.core.humanresources.employe.element.EtatCivilSQLElement;
82
import org.openconcerto.erp.core.humanresources.employe.element.EtatCivilSQLElement;
83
import org.openconcerto.erp.core.humanresources.employe.element.ObjectifSQLElement;
83
import org.openconcerto.erp.core.humanresources.employe.element.ObjectifSQLElement;
84
import org.openconcerto.erp.core.humanresources.employe.element.SituationFamilialeSQLElement;
84
import org.openconcerto.erp.core.humanresources.employe.element.SituationFamilialeSQLElement;
85
import org.openconcerto.erp.core.humanresources.payroll.element.AcompteSQLElement;
85
import org.openconcerto.erp.core.humanresources.payroll.element.AcompteSQLElement;
-
 
86
import org.openconcerto.erp.core.humanresources.payroll.element.ArretChomageIntemperieSQLElement;
86
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitContratPrevSQLElement;
87
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitContratPrevSQLElement;
87
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitSQLElement;
88
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitSQLElement;
88
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitTypeSQLElement;
89
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitTypeSQLElement;
89
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationRenseignentSQLElement;
90
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationRenseignentSQLElement;
90
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationSQLElement;
91
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationSQLElement;
91
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseModePaiementSQLElement;
92
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseModePaiementSQLElement;
92
import org.openconcerto.erp.core.humanresources.payroll.element.ClassementConventionnelSQLElement;
93
import org.openconcerto.erp.core.humanresources.payroll.element.ClassementConventionnelSQLElement;
93
import org.openconcerto.erp.core.humanresources.payroll.element.CodeAmenagementPartielSQLElement;
94
import org.openconcerto.erp.core.humanresources.payroll.element.CodeAmenagementPartielSQLElement;
94
import org.openconcerto.erp.core.humanresources.payroll.element.CodeBaseAssujettieSQLElement;
95
import org.openconcerto.erp.core.humanresources.payroll.element.CodeBaseAssujettieSQLElement;
-
 
96
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseCongesPayesSQLElement;
95
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseTypeRubriqueSQLElement;
97
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseTypeRubriqueSQLElement;
96
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaractActiviteSQLElement;
98
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaractActiviteSQLElement;
97
import org.openconcerto.erp.core.humanresources.payroll.element.CodeContratTravailSQLElement;
99
import org.openconcerto.erp.core.humanresources.payroll.element.CodeContratTravailSQLElement;
98
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationEtablissementSQLElement;
100
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationEtablissementSQLElement;
99
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationIndividuelleSQLElement;
101
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationIndividuelleSQLElement;
100
import org.openconcerto.erp.core.humanresources.payroll.element.CodeDroitContratSQLElement;
102
import org.openconcerto.erp.core.humanresources.payroll.element.CodeDroitContratSQLElement;
101
import org.openconcerto.erp.core.humanresources.payroll.element.CodeEmploiSQLElement;
103
import org.openconcerto.erp.core.humanresources.payroll.element.CodeEmploiSQLElement;
102
import org.openconcerto.erp.core.humanresources.payroll.element.CodeIdccSQLElement;
104
import org.openconcerto.erp.core.humanresources.payroll.element.CodeIdccSQLElement;
103
import org.openconcerto.erp.core.humanresources.payroll.element.CodePenibiliteContratSQLElement;
105
import org.openconcerto.erp.core.humanresources.payroll.element.CodePenibiliteContratSQLElement;
104
import org.openconcerto.erp.core.humanresources.payroll.element.CodePenibiliteSQLElement;
106
import org.openconcerto.erp.core.humanresources.payroll.element.CodePenibiliteSQLElement;
105
import org.openconcerto.erp.core.humanresources.payroll.element.CodeRegimeSQLElement;
107
import org.openconcerto.erp.core.humanresources.payroll.element.CodeRegimeSQLElement;
106
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutCategorielConventionnelSQLElement;
108
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutCategorielConventionnelSQLElement;
107
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutCategorielSQLElement;
109
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutCategorielSQLElement;
108
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutProfSQLElement;
110
import org.openconcerto.erp.core.humanresources.payroll.element.CodeStatutProfSQLElement;
109
import org.openconcerto.erp.core.humanresources.payroll.element.CodeSuspensionSQLElement;
111
import org.openconcerto.erp.core.humanresources.payroll.element.CodeSuspensionSQLElement;
110
import org.openconcerto.erp.core.humanresources.payroll.element.CodeTypeRubriqueBrutSQLElement;
112
import org.openconcerto.erp.core.humanresources.payroll.element.CodeTypeRubriqueBrutSQLElement;
111
import org.openconcerto.erp.core.humanresources.payroll.element.CoefficientPrimeSQLElement;
113
import org.openconcerto.erp.core.humanresources.payroll.element.CoefficientPrimeSQLElement;
112
import org.openconcerto.erp.core.humanresources.payroll.element.ContratDetacheExpatrieSQLElement;
114
import org.openconcerto.erp.core.humanresources.payroll.element.ContratDetacheExpatrieSQLElement;
113
import org.openconcerto.erp.core.humanresources.payroll.element.ContratDispositifPolitiqueSQLElement;
115
import org.openconcerto.erp.core.humanresources.payroll.element.ContratDispositifPolitiqueSQLElement;
114
import org.openconcerto.erp.core.humanresources.payroll.element.ContratModaliteTempsSQLElement;
116
import org.openconcerto.erp.core.humanresources.payroll.element.ContratModaliteTempsSQLElement;
115
import org.openconcerto.erp.core.humanresources.payroll.element.ContratMotifRecoursSQLElement;
117
import org.openconcerto.erp.core.humanresources.payroll.element.ContratMotifRecoursSQLElement;
116
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceRubriqueNetSQLElement;
118
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceRubriqueNetSQLElement;
117
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceRubriqueSQLElement;
119
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceRubriqueSQLElement;
118
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceSQLElement;
120
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceSQLElement;
119
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceSalarieSQLElement;
121
import org.openconcerto.erp.core.humanresources.payroll.element.ContratPrevoyanceSalarieSQLElement;
120
import org.openconcerto.erp.core.humanresources.payroll.element.ContratRegimeMaladieSQLElement;
122
import org.openconcerto.erp.core.humanresources.payroll.element.ContratRegimeMaladieSQLElement;
121
import org.openconcerto.erp.core.humanresources.payroll.element.ContratRegimeVieillesseSQLElement;
123
import org.openconcerto.erp.core.humanresources.payroll.element.ContratRegimeVieillesseSQLElement;
122
import org.openconcerto.erp.core.humanresources.payroll.element.ContratSalarieSQLElement;
124
import org.openconcerto.erp.core.humanresources.payroll.element.ContratSalarieSQLElement;
123
import org.openconcerto.erp.core.humanresources.payroll.element.CumulsCongesSQLElement;
125
import org.openconcerto.erp.core.humanresources.payroll.element.CumulsCongesSQLElement;
124
import org.openconcerto.erp.core.humanresources.payroll.element.CumulsPayeSQLElement;
126
import org.openconcerto.erp.core.humanresources.payroll.element.CumulsPayeSQLElement;
125
import org.openconcerto.erp.core.humanresources.payroll.element.DSNNatureSQLElement;
127
import org.openconcerto.erp.core.humanresources.payroll.element.DSNNatureSQLElement;
126
import org.openconcerto.erp.core.humanresources.payroll.element.DiplomePrepareSQLElement;
128
import org.openconcerto.erp.core.humanresources.payroll.element.DiplomePrepareSQLElement;
127
import org.openconcerto.erp.core.humanresources.payroll.element.FichePayeElementSQLElement;
129
import org.openconcerto.erp.core.humanresources.payroll.element.FichePayeElementSQLElement;
128
import org.openconcerto.erp.core.humanresources.payroll.element.FichePayeSQLElement;
130
import org.openconcerto.erp.core.humanresources.payroll.element.FichePayeSQLElement;
129
import org.openconcerto.erp.core.humanresources.payroll.element.ImpressionRubriqueSQLElement;
131
import org.openconcerto.erp.core.humanresources.payroll.element.ImpressionRubriqueSQLElement;
130
import org.openconcerto.erp.core.humanresources.payroll.element.InfosSalariePayeSQLElement;
132
import org.openconcerto.erp.core.humanresources.payroll.element.InfosSalariePayeSQLElement;
131
import org.openconcerto.erp.core.humanresources.payroll.element.ModeReglementPayeSQLElement;
133
import org.openconcerto.erp.core.humanresources.payroll.element.ModeReglementPayeSQLElement;
132
import org.openconcerto.erp.core.humanresources.payroll.element.MotifArretTravailSQLElement;
134
import org.openconcerto.erp.core.humanresources.payroll.element.MotifArretTravailSQLElement;
133
import org.openconcerto.erp.core.humanresources.payroll.element.MotifFinContratSQLElement;
135
import org.openconcerto.erp.core.humanresources.payroll.element.MotifFinContratSQLElement;
-
 
136
import org.openconcerto.erp.core.humanresources.payroll.element.MotifNonAssujettisTASQLElement;
134
import org.openconcerto.erp.core.humanresources.payroll.element.MotifRepriseArretTravailSQLElement;
137
import org.openconcerto.erp.core.humanresources.payroll.element.MotifRepriseArretTravailSQLElement;
135
import org.openconcerto.erp.core.humanresources.payroll.element.PasSQLElement;
138
import org.openconcerto.erp.core.humanresources.payroll.element.PasSQLElement;
136
import org.openconcerto.erp.core.humanresources.payroll.element.PeriodeValiditeSQLElement;
139
import org.openconcerto.erp.core.humanresources.payroll.element.PeriodeValiditeSQLElement;
137
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeElementSQLElement;
140
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeElementSQLElement;
138
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeSQLElement;
141
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeSQLElement;
139
import org.openconcerto.erp.core.humanresources.payroll.element.RegimeBaseSQLElement;
142
import org.openconcerto.erp.core.humanresources.payroll.element.RegimeBaseSQLElement;
140
import org.openconcerto.erp.core.humanresources.payroll.element.ReglementPayeSQLElement;
143
import org.openconcerto.erp.core.humanresources.payroll.element.ReglementPayeSQLElement;
141
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueBrutSQLElement;
144
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueBrutSQLElement;
142
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueCommSQLElement;
145
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueCommSQLElement;
143
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueCotisationSQLElement;
146
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueCotisationSQLElement;
144
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueNetSQLElement;
147
import org.openconcerto.erp.core.humanresources.payroll.element.RubriqueNetSQLElement;
145
import org.openconcerto.erp.core.humanresources.payroll.element.SalarieSQLElement;
148
import org.openconcerto.erp.core.humanresources.payroll.element.SalarieSQLElement;
146
import org.openconcerto.erp.core.humanresources.payroll.element.TypeComposantBaseAssujettieSQLElement;
149
import org.openconcerto.erp.core.humanresources.payroll.element.TypeComposantBaseAssujettieSQLElement;
147
import org.openconcerto.erp.core.humanresources.payroll.element.TypePreavisSQLElement;
150
import org.openconcerto.erp.core.humanresources.payroll.element.TypePreavisSQLElement;
148
import org.openconcerto.erp.core.humanresources.payroll.element.TypeRubriqueBrutSQLElement;
151
import org.openconcerto.erp.core.humanresources.payroll.element.TypeRubriqueBrutSQLElement;
149
import org.openconcerto.erp.core.humanresources.payroll.element.TypeRubriqueNetSQLElement;
152
import org.openconcerto.erp.core.humanresources.payroll.element.TypeRubriqueNetSQLElement;
150
import org.openconcerto.erp.core.humanresources.payroll.element.TypeTauxPasSQLElement;
153
import org.openconcerto.erp.core.humanresources.payroll.element.TypeTauxPasSQLElement;
151
import org.openconcerto.erp.core.humanresources.payroll.element.VariablePayeSQLElement;
154
import org.openconcerto.erp.core.humanresources.payroll.element.VariablePayeSQLElement;
152
import org.openconcerto.erp.core.humanresources.payroll.element.VariableSalarieSQLElement;
155
import org.openconcerto.erp.core.humanresources.payroll.element.VariableSalarieSQLElement;
153
import org.openconcerto.erp.core.humanresources.timesheet.element.PointageSQLElement;
156
import org.openconcerto.erp.core.humanresources.timesheet.element.PointageSQLElement;
154
import org.openconcerto.erp.core.project.element.CalendarItemGroupSQLElement;
157
import org.openconcerto.erp.core.project.element.CalendarItemGroupSQLElement;
155
import org.openconcerto.erp.core.project.element.CalendarItemSQLElement;
158
import org.openconcerto.erp.core.project.element.CalendarItemSQLElement;
156
import org.openconcerto.erp.core.sales.credit.element.AvoirClientElementSQLElement;
159
import org.openconcerto.erp.core.sales.credit.element.AvoirClientElementSQLElement;
157
import org.openconcerto.erp.core.sales.credit.element.AvoirClientSQLElement;
160
import org.openconcerto.erp.core.sales.credit.element.AvoirClientSQLElement;
158
import org.openconcerto.erp.core.sales.invoice.element.EcheanceClientSQLElement;
161
import org.openconcerto.erp.core.sales.invoice.element.EcheanceClientSQLElement;
159
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureItemSQLElement;
162
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureItemSQLElement;
160
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureSQLElement;
163
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureSQLElement;
161
import org.openconcerto.erp.core.sales.invoice.element.TransferInvoiceSQLElement;
164
import org.openconcerto.erp.core.sales.invoice.element.TransferInvoiceSQLElement;
162
import org.openconcerto.erp.core.sales.order.element.ChiffrageCommandeClientSQLElement;
165
import org.openconcerto.erp.core.sales.order.element.ChiffrageCommandeClientSQLElement;
163
import org.openconcerto.erp.core.sales.order.element.CommandeClientElementSQLElement;
166
import org.openconcerto.erp.core.sales.order.element.CommandeClientElementSQLElement;
164
import org.openconcerto.erp.core.sales.order.element.CommandeClientSQLElement;
167
import org.openconcerto.erp.core.sales.order.element.CommandeClientSQLElement;
165
import org.openconcerto.erp.core.sales.order.element.FacturationCommandeClientSQLElement;
168
import org.openconcerto.erp.core.sales.order.element.FacturationCommandeClientSQLElement;
166
import org.openconcerto.erp.core.sales.order.element.TransferCustomerOrderSQLElement;
169
import org.openconcerto.erp.core.sales.order.element.TransferCustomerOrderSQLElement;
167
import org.openconcerto.erp.core.sales.pos.element.CaisseJournalSQLElement;
170
import org.openconcerto.erp.core.sales.pos.element.CaisseJournalSQLElement;
168
import org.openconcerto.erp.core.sales.pos.element.CaisseTicketSQLElement;
171
import org.openconcerto.erp.core.sales.pos.element.CaisseTicketSQLElement;
169
import org.openconcerto.erp.core.sales.pos.element.ClôtureCaisseSQLElement;
172
import org.openconcerto.erp.core.sales.pos.element.ClôtureCaisseSQLElement;
170
import org.openconcerto.erp.core.sales.pos.element.SaisieVenteComptoirSQLElement;
173
import org.openconcerto.erp.core.sales.pos.element.SaisieVenteComptoirSQLElement;
171
import org.openconcerto.erp.core.sales.pos.element.TicketCaisseSQLElement;
174
import org.openconcerto.erp.core.sales.pos.element.TicketCaisseSQLElement;
172
import org.openconcerto.erp.core.sales.pos.io.BarcodeReader;
175
import org.openconcerto.erp.core.sales.pos.io.BarcodeReader;
173
import org.openconcerto.erp.core.sales.price.element.DeviseSQLElement;
176
import org.openconcerto.erp.core.sales.price.element.DeviseSQLElement;
-
 
177
import org.openconcerto.erp.core.sales.price.element.TarifPromotionSQLElement;
174
import org.openconcerto.erp.core.sales.price.element.TarifSQLElement;
178
import org.openconcerto.erp.core.sales.price.element.TarifSQLElement;
175
import org.openconcerto.erp.core.sales.product.element.ArticleCatComptableSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.ArticleCatComptableSQLElement;
176
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
180
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
-
 
181
import org.openconcerto.erp.core.sales.product.element.ArticleDeclinaisonSQLElement;
177
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
182
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
178
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
183
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
-
 
184
import org.openconcerto.erp.core.sales.product.element.ArticleTarifPromotionSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
185
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
180
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
186
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
181
import org.openconcerto.erp.core.sales.product.element.CustomerProductFamilyQtyPriceSQLElement;
187
import org.openconcerto.erp.core.sales.product.element.CustomerProductFamilyQtyPriceSQLElement;
182
import org.openconcerto.erp.core.sales.product.element.CustomerProductQtyPriceSQLElement;
188
import org.openconcerto.erp.core.sales.product.element.CustomerProductQtyPriceSQLElement;
183
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
189
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
184
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
190
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
185
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
191
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
-
 
192
import org.openconcerto.erp.core.sales.product.element.LotSQLElement;
186
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
193
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
187
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
194
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
188
import org.openconcerto.erp.core.sales.product.element.ProductItemSQLElement;
195
import org.openconcerto.erp.core.sales.product.element.ProductItemSQLElement;
189
import org.openconcerto.erp.core.sales.product.element.ProductQtyPriceSQLElement;
196
import org.openconcerto.erp.core.sales.product.element.ProductQtyPriceSQLElement;
190
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
197
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
191
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement;
198
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement;
192
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement.ReliquatBRSQLElement;
199
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement.ReliquatBRSQLElement;
193
import org.openconcerto.erp.core.sales.product.element.SupplierPriceListSQLElement;
200
import org.openconcerto.erp.core.sales.product.element.SupplierPriceListSQLElement;
-
 
201
import org.openconcerto.erp.core.sales.product.element.TaxeCatComptableSQLElement;
194
import org.openconcerto.erp.core.sales.product.element.UniteVenteArticleSQLElement;
202
import org.openconcerto.erp.core.sales.product.element.UniteVenteArticleSQLElement;
195
import org.openconcerto.erp.core.sales.quote.element.DevisItemSQLElement;
203
import org.openconcerto.erp.core.sales.quote.element.DevisItemSQLElement;
196
import org.openconcerto.erp.core.sales.quote.element.DevisLogMailSQLElement;
204
import org.openconcerto.erp.core.sales.quote.element.DevisLogMailSQLElement;
197
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
205
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
198
import org.openconcerto.erp.core.sales.quote.element.EtatDevisSQLElement;
206
import org.openconcerto.erp.core.sales.quote.element.EtatDevisSQLElement;
199
import org.openconcerto.erp.core.sales.quote.element.TransferQuoteSQLElement;
207
import org.openconcerto.erp.core.sales.quote.element.TransferQuoteSQLElement;
200
import org.openconcerto.erp.core.sales.shipment.element.BonDeLivraisonItemSQLElement;
208
import org.openconcerto.erp.core.sales.shipment.element.BonDeLivraisonItemSQLElement;
201
import org.openconcerto.erp.core.sales.shipment.element.BonDeLivraisonSQLElement;
209
import org.openconcerto.erp.core.sales.shipment.element.BonDeLivraisonSQLElement;
202
import org.openconcerto.erp.core.sales.shipment.element.TransferShipmentSQLElement;
210
import org.openconcerto.erp.core.sales.shipment.element.TransferShipmentSQLElement;
203
import org.openconcerto.erp.core.supplychain.credit.element.AvoirFournisseurSQLElement;
211
import org.openconcerto.erp.core.supplychain.credit.element.AvoirFournisseurSQLElement;
204
import org.openconcerto.erp.core.supplychain.order.element.CommandeElementSQLElement;
212
import org.openconcerto.erp.core.supplychain.order.element.CommandeElementSQLElement;
205
import org.openconcerto.erp.core.supplychain.order.element.CommandeSQLElement;
213
import org.openconcerto.erp.core.supplychain.order.element.CommandeSQLElement;
206
import org.openconcerto.erp.core.supplychain.order.element.DemandeAchatItemSQLElement;
214
import org.openconcerto.erp.core.supplychain.order.element.DemandeAchatItemSQLElement;
207
import org.openconcerto.erp.core.supplychain.order.element.DemandePrixItemSQLElement;
215
import org.openconcerto.erp.core.supplychain.order.element.DemandePrixItemSQLElement;
208
import org.openconcerto.erp.core.supplychain.order.element.DemandePrixSQLElement;
216
import org.openconcerto.erp.core.supplychain.order.element.DemandePrixSQLElement;
209
import org.openconcerto.erp.core.supplychain.order.element.EtatDemandeAchatItemSQLElement;
217
import org.openconcerto.erp.core.supplychain.order.element.EtatDemandeAchatItemSQLElement;
210
import org.openconcerto.erp.core.supplychain.order.element.EtatDemandePrixSQLElement;
218
import org.openconcerto.erp.core.supplychain.order.element.EtatDemandePrixSQLElement;
211
import org.openconcerto.erp.core.supplychain.order.element.FabricantSQLElement;
219
import org.openconcerto.erp.core.supplychain.order.element.FabricantSQLElement;
212
import org.openconcerto.erp.core.supplychain.order.element.FactureFournisseurElementSQLElement;
220
import org.openconcerto.erp.core.supplychain.order.element.FactureFournisseurElementSQLElement;
213
import org.openconcerto.erp.core.supplychain.order.element.FactureFournisseurSQLElement;
221
import org.openconcerto.erp.core.supplychain.order.element.FactureFournisseurSQLElement;
214
import org.openconcerto.erp.core.supplychain.order.element.SaisieAchatSQLElement;
222
import org.openconcerto.erp.core.supplychain.order.element.SaisieAchatSQLElement;
215
import org.openconcerto.erp.core.supplychain.order.element.TransferPurchaseSQLElement;
223
import org.openconcerto.erp.core.supplychain.order.element.TransferPurchaseSQLElement;
216
import org.openconcerto.erp.core.supplychain.order.element.TransferSupplierOrderSQLElement;
224
import org.openconcerto.erp.core.supplychain.order.element.TransferSupplierOrderSQLElement;
217
import org.openconcerto.erp.core.supplychain.product.element.ArticleFournisseurSQLElement;
225
import org.openconcerto.erp.core.supplychain.product.element.ArticleFournisseurSQLElement;
218
import org.openconcerto.erp.core.supplychain.product.element.FamilleArticleFounisseurSQLElement;
226
import org.openconcerto.erp.core.supplychain.product.element.FamilleArticleFounisseurSQLElement;
219
import org.openconcerto.erp.core.supplychain.receipt.element.BonReceptionElementSQLElement;
227
import org.openconcerto.erp.core.supplychain.receipt.element.BonReceptionElementSQLElement;
220
import org.openconcerto.erp.core.supplychain.receipt.element.BonReceptionSQLElement;
228
import org.openconcerto.erp.core.supplychain.receipt.element.BonReceptionSQLElement;
221
import org.openconcerto.erp.core.supplychain.receipt.element.CodeFournisseurSQLElement;
229
import org.openconcerto.erp.core.supplychain.receipt.element.CodeFournisseurSQLElement;
222
import org.openconcerto.erp.core.supplychain.receipt.element.TransferReceiptSQLElement;
230
import org.openconcerto.erp.core.supplychain.receipt.element.TransferReceiptSQLElement;
223
import org.openconcerto.erp.core.supplychain.stock.element.DepotStockSQLElement;
231
import org.openconcerto.erp.core.supplychain.stock.element.DepotStockSQLElement;
224
import org.openconcerto.erp.core.supplychain.stock.element.EtatStockItemSQLElement;
232
import org.openconcerto.erp.core.supplychain.stock.element.EtatStockItemSQLElement;
225
import org.openconcerto.erp.core.supplychain.stock.element.EtatStockSQLElement;
233
import org.openconcerto.erp.core.supplychain.stock.element.EtatStockSQLElement;
226
import org.openconcerto.erp.core.supplychain.stock.element.MouvementStockSQLElement;
234
import org.openconcerto.erp.core.supplychain.stock.element.MouvementStockSQLElement;
227
import org.openconcerto.erp.core.supplychain.stock.element.StockSQLElement;
235
import org.openconcerto.erp.core.supplychain.stock.element.StockSQLElement;
228
import org.openconcerto.erp.core.supplychain.supplier.element.EcheanceFournisseurSQLElement;
236
import org.openconcerto.erp.core.supplychain.supplier.element.EcheanceFournisseurSQLElement;
229
import org.openconcerto.erp.core.supplychain.supplier.element.FournisseurSQLElement;
237
import org.openconcerto.erp.core.supplychain.supplier.element.FournisseurSQLElement;
230
import org.openconcerto.erp.generationDoc.element.ModeleSQLElement;
238
import org.openconcerto.erp.generationDoc.element.ModeleSQLElement;
231
import org.openconcerto.erp.generationDoc.element.TypeModeleSQLElement;
239
import org.openconcerto.erp.generationDoc.element.TypeModeleSQLElement;
232
import org.openconcerto.erp.generationDoc.provider.AdresseFullClientValueProvider;
240
import org.openconcerto.erp.generationDoc.provider.AdresseFullClientValueProvider;
233
import org.openconcerto.erp.generationDoc.provider.AdresseRueClientValueProvider;
241
import org.openconcerto.erp.generationDoc.provider.AdresseRueClientValueProvider;
234
import org.openconcerto.erp.generationDoc.provider.AdresseVilleCPClientValueProvider;
242
import org.openconcerto.erp.generationDoc.provider.AdresseVilleCPClientValueProvider;
235
import org.openconcerto.erp.generationDoc.provider.AdresseVilleClientValueProvider;
243
import org.openconcerto.erp.generationDoc.provider.AdresseVilleClientValueProvider;
236
import org.openconcerto.erp.generationDoc.provider.AdresseVilleNomClientValueProvider;
244
import org.openconcerto.erp.generationDoc.provider.AdresseVilleNomClientValueProvider;
237
import org.openconcerto.erp.generationDoc.provider.ArticleCodeClientProvider;
245
import org.openconcerto.erp.generationDoc.provider.ArticleCodeClientProvider;
238
import org.openconcerto.erp.generationDoc.provider.ArticleCodeFournisseurProvider;
246
import org.openconcerto.erp.generationDoc.provider.ArticleCodeFournisseurProvider;
239
import org.openconcerto.erp.generationDoc.provider.ConditionsReglementDetailsProvider;
247
import org.openconcerto.erp.generationDoc.provider.ConditionsReglementDetailsProvider;
240
import org.openconcerto.erp.generationDoc.provider.DateBLProvider;
248
import org.openconcerto.erp.generationDoc.provider.DateBLProvider;
241
import org.openconcerto.erp.generationDoc.provider.DateProvider;
249
import org.openconcerto.erp.generationDoc.provider.DateProvider;
242
import org.openconcerto.erp.generationDoc.provider.FacturableValueProvider;
250
import org.openconcerto.erp.generationDoc.provider.FacturableValueProvider;
243
import org.openconcerto.erp.generationDoc.provider.FichePayeHeureSupTotalProvider;
251
import org.openconcerto.erp.generationDoc.provider.FichePayeHeureSupTotalProvider;
244
import org.openconcerto.erp.generationDoc.provider.FichePayeHeureTotalProvider;
252
import org.openconcerto.erp.generationDoc.provider.FichePayeHeureTotalProvider;
245
import org.openconcerto.erp.generationDoc.provider.FichePayePlafondAProvider;
253
import org.openconcerto.erp.generationDoc.provider.FichePayePlafondAProvider;
246
import org.openconcerto.erp.generationDoc.provider.FichePayeSmicHProvider;
254
import org.openconcerto.erp.generationDoc.provider.FichePayeSmicHProvider;
247
import org.openconcerto.erp.generationDoc.provider.FormatedGlobalQtyTotalProvider;
255
import org.openconcerto.erp.generationDoc.provider.FormatedGlobalQtyTotalProvider;
248
import org.openconcerto.erp.generationDoc.provider.IbanProvider;
256
import org.openconcerto.erp.generationDoc.provider.IbanProvider;
249
import org.openconcerto.erp.generationDoc.provider.LabelAccountInvoiceProvider;
257
import org.openconcerto.erp.generationDoc.provider.LabelAccountInvoiceProvider;
250
import org.openconcerto.erp.generationDoc.provider.MergedGlobalQtyTotalProvider;
258
import org.openconcerto.erp.generationDoc.provider.MergedGlobalQtyTotalProvider;
251
import org.openconcerto.erp.generationDoc.provider.ModeDeReglementDetailsProvider;
259
import org.openconcerto.erp.generationDoc.provider.ModeDeReglementDetailsProvider;
252
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
260
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
253
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
261
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
254
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
262
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
255
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
263
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
256
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
264
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
-
 
265
import org.openconcerto.erp.generationDoc.provider.QteLineDocProvider;
257
import org.openconcerto.erp.generationDoc.provider.QteTotalDocProvider;
266
import org.openconcerto.erp.generationDoc.provider.QteTotalDocProvider;
-
 
267
import org.openconcerto.erp.generationDoc.provider.QteTotalLineDocProvider;
258
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
268
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
259
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
269
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
260
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
270
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
261
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
271
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
262
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
272
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
263
import org.openconcerto.erp.generationDoc.provider.RestantAReglerProvider;
273
import org.openconcerto.erp.generationDoc.provider.RestantAReglerProvider;
264
import org.openconcerto.erp.generationDoc.provider.SaledTotalNotDiscountedProvider;
274
import org.openconcerto.erp.generationDoc.provider.SaledTotalNotDiscountedProvider;
265
import org.openconcerto.erp.generationDoc.provider.StockLocationProvider;
275
import org.openconcerto.erp.generationDoc.provider.StockLocationProvider;
266
import org.openconcerto.erp.generationDoc.provider.TotalAcompteProvider;
276
import org.openconcerto.erp.generationDoc.provider.TotalAcompteProvider;
267
import org.openconcerto.erp.generationDoc.provider.TotalCommandeClientProvider;
277
import org.openconcerto.erp.generationDoc.provider.TotalCommandeClientProvider;
268
import org.openconcerto.erp.generationDoc.provider.UserCreateInitialsValueProvider;
278
import org.openconcerto.erp.generationDoc.provider.UserCreateInitialsValueProvider;
269
import org.openconcerto.erp.generationDoc.provider.UserCurrentInitialsValueProvider;
279
import org.openconcerto.erp.generationDoc.provider.UserCurrentInitialsValueProvider;
270
import org.openconcerto.erp.generationDoc.provider.UserModifyInitialsValueProvider;
280
import org.openconcerto.erp.generationDoc.provider.UserModifyInitialsValueProvider;
271
import org.openconcerto.erp.generationEcritures.provider.SalesCreditAccountingRecordsProvider;
281
import org.openconcerto.erp.generationEcritures.provider.SalesCreditAccountingRecordsProvider;
272
import org.openconcerto.erp.generationEcritures.provider.SalesInvoiceAccountingRecordsProvider;
282
import org.openconcerto.erp.generationEcritures.provider.SalesInvoiceAccountingRecordsProvider;
273
import org.openconcerto.erp.generationEcritures.provider.SupplyOrderAccountingRecordsProvider;
283
import org.openconcerto.erp.generationEcritures.provider.SupplyOrderAccountingRecordsProvider;
274
import org.openconcerto.erp.injector.AchatAvoirSQLInjector;
284
import org.openconcerto.erp.injector.AchatAvoirSQLInjector;
275
import org.openconcerto.erp.injector.ArticleCommandeEltSQLInjector;
285
import org.openconcerto.erp.injector.ArticleCommandeEltSQLInjector;
276
import org.openconcerto.erp.injector.BonFactureEltSQLInjector;
286
import org.openconcerto.erp.injector.BonFactureEltSQLInjector;
277
import org.openconcerto.erp.injector.BonFactureSQLInjector;
287
import org.openconcerto.erp.injector.BonFactureSQLInjector;
278
import org.openconcerto.erp.injector.BonReceptionFactureFournisseurSQLInjector;
288
import org.openconcerto.erp.injector.BonReceptionFactureFournisseurSQLInjector;
279
import org.openconcerto.erp.injector.BrEltFactEltSQLInjector;
289
import org.openconcerto.erp.injector.BrEltFactEltSQLInjector;
280
import org.openconcerto.erp.injector.BrFactureAchatSQLInjector;
290
import org.openconcerto.erp.injector.BrFactureAchatSQLInjector;
281
import org.openconcerto.erp.injector.CmdEltFactEltSQLInjector;
291
import org.openconcerto.erp.injector.CmdEltFactEltSQLInjector;
282
import org.openconcerto.erp.injector.CommandeBlEltSQLInjector;
292
import org.openconcerto.erp.injector.CommandeBlEltSQLInjector;
283
import org.openconcerto.erp.injector.CommandeBlSQLInjector;
293
import org.openconcerto.erp.injector.CommandeBlSQLInjector;
284
import org.openconcerto.erp.injector.CommandeBrEltSQLInjector;
294
import org.openconcerto.erp.injector.CommandeBrEltSQLInjector;
285
import org.openconcerto.erp.injector.CommandeBrSQLInjector;
295
import org.openconcerto.erp.injector.CommandeBrSQLInjector;
286
import org.openconcerto.erp.injector.CommandeCliCommandeSQLInjector;
296
import org.openconcerto.erp.injector.CommandeCliCommandeSQLInjector;
287
import org.openconcerto.erp.injector.CommandeFactureAchatSQLInjector;
297
import org.openconcerto.erp.injector.CommandeFactureAchatSQLInjector;
288
import org.openconcerto.erp.injector.CommandeFactureClientSQLInjector;
298
import org.openconcerto.erp.injector.CommandeFactureClientSQLInjector;
289
import org.openconcerto.erp.injector.CommandeFactureEltSQLInjector;
299
import org.openconcerto.erp.injector.CommandeFactureEltSQLInjector;
290
import org.openconcerto.erp.injector.CommandeFactureFournisseurSQLInjector;
300
import org.openconcerto.erp.injector.CommandeFactureFournisseurSQLInjector;
291
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
301
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
292
import org.openconcerto.erp.injector.DevisBlSQLInjector;
302
import org.openconcerto.erp.injector.DevisBlSQLInjector;
293
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
303
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
294
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
304
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
-
 
305
import org.openconcerto.erp.injector.DevisEltCmdEltSQLInjector;
295
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
306
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
296
import org.openconcerto.erp.injector.DevisFactureSQLInjector;
307
import org.openconcerto.erp.injector.DevisFactureSQLInjector;
297
import org.openconcerto.erp.injector.DmdAchatDmdPrixEltSQLInjector;
308
import org.openconcerto.erp.injector.DmdAchatDmdPrixEltSQLInjector;
298
import org.openconcerto.erp.injector.DmdPrixCmdSQLInjector;
309
import org.openconcerto.erp.injector.DmdPrixCmdSQLInjector;
299
import org.openconcerto.erp.injector.EcheanceEncaisseSQLInjector;
310
import org.openconcerto.erp.injector.EcheanceEncaisseSQLInjector;
300
import org.openconcerto.erp.injector.EcheanceRegleSQLInjector;
311
import org.openconcerto.erp.injector.EcheanceRegleSQLInjector;
301
import org.openconcerto.erp.injector.FactureAvoirSQLInjector;
312
import org.openconcerto.erp.injector.FactureAvoirSQLInjector;
302
import org.openconcerto.erp.injector.FactureBonSQLInjector;
313
import org.openconcerto.erp.injector.FactureBonSQLInjector;
303
import org.openconcerto.erp.injector.FactureCommandeSQLInjector;
314
import org.openconcerto.erp.injector.FactureCommandeSQLInjector;
304
import org.openconcerto.erp.modules.ModuleManager;
315
import org.openconcerto.erp.modules.ModuleManager;
305
import org.openconcerto.erp.preferences.DefaultNXProps;
316
import org.openconcerto.erp.preferences.DefaultNXProps;
306
import org.openconcerto.erp.preferences.GestionClientPreferencePanel;
317
import org.openconcerto.erp.preferences.GestionClientPreferencePanel;
307
import org.openconcerto.erp.preferences.GestionCommercialeGlobalPreferencePanel;
318
import org.openconcerto.erp.preferences.GestionCommercialeGlobalPreferencePanel;
308
import org.openconcerto.erp.preferences.TemplateNXProps;
319
import org.openconcerto.erp.preferences.TemplateNXProps;
309
import org.openconcerto.erp.storage.CloudStorageEngine;
320
import org.openconcerto.erp.storage.CloudStorageEngine;
310
import org.openconcerto.erp.storage.StorageEngines;
321
import org.openconcerto.erp.storage.StorageEngines;
311
import org.openconcerto.erp.utils.TM;
322
import org.openconcerto.erp.utils.TM;
312
import org.jopendocument.link.OOConnexion;
323
import org.jopendocument.link.OOConnexion;
313
import org.openconcerto.sql.ShowAs;
324
import org.openconcerto.sql.ShowAs;
314
import org.openconcerto.sql.element.SQLElement;
325
import org.openconcerto.sql.element.SQLElement;
315
import org.openconcerto.sql.element.SQLElementDirectory;
326
import org.openconcerto.sql.element.SQLElementDirectory;
316
import org.openconcerto.sql.element.SharedSQLElement;
327
import org.openconcerto.sql.element.SharedSQLElement;
317
import org.openconcerto.sql.model.DBRoot;
328
import org.openconcerto.sql.model.DBRoot;
318
import org.openconcerto.sql.model.DBStructureItemNotFound;
329
import org.openconcerto.sql.model.DBStructureItemNotFound;
319
import org.openconcerto.sql.model.DBSystemRoot;
330
import org.openconcerto.sql.model.DBSystemRoot;
320
import org.openconcerto.sql.model.FieldMapper;
331
import org.openconcerto.sql.model.FieldMapper;
321
import org.openconcerto.sql.model.SQLDataSource;
332
import org.openconcerto.sql.model.SQLDataSource;
322
import org.openconcerto.sql.model.SQLRow;
333
import org.openconcerto.sql.model.SQLRow;
323
import org.openconcerto.sql.model.SQLServer;
334
import org.openconcerto.sql.model.SQLServer;
324
import org.openconcerto.sql.model.SQLSystem;
335
import org.openconcerto.sql.model.SQLSystem;
325
import org.openconcerto.sql.model.SQLTable;
336
import org.openconcerto.sql.model.SQLTable;
326
import org.openconcerto.sql.preferences.SQLPreferences;
337
import org.openconcerto.sql.preferences.SQLPreferences;
327
import org.openconcerto.task.TacheActionManager;
338
import org.openconcerto.task.TacheActionManager;
328
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
339
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
329
import org.openconcerto.task.element.FWKListPrefs;
340
import org.openconcerto.task.element.FWKListPrefs;
330
import org.openconcerto.task.element.FWKSessionState;
341
import org.openconcerto.task.element.FWKSessionState;
331
import org.openconcerto.utils.BaseDirs;
342
import org.openconcerto.utils.BaseDirs;
332
import org.openconcerto.utils.DesktopEnvironment;
343
import org.openconcerto.utils.DesktopEnvironment;
333
import org.openconcerto.utils.ExceptionHandler;
344
import org.openconcerto.utils.ExceptionHandler;
334
import org.openconcerto.utils.ExceptionUtils;
345
import org.openconcerto.utils.ExceptionUtils;
335
import org.openconcerto.utils.NetUtils;
346
import org.openconcerto.utils.NetUtils;
336
import org.openconcerto.utils.ProductInfo;
347
import org.openconcerto.utils.ProductInfo;
337
import org.openconcerto.utils.StringInputStream;
348
import org.openconcerto.utils.StringInputStream;
338
 
349
 
339
import java.awt.Color;
350
import java.awt.Color;
340
import java.awt.Font;
351
import java.awt.Font;
341
import java.awt.Graphics;
352
import java.awt.Graphics;
342
import java.awt.Graphics2D;
353
import java.awt.Graphics2D;
343
import java.awt.GraphicsEnvironment;
354
import java.awt.GraphicsEnvironment;
344
import java.awt.Image;
355
import java.awt.Image;
345
import java.awt.RenderingHints;
356
import java.awt.RenderingHints;
346
import java.awt.geom.Rectangle2D;
357
import java.awt.geom.Rectangle2D;
347
import java.awt.image.BufferedImage;
358
import java.awt.image.BufferedImage;
348
import java.io.File;
359
import java.io.File;
349
import java.io.FileInputStream;
360
import java.io.FileInputStream;
350
import java.io.IOException;
361
import java.io.IOException;
351
import java.io.InputStream;
362
import java.io.InputStream;
352
import java.sql.SQLException;
363
import java.sql.SQLException;
353
import java.text.DateFormat;
364
import java.text.DateFormat;
354
import java.text.SimpleDateFormat;
365
import java.text.SimpleDateFormat;
355
import java.util.ArrayList;
366
import java.util.ArrayList;
356
import java.util.Arrays;
367
import java.util.Arrays;
357
import java.util.Collection;
368
import java.util.Collection;
358
import java.util.List;
369
import java.util.List;
359
import java.util.Properties;
370
import java.util.Properties;
-
 
371
import java.util.Set;
360
 
372
 
361
import javax.imageio.ImageIO;
373
import javax.imageio.ImageIO;
362
import javax.swing.JFrame;
374
import javax.swing.JFrame;
363
import javax.swing.JOptionPane;
375
import javax.swing.JOptionPane;
364
import javax.swing.SwingUtilities;
376
import javax.swing.SwingUtilities;
365
 
377
 
366
/***************************************************************************************************
378
/***************************************************************************************************
367
 * Configuration de la gestion: Une base commune "Common" --> société, user, tasks. Une base
379
 * Configuration de la gestion: Une base commune "Common" --> société, user, tasks. Une base
368
 * par défaut pour créer une société "Default". Un fichier mapping.xml pour la base commune.
380
 * par défaut pour créer une société "Default". Un fichier mapping.xml pour la base commune.
369
 * Un fichier mappingCompta.xml pour les bases sociétés.
381
 * Un fichier mappingCompta.xml pour les bases sociétés.
370
 **************************************************************************************************/
382
 **************************************************************************************************/
371
// final so we can use setupLogging(), see the constructor comment
383
// final so we can use setupLogging(), see the constructor comment
372
public class ComptaPropsConfiguration extends ComptaBasePropsConfiguration {
384
public class ComptaPropsConfiguration extends ComptaBasePropsConfiguration {
373
 
385
 
374
    public static final ProductInfo productInfo = ProductInfo.getInstance();
386
    public static final ProductInfo productInfo = ProductInfo.getInstance();
375
    public static final String APP_NAME = productInfo.getName();
387
    public static final String APP_NAME = productInfo.getName();
376
    private static final String DEFAULT_ROOT = "Common";
388
    private static final String DEFAULT_ROOT = "Common";
377
 
389
 
378
    static final Properties createDefaults() {
390
    static final Properties createDefaults() {
379
        final Properties defaults = new Properties();
391
        final Properties defaults = new Properties();
380
        defaults.setProperty("base.root", DEFAULT_ROOT);
392
        defaults.setProperty("base.root", DEFAULT_ROOT);
381
        return defaults;
393
        return defaults;
382
    }
394
    }
383
 
395
 
384
    // the properties path from this class
396
    // the properties path from this class
385
    private static final String PROPERTIES = "main.properties";
397
    private static final String PROPERTIES = "main.properties";
386
 
398
 
387
    public static final String DATA_DIR_VAR = "${data.dir}";
399
    public static final String DATA_DIR_VAR = "${data.dir}";
388
 
400
 
389
    protected String version = "";
401
    protected String version = "";
390
    private static OOConnexion conn;
402
    private static OOConnexion conn;
391
 
403
 
392
    public static OOConnexion getOOConnexion() {
404
    public static OOConnexion getOOConnexion() {
393
        if (conn == null || conn.isClosed()) {
405
        if (conn == null || conn.isClosed()) {
394
            try {
406
            try {
395
                conn = OOConnexion.create();
407
                conn = OOConnexion.create();
396
 
408
 
397
                if (conn == null) {
409
                if (conn == null) {
398
                    SwingUtilities.invokeLater(new Runnable() {
410
                    SwingUtilities.invokeLater(new Runnable() {
399
 
411
 
400
                        @Override
412
                        @Override
401
                        public void run() {
413
                        public void run() {
402
                            JOptionPane.showMessageDialog(null, "Impossible de trouver une installation d'OpenOffice sur votre ordinateur.\nMerci d'installer OpenOffice (http://fr.openoffice.org).");
414
                            JOptionPane.showMessageDialog(null, "Impossible de trouver une installation d'OpenOffice sur votre ordinateur.\nMerci d'installer OpenOffice (http://fr.openoffice.org).");
403
                        }
415
                        }
404
                    });
416
                    });
405
                }
417
                }
406
 
418
 
407
            } catch (IllegalStateException e) {
419
            } catch (IllegalStateException e) {
408
                JOptionPane.showMessageDialog(null, "Impossible d'obtenir une connexion avec openoffice. Contactez votre revendeur.");
420
                JOptionPane.showMessageDialog(null, "Impossible d'obtenir une connexion avec openoffice. Contactez votre revendeur.");
409
                e.printStackTrace();
421
                e.printStackTrace();
410
                conn = null;
422
                conn = null;
411
            }
423
            }
412
        }
424
        }
413
 
425
 
414
        return conn;
426
        return conn;
415
    }
427
    }
416
 
428
 
417
    public static void closeOOConnexion() {
429
    public static void closeOOConnexion() {
418
        if (conn != null) {
430
        if (conn != null) {
419
            conn.closeConnexion();
431
            conn.closeConnexion();
420
        }
432
        }
421
    }
433
    }
422
 
434
 
423
    public static ComptaPropsConfiguration create() {
435
    public static ComptaPropsConfiguration create() {
424
        return create(false);
436
        return create(false);
425
    }
437
    }
426
 
438
 
427
    public static ComptaPropsConfiguration create(final boolean nullAllowed) {
439
    public static ComptaPropsConfiguration create(final boolean nullAllowed) {
428
        return create(nullAllowed, getConfFile(productInfo));
440
        return create(nullAllowed, getConfFile(productInfo));
429
    }
441
    }
430
 
442
 
431
    public static ComptaPropsConfiguration create(final boolean nullAllowed, final File confFile) {
443
    public static ComptaPropsConfiguration create(final boolean nullAllowed, final File confFile) {
432
        // Log pour debug demarrage
444
        // Log pour debug demarrage
433
        System.out.println("Loading configuration from: " + (confFile == null ? "null" : confFile.getAbsolutePath()));
445
        System.out.println("Loading configuration from: " + (confFile == null ? "null" : confFile.getAbsolutePath()));
434
        final boolean inWebStart = Gestion.inWebStart();
446
        final boolean inWebStart = Gestion.inWebStart();
435
        final Properties defaults = createDefaults();
447
        final Properties defaults = createDefaults();
436
        // Ordre de recherche:
448
        // Ordre de recherche:
437
        // a/ fichier de configuration
449
        // a/ fichier de configuration
438
        // b/ dans le jar
450
        // b/ dans le jar
439
        try {
451
        try {
440
            final Properties props;
452
            final Properties props;
441
            // webstart should be self-contained, e.g. if a user launches from the web it shoudln't
453
            // webstart should be self-contained, e.g. if a user launches from the web it
-
 
454
            // shoudln't
442
            // read an old preference file but should always read its own configuration.
455
            // read an old preference file but should always read its own configuration.
443
            if (confFile != null && confFile.exists() && !inWebStart) {
456
            if (confFile != null && confFile.exists() && !inWebStart) {
444
                props = create(new FileInputStream(confFile), defaults);
457
                props = create(new FileInputStream(confFile), defaults);
445
            } else {
458
            } else {
446
                final InputStream stream = ComptaPropsConfiguration.class.getResourceAsStream(PROPERTIES);
459
                final InputStream stream = ComptaPropsConfiguration.class.getResourceAsStream(PROPERTIES);
447
                if (stream != null)
460
                if (stream != null)
448
                    props = create(stream, defaults);
461
                    props = create(stream, defaults);
449
                else if (nullAllowed)
462
                else if (nullAllowed)
450
                    return null;
463
                    return null;
451
                else
464
                else
452
                    throw new IOException("found neither " + confFile + " nor embedded " + PROPERTIES);
465
                    throw new IOException("found neither " + confFile + " nor embedded " + PROPERTIES);
453
            }
466
            }
454
            return new ComptaPropsConfiguration(props, inWebStart, true);
467
            return new ComptaPropsConfiguration(props, inWebStart, true);
455
        } catch (final IOException e) {
468
        } catch (final IOException e) {
456
            e.printStackTrace();
469
            e.printStackTrace();
457
            String title = "Logiciel non configuré";
470
            String title = "Logiciel non configuré";
458
            String message = "Impossible de lire le fichier de configuration.\nIl est nécessaire d'utiliser le logiciel de Configuration pour paramétrer le logiciel.";
471
            String message = "Impossible de lire le fichier de configuration.\nIl est nécessaire d'utiliser le logiciel de Configuration pour paramétrer le logiciel.";
459
            JOptionPane.showMessageDialog(new JFrame(), message, title, JOptionPane.ERROR_MESSAGE);
472
            JOptionPane.showMessageDialog(new JFrame(), message, title, JOptionPane.ERROR_MESSAGE);
460
            System.exit(2);
473
            System.exit(2);
461
            // never reached since we're already dead
474
            // never reached since we're already dead
462
            return null;
475
            return null;
463
        }
476
        }
464
 
477
 
465
    }
478
    }
466
 
479
 
467
    // *** instance
480
    // *** instance
468
 
481
 
469
    private final boolean isMain;
482
    private final boolean isMain;
470
    private final boolean inWebstart;
483
    private final boolean inWebstart;
471
    private final boolean isServerless;
484
    private final boolean isServerless;
472
    private boolean isOnCloud;
485
    private boolean isOnCloud;
473
    private boolean isPortable;
486
    private boolean isPortable;
474
    private File portableDir = null;
487
    private File portableDir = null;
475
    private Currency currency = null;
488
    private Currency currency = null;
476
    private final ModuleManager moduleMngr = new ModuleManager();
489
    private final ModuleManager moduleMngr = new ModuleManager();
-
 
490
    private boolean isExperimental;
477
 
491
 
478
    public ComptaPropsConfiguration(Properties props, final ProductInfo productInfo) {
492
    public ComptaPropsConfiguration(Properties props, final ProductInfo productInfo) {
479
        super(props, productInfo);
493
        super(props, productInfo);
480
        this.isServerless = false;
494
        this.isServerless = false;
481
        this.isMain = true;
495
        this.isMain = true;
482
        this.inWebstart = false;
496
        this.inWebstart = false;
483
    }
497
    }
484
 
498
 
485
    // isMain=true also set up some VM wide settings
499
    // isMain=true also set up some VM wide settings
486
    public ComptaPropsConfiguration(Properties props, final boolean inWebstart, final boolean main) {
500
    public ComptaPropsConfiguration(Properties props, final boolean inWebstart, final boolean main) {
487
        super(props, productInfo);
501
        super(props, productInfo);
488
        this.isMain = main;
502
        this.isMain = main;
489
        this.inWebstart = inWebstart;
503
        this.inWebstart = inWebstart;
490
        this.isPortable = Boolean.parseBoolean(this.getProperty("portable", "false"));
504
        this.isPortable = Boolean.parseBoolean(this.getProperty("portable", "false"));
-
 
505
        this.isExperimental = Boolean.parseBoolean(this.getProperty("experimental", "false"));
491
        String pDir = this.getProperty("portableDir", null);
506
        String pDir = this.getProperty("portableDir", null);
492
        if (isPortable) {
507
        if (isPortable) {
493
            if (pDir == null) {
508
            if (pDir == null) {
494
                System.out.println("Portable mode, using current directory");
509
                System.out.println("Portable mode, using current directory");
495
                portableDir = new File(".");
510
                portableDir = new File(".");
496
            } else {
511
            } else {
497
                System.out.println("Portable mode, using provided directory : " + pDir);
512
                System.out.println("Portable mode, using provided directory : " + pDir);
498
                portableDir = new File(pDir);
513
                portableDir = new File(pDir);
499
            }
514
            }
500
            if (!portableDir.exists()) {
515
            if (!portableDir.exists()) {
501
                System.out.println("Error: portable dir missing : " + portableDir);
516
                System.out.println("Error: portable dir missing : " + portableDir);
502
                portableDir = new File(".");
517
                portableDir = new File(".");
503
            }
518
            }
504
            System.out.println("Portable mode in : " + portableDir.getAbsolutePath());
519
            System.out.println("Portable mode in : " + portableDir.getAbsolutePath());
505
            if (this.getProperty("portableDirMessage", "true").equalsIgnoreCase("true")) {
520
            if (this.getProperty("portableDirMessage", "true").equalsIgnoreCase("true")) {
506
                if (!GraphicsEnvironment.isHeadless()) {
521
                if (!GraphicsEnvironment.isHeadless()) {
507
                    System.out.println("Add portableDirMessage=false in your " + PROPERTIES + " to prevent the popup message.");
522
                    System.out.println("Add portableDirMessage=false in your " + PROPERTIES + " to prevent the popup message.");
508
                    JOptionPane.showMessageDialog(null, "Portable version :\n" + portableDir.getAbsolutePath());
523
                    JOptionPane.showMessageDialog(null, "Portable version :\n" + portableDir.getAbsolutePath());
509
                }
524
                }
510
            }
525
            }
511
        }
526
        }
512
        if (isPortable) {
527
        if (isPortable) {
513
            this.setProperty("wd", new File(portableDir, "UserData").getAbsolutePath());
528
            this.setProperty("wd", new File(portableDir, "UserData").getAbsolutePath());
514
        } else {
529
        } else {
515
            this.setProperty("wd", DesktopEnvironment.getDE().getDocumentsFolder().getAbsolutePath() + File.separator + this.getAppName());
530
            this.setProperty("wd", DesktopEnvironment.getDE().getDocumentsFolder().getAbsolutePath() + File.separator + this.getAppName());
516
        }
531
        }
517
        if (this.getProperty("version.date") != null) {
532
        if (this.getProperty("version.date") != null) {
518
            this.version = this.getProperty("version.date");
533
            this.version = this.getProperty("version.date");
519
        }
534
        }
520
 
535
 
521
        //
536
        //
522
        String token = getToken();
537
        String token = getToken();
523
        if (token != null) {
538
        if (token != null) {
524
            this.isServerless = false;
539
            this.isServerless = false;
525
            this.isOnCloud = true;
540
            this.isOnCloud = true;
526
            if (this.getProperty("storage.server") == null) {
541
            if (this.getProperty("storage.server") == null) {
527
                InProgressFrame progress = new InProgressFrame();
542
                InProgressFrame progress = new InProgressFrame();
528
                progress.show("Connexion sécurisée au cloud en cours");
543
                progress.show("Connexion sécurisée au cloud en cours");
529
                String result = NetUtils.getHTTPContent("https://cloud.openconcerto.org/getAuthInfo?token=" + token, false);
544
                String result = NetUtils.getHTTPContent("https://cloud.openconcerto.org/getAuthInfo?token=" + token, false);
530
                if (result != null && !result.contains("ERROR")) {
545
                if (result != null && !result.contains("ERROR")) {
531
                    Properties cProperty = new Properties();
546
                    Properties cProperty = new Properties();
532
                    try {
547
                    try {
533
                        cProperty.loadFromXML(new StringInputStream(result));
548
                        cProperty.loadFromXML(new StringInputStream(result));
534
                        setProperty("server.wan.only", "true");
549
                        setProperty("server.wan.only", "true");
535
                        setProperty("server.wan.port", "22");
550
                        setProperty("server.wan.port", "22");
536
                        // SSH
551
                        // SSH
537
                        setProperty("server.wan.addr", cProperty.getProperty("ssh.server"));
552
                        setProperty("server.wan.addr", cProperty.getProperty("ssh.server"));
538
                        setProperty("server.wan.user", cProperty.getProperty("ssh.login"));
553
                        setProperty("server.wan.user", cProperty.getProperty("ssh.login"));
539
                        setProperty("server.wan.password", cProperty.getProperty("ssh.pass"));
554
                        setProperty("server.wan.password", cProperty.getProperty("ssh.pass"));
540
                        // DB
555
                        // DB
541
                        setProperty("server.ip", "127.0.0.1:5432");
556
                        setProperty("server.ip", "127.0.0.1:5432");
542
                        setProperty("server.driver", "postgresql");
557
                        setProperty("server.driver", "postgresql");
543
                        setProperty("server.login", cProperty.getProperty("db.login"));
558
                        setProperty("server.login", cProperty.getProperty("db.login"));
544
                        setProperty("server.password", cProperty.getProperty("db.pass"));
559
                        setProperty("server.password", cProperty.getProperty("db.pass"));
545
                        setProperty("systemRoot", cProperty.getProperty("db.name"));
560
                        setProperty("systemRoot", cProperty.getProperty("db.name"));
546
                        // Storage
561
                        // Storage
547
                        props.put("storage.server", cProperty.getProperty("storage.server"));
562
                        props.put("storage.server", cProperty.getProperty("storage.server"));
548
 
563
 
549
                    } catch (Exception e) {
564
                    } catch (Exception e) {
550
                        e.printStackTrace();
565
                        e.printStackTrace();
551
                        String s = ExceptionUtils.getStackTrace(e);
566
                        String s = ExceptionUtils.getStackTrace(e);
552
                        JOptionPane.showMessageDialog(new JFrame(),
567
                        JOptionPane.showMessageDialog(new JFrame(),
553
                                "Impossible récupérer les informations de connexion\n" + s + "\ntoken: " + token + "\nr: " + result + "\nMerci de vérifier votre connexion internet.");
568
                                "Impossible récupérer les informations de connexion\n" + s + "\ntoken: " + token + "\nr: " + result + "\nMerci de vérifier votre connexion internet.");
554
                        System.exit(1);
569
                        System.exit(1);
555
                    }
570
                    }
556
 
571
 
557
                } else if (result != null && result.contains("not paid")) {
572
                } else if (result != null && result.contains("not paid")) {
558
                    JOptionPane.showMessageDialog(new JFrame(), "Compte Cloud non crédité");
573
                    JOptionPane.showMessageDialog(new JFrame(), "Compte Cloud non crédité");
559
                    System.exit(1);
574
                    System.exit(1);
560
                } else {
575
                } else {
561
                    JOptionPane.showMessageDialog(new JFrame(), "Connexion impossible au Cloud");
576
                    JOptionPane.showMessageDialog(new JFrame(), "Connexion impossible au Cloud");
562
                    System.exit(1);
577
                    System.exit(1);
563
                }
578
                }
564
                progress.dispose();
579
                progress.dispose();
565
            }
580
            }
566
            StorageEngines.getInstance().addEngine(new CloudStorageEngine());
581
            StorageEngines.getInstance().addEngine(new CloudStorageEngine());
567
        } else {
582
        } else {
568
            // FIXME
583
            // FIXME
569
            // Local database
584
            // Local database
570
            {
585
            {
571
                if (getProperty("server.login") == null) {
586
                if (getProperty("server.login") == null) {
572
                    setProperty("server.login", "openconcerto");
587
                    setProperty("server.login", "openconcerto");
573
                }
588
                }
574
                if (getProperty("server.password") == null) {
589
                if (getProperty("server.password") == null) {
575
                    setProperty("server.password", "openconcerto");
590
                    setProperty("server.password", "openconcerto");
576
                }
591
                }
577
            }
592
            }
578
            this.setProperty("server.ip", getProperty("server.ip").replace(DATA_DIR_VAR, getDataDir().getPath()));
593
            this.setProperty("server.ip", getProperty("server.ip").replace(DATA_DIR_VAR, getDataDir().getPath()));
579
            final SQLSystem system = getSystem();
594
            final SQLSystem system = getSystem();
580
            this.isServerless = system == SQLSystem.H2 && system.getHostname(getServerIp()) == null;
595
            this.isServerless = system == SQLSystem.H2 && system.getHostnameAndPath(getServerIp()).get0() == null;
581
        }
596
        }
582
        if (this.isMain) {
597
        if (this.isMain) {
583
            // ATTN this works because this is executed last (i.e. if you put this in a superclass
598
            // ATTN this works because this is executed last (i.e. if you put this in a
-
 
599
            // superclass
584
            // this won't work since e.g. app.name won't have its correct value)
600
            // this won't work since e.g. app.name won't have its correct value)
585
            try {
601
            try {
586
                this.setupLogging("logs");
602
                this.setupLogging("logs");
587
            } catch (Exception e) {
603
            } catch (Exception e) {
588
                System.err.println("ComptaPropsConfiguration() error in log setup : " + e.getMessage());
604
                System.err.println("ComptaPropsConfiguration() error in log setup : " + e.getMessage());
589
            }
605
            }
590
            registerAccountingProvider();
606
            registerAccountingProvider();
591
            registerCellValueProvider();
607
            registerCellValueProvider();
592
        }
608
        }
-
 
609
 
-
 
610
        // Early so that other apps may add jars before setUpSocieteDataBaseConnexion()
-
 
611
        // Perhaps add a folder relative to VMLauncher.getJPackageAppDir()
-
 
612
        this.getModuleManager().setFolders(new File(Gestion.MODULES_DIR_NAME), new File(this.getBaseDirs().getAppDataFolder(), Gestion.MODULES_DIR_NAME));
593
    }
613
    }
594
 
614
 
595
    public final TM getERP_TM() {
615
    public final TM getERP_TM() {
596
        return TM.getERP_TM(this.getLocale());
616
        return TM.getERP_TM(this.getLocale());
597
    }
617
    }
598
 
618
 
599
    private void registerAccountingProvider() {
619
    private void registerAccountingProvider() {
600
        SalesInvoiceAccountingRecordsProvider.register();
620
        SalesInvoiceAccountingRecordsProvider.register();
601
        SalesCreditAccountingRecordsProvider.register();
621
        SalesCreditAccountingRecordsProvider.register();
602
        SupplyOrderAccountingRecordsProvider.register();
622
        SupplyOrderAccountingRecordsProvider.register();
603
    }
623
    }
604
 
624
 
605
    private void registerCellValueProvider() {
625
    private void registerCellValueProvider() {
606
        UserCreateInitialsValueProvider.register();
626
        UserCreateInitialsValueProvider.register();
607
        UserModifyInitialsValueProvider.register();
627
        UserModifyInitialsValueProvider.register();
608
        UserCurrentInitialsValueProvider.register();
628
        UserCurrentInitialsValueProvider.register();
609
        PrixUnitaireRemiseProvider.register();
629
        PrixUnitaireRemiseProvider.register();
610
        PrixUnitaireProvider.register();
630
        PrixUnitaireProvider.register();
611
        PrixUVProvider.register();
631
        PrixUVProvider.register();
612
        TotalAcompteProvider.register();
632
        TotalAcompteProvider.register();
613
        ArticleCodeClientProvider.register();
633
        ArticleCodeClientProvider.register();
614
        ConditionsReglementDetailsProvider.register();
634
        ConditionsReglementDetailsProvider.register();
615
        FacturableValueProvider.register();
635
        FacturableValueProvider.register();
616
        TotalCommandeClientProvider.register();
636
        TotalCommandeClientProvider.register();
617
        LabelAccountInvoiceProvider.register();
637
        LabelAccountInvoiceProvider.register();
618
        DateBLProvider.register();
638
        DateBLProvider.register();
619
        AdresseRueClientValueProvider.register();
639
        AdresseRueClientValueProvider.register();
620
        AdresseVilleClientValueProvider.register();
640
        AdresseVilleClientValueProvider.register();
621
        AdresseVilleCPClientValueProvider.register();
641
        AdresseVilleCPClientValueProvider.register();
622
        AdresseVilleNomClientValueProvider.register();
642
        AdresseVilleNomClientValueProvider.register();
623
        AdresseFullClientValueProvider.register();
643
        AdresseFullClientValueProvider.register();
624
        QteTotalProvider.register();
644
        QteTotalProvider.register();
-
 
645
        QteLineDocProvider.register();
-
 
646
        QteTotalLineDocProvider.register();
625
        QteTotalDocProvider.register();
647
        QteTotalDocProvider.register();
626
        StockLocationProvider.register();
648
        StockLocationProvider.register();
627
        RefClientValueProvider.register();
649
        RefClientValueProvider.register();
628
        ModeDeReglementDetailsProvider.register();
650
        ModeDeReglementDetailsProvider.register();
629
        FormatedGlobalQtyTotalProvider.register();
651
        FormatedGlobalQtyTotalProvider.register();
630
        FichePayeHeureSupTotalProvider.register();
652
        FichePayeHeureSupTotalProvider.register();
631
        FichePayeHeureTotalProvider.register();
653
        FichePayeHeureTotalProvider.register();
632
        FichePayePlafondAProvider.register();
654
        FichePayePlafondAProvider.register();
633
        FichePayeSmicHProvider.register();
655
        FichePayeSmicHProvider.register();
634
        MergedGlobalQtyTotalProvider.register();
656
        MergedGlobalQtyTotalProvider.register();
635
        PaiementRemainedProvider.register();
657
        PaiementRemainedProvider.register();
636
        PaiementRemainedDevisProvider.register();
658
        PaiementRemainedDevisProvider.register();
637
        RemiseProvider.register();
659
        RemiseProvider.register();
638
        DateProvider.register();
660
        DateProvider.register();
639
        RemiseTotalProvider.register();
661
        RemiseTotalProvider.register();
640
        RecapFactureProvider.register();
662
        RecapFactureProvider.register();
641
        RestantAReglerProvider.register();
663
        RestantAReglerProvider.register();
642
        SaledTotalNotDiscountedProvider.register();
664
        SaledTotalNotDiscountedProvider.register();
643
        ArticleCodeFournisseurProvider.register();
665
        ArticleCodeFournisseurProvider.register();
644
        IbanProvider.register();
666
        IbanProvider.register();
645
    }
667
    }
646
 
668
 
647
    @Override
669
    @Override
648
    protected void initDS(SQLDataSource ds) {
670
    protected void initDS(SQLDataSource ds) {
649
        super.initDS(ds);
671
        super.initDS(ds);
650
        ds.setInitialSize(3);
672
        ds.setInitialSize(3);
651
        ds.setMinIdle(2);
673
        ds.setMinIdle(2);
652
        ds.setMaxActive(4);
674
        ds.setMaxActive(4);
653
        ds.setMaxWait(30000);
675
        ds.setMaxWait(30000);
654
    }
676
    }
655
 
677
 
656
    public String getToken() {
678
    public String getToken() {
657
        return getProperty("token");
679
        return getProperty("token");
658
    }
680
    }
659
 
681
 
-
 
682
    public boolean isExperimental() {
-
 
683
        return isExperimental;
-
 
684
    }
-
 
685
 
660
    public final boolean isServerless() {
686
    public final boolean isServerless() {
661
        return this.isServerless;
687
        return this.isServerless;
662
    }
688
    }
663
 
689
 
664
    public final boolean isOnCloud() {
690
    public final boolean isOnCloud() {
665
        return this.isOnCloud;
691
        return this.isOnCloud;
666
    }
692
    }
667
 
693
 
668
    public final String getVersion() {
694
    public final String getVersion() {
669
        return this.version;
695
        return this.version;
670
    }
696
    }
671
 
697
 
672
    @Override
698
    @Override
673
    public String getAppVariant() {
699
    public String getAppVariant() {
674
        if (inWebstart())
700
        if (inWebstart())
675
            // so we don't remove files of a normal GestionNX
701
            // so we don't remove files of a normal GestionNX
676
            return super.getAppVariant() + "-webstart";
702
            return super.getAppVariant() + "-webstart";
677
        else
703
        else
678
            return super.getAppVariant();
704
            return super.getAppVariant();
679
    }
705
    }
680
 
706
 
681
    @Override
707
    @Override
682
    protected BaseDirs createBaseDirs() {
708
    protected BaseDirs createBaseDirs() {
683
        if (isPortable()) {
709
        if (isPortable()) {
684
            return BaseDirs.createPortable(getPortableDir(), this.getProductInfo(), this.getAppVariant());
710
            return BaseDirs.createPortable(getPortableDir(), this.getProductInfo(), this.getAppVariant());
685
        } else {
711
        } else {
686
            return super.createBaseDirs();
712
            return super.createBaseDirs();
687
        }
713
        }
688
    }
714
    }
689
 
715
 
690
    @Override
716
    @Override
691
    protected final File getOldConfDir() {
717
    protected final File getOldConfDir() {
692
        if (isPortable) {
718
        if (isPortable) {
693
            return getWD();
719
            return getWD();
694
        } else {
720
        } else {
695
            return Gestion.MAC_OS_X ? new File(System.getProperty("user.home") + "/Library/Application Support/" + getAppID()) : super.getOldConfDir();
721
            return Gestion.MAC_OS_X ? new File(System.getProperty("user.home") + "/Library/Application Support/" + getAppID()) : super.getOldConfDir();
696
        }
722
        }
697
    }
723
    }
698
 
724
 
699
    public boolean isPortable() {
725
    public boolean isPortable() {
700
        return isPortable;
726
        return isPortable;
701
    }
727
    }
702
 
728
 
703
    public File getPortableDir() {
729
    public File getPortableDir() {
704
        return portableDir;
730
        return portableDir;
705
    }
731
    }
706
 
732
 
707
    private boolean inWebstart() {
733
    private boolean inWebstart() {
708
        return this.inWebstart;
734
        return this.inWebstart;
709
    }
735
    }
710
 
736
 
711
    @Deprecated
737
    @Deprecated
712
    public File getOldDataDir() {
738
    public File getOldDataDir() {
713
        return new File(this.getOldConfDir(), "DBData");
739
        return new File(this.getOldConfDir(), "DBData");
714
    }
740
    }
715
 
741
 
716
    public File getDataDir() {
742
    public File getDataDir() {
717
        return new File(this.getBaseDirs().getAppDataFolder(), "DBData");
743
        return new File(this.getBaseDirs().getAppDataFolder(), "DBData");
718
    }
744
    }
719
 
745
 
720
    private final void createDB(final DBSystemRoot sysRoot) {
746
    private final void createDB(final DBSystemRoot sysRoot) {
721
        if (!this.isServerless())
747
        if (!this.isServerless())
722
            return;
748
            return;
723
        try {
749
        try {
724
            // H2 create the database on connection
750
            // H2 create the database on connection
725
            // don't create if root explicitly excluded (e.g. map no roots just to quickly test
751
            // don't create if root explicitly excluded (e.g. map no roots just to quickly
-
 
752
            // test
726
            // connection)
753
            // connection)
727
            if (sysRoot.shouldMap(getRootName()) && !sysRoot.contains(getRootName())) {
754
            if (sysRoot.shouldMap(getRootName()) && !sysRoot.contains(getRootName())) {
728
                Log.get().warning("Creating DB");
755
                Log.get().warning("Creating DB");
729
                String createScript = null;
756
                String createScript = null;
730
                try {
757
                try {
731
                    createScript = this.getResource("/webstart/create.sql");
758
                    createScript = this.getResource("/webstart/create.sql");
732
                } catch (Exception e) {
759
                } catch (Exception e) {
733
                    e.printStackTrace();
760
                    e.printStackTrace();
734
                }
761
                }
735
                if (createScript == null)
762
                if (createScript == null)
736
                    throw new IllegalStateException("Couldn't find database creation script");
763
                    throw new IllegalStateException("Couldn't find database creation script");
737
                final SQLDataSource ds = sysRoot.getDataSource();
764
                final SQLDataSource ds = sysRoot.getDataSource();
738
                ds.execute("RUNSCRIPT from '" + createScript + "' CHARSET 'UTF-8' ;");
765
                ds.execute("RUNSCRIPT from '" + createScript + "' CHARSET 'UTF-8' ;");
739
                sysRoot.refetch();
766
                sysRoot.refetch();
740
                this.setupSystemRoot(sysRoot);
767
                this.setupSystemRoot(sysRoot);
741
            }
768
            }
742
        } catch (RuntimeException e) {
769
        } catch (RuntimeException e) {
743
            throw e;
770
            throw e;
744
        } catch (Exception e) {
771
        } catch (Exception e) {
745
            throw new IllegalStateException("Couldn't create database", e);
772
            throw new IllegalStateException("Couldn't create database", e);
746
        }
773
        }
747
    }
774
    }
748
 
775
 
749
    @Override
776
    @Override
750
    protected DBSystemRoot createSystemRoot() {
777
    protected DBSystemRoot createSystemRoot() {
751
        final DBSystemRoot res = super.createSystemRoot();
778
        final DBSystemRoot res = super.createSystemRoot();
752
        // Don't create a separate server for createDB() as on normal databases just setting up a
779
        // Don't create a separate server for createDB() as on normal databases just
-
 
780
        // setting up a
753
        // data source can take 2 seconds (e.g. validateConnectionFactory()). And this is for every
781
        // data source can take 2 seconds (e.g. validateConnectionFactory()). And this
-
 
782
        // is for every
754
        // boot.
783
        // boot.
755
        this.createDB(res);
784
        this.createDB(res);
756
        return res;
785
        return res;
757
    }
786
    }
758
 
787
 
759
    @Override
788
    @Override
760
    public String getDefaultBase() {
789
    public String getDefaultBase() {
761
        return super.getDefaultBase();
790
        return super.getDefaultBase();
762
 
791
 
763
    }
792
    }
764
 
793
 
765
    @Override
794
    @Override
766
    protected SQLElementDirectory createDirectory() {
795
    protected SQLElementDirectory createDirectory() {
767
        final SQLElementDirectory dir = super.createDirectory();
796
        final SQLElementDirectory dir = super.createDirectory();
768
        final DBRoot root = getRoot();
797
        final DBRoot root = getRoot();
769
        dir.addSQLElement(new AdresseCommonSQLElement(root));
798
        dir.addSQLElement(new AdresseCommonSQLElement(root));
770
        dir.addSQLElement(new ExerciceCommonSQLElement(root));
799
        dir.addSQLElement(new ExerciceCommonSQLElement(root));
771
        dir.addSQLElement(DeviseSQLElement.class, root);
800
        dir.addSQLElement(DeviseSQLElement.class, root);
772
        dir.addSQLElement(TypeModeleSQLElement.class, root);
801
        dir.addSQLElement(TypeModeleSQLElement.class, root);
773
        dir.addSQLElement(new SocieteCommonSQLElement(root));
802
        dir.addSQLElement(new SocieteCommonSQLElement(root));
774
 
803
 
775
        // DSN
804
        // DSN
776
        dir.addSQLElement(CaisseCotisationRenseignentSQLElement.class, root);
805
        dir.addSQLElement(CaisseCotisationRenseignentSQLElement.class, root);
777
        dir.addSQLElement(CodeBaseAssujettieSQLElement.class, root);
806
        dir.addSQLElement(CodeBaseAssujettieSQLElement.class, root);
778
        dir.addSQLElement(ContratModaliteTempsSQLElement.class, root);
807
        dir.addSQLElement(ContratModaliteTempsSQLElement.class, root);
779
        dir.addSQLElement(CodeCaisseTypeRubriqueSQLElement.class, root);
808
        dir.addSQLElement(CodeCaisseTypeRubriqueSQLElement.class, root);
-
 
809
        dir.addSQLElement(CodeCaisseCongesPayesSQLElement.class, root);
-
 
810
        dir.addSQLElement(MotifNonAssujettisTASQLElement.class, root);
780
        dir.addSQLElement(CodeTypeRubriqueBrutSQLElement.class, root);
811
        dir.addSQLElement(CodeTypeRubriqueBrutSQLElement.class, root);
781
        dir.addSQLElement(MotifArretTravailSQLElement.class, root);
812
        dir.addSQLElement(MotifArretTravailSQLElement.class, root);
782
        dir.addSQLElement(ContratDispositifPolitiqueSQLElement.class, root);
813
        dir.addSQLElement(ContratDispositifPolitiqueSQLElement.class, root);
783
        dir.addSQLElement(ContratDetacheExpatrieSQLElement.class, root);
814
        dir.addSQLElement(ContratDetacheExpatrieSQLElement.class, root);
784
        dir.addSQLElement(ContratRegimeMaladieSQLElement.class, root);
815
        dir.addSQLElement(ContratRegimeMaladieSQLElement.class, root);
785
        dir.addSQLElement(ContratMotifRecoursSQLElement.class, root);
816
        dir.addSQLElement(ContratMotifRecoursSQLElement.class, root);
786
        dir.addSQLElement(ContratRegimeVieillesseSQLElement.class, root);
817
        dir.addSQLElement(ContratRegimeVieillesseSQLElement.class, root);
787
        dir.addSQLElement(MotifFinContratSQLElement.class, root);
818
        dir.addSQLElement(MotifFinContratSQLElement.class, root);
788
        dir.addSQLElement(MotifRepriseArretTravailSQLElement.class, root);
819
        dir.addSQLElement(MotifRepriseArretTravailSQLElement.class, root);
789
        dir.addSQLElement(TypePreavisSQLElement.class, root);
820
        dir.addSQLElement(TypePreavisSQLElement.class, root);
790
        dir.addSQLElement(DSNNatureSQLElement.class, root);
821
        dir.addSQLElement(DSNNatureSQLElement.class, root);
791
        dir.addSQLElement(TypeTauxPasSQLElement.class, root);
822
        dir.addSQLElement(TypeTauxPasSQLElement.class, root);
792
        dir.addSQLElement(CodeAmenagementPartielSQLElement.class, root);
823
        dir.addSQLElement(CodeAmenagementPartielSQLElement.class, root);
793
        dir.addSQLElement(CodeSuspensionSQLElement.class, root);
824
        dir.addSQLElement(CodeSuspensionSQLElement.class, root);
794
        dir.addSQLElement(DiplomePrepareSQLElement.class, root);
825
        dir.addSQLElement(DiplomePrepareSQLElement.class, root);
795
 
826
 
796
        // ECO
827
        // ECO
797
        dir.addSQLElement(FamilleEcoContributionSQLElement.class, root);
828
        dir.addSQLElement(FamilleEcoContributionSQLElement.class, root);
798
        dir.addSQLElement(EcoContributionSQLElement.class, root);
829
        dir.addSQLElement(EcoContributionSQLElement.class, root);
799
 
830
 
800
        dir.addSQLElement(new RubriqueCotisationSQLElement(root));
831
        dir.addSQLElement(new RubriqueCotisationSQLElement(root));
801
        dir.addSQLElement(new RubriqueCommSQLElement(root));
832
        dir.addSQLElement(new RubriqueCommSQLElement(root));
802
        dir.addSQLElement(new RubriqueNetSQLElement(root));
833
        dir.addSQLElement(new RubriqueNetSQLElement(root));
803
        dir.addSQLElement(new RubriqueBrutSQLElement(root));
834
        dir.addSQLElement(new RubriqueBrutSQLElement(root));
804
 
835
 
805
        dir.addSQLElement(new CaisseCotisationSQLElement(root));
836
        dir.addSQLElement(new CaisseCotisationSQLElement(root));
806
        dir.addSQLElement(new ProfilPayeSQLElement(root));
837
        dir.addSQLElement(new ProfilPayeSQLElement(root));
807
        dir.addSQLElement(new ProfilPayeElementSQLElement(root));
838
        dir.addSQLElement(new ProfilPayeElementSQLElement(root));
808
        dir.addSQLElement(new PeriodeValiditeSQLElement(root));
839
        dir.addSQLElement(new PeriodeValiditeSQLElement(root));
809
 
840
 
810
        dir.addSQLElement(new TypeRubriqueBrutSQLElement(root));
841
        dir.addSQLElement(new TypeRubriqueBrutSQLElement(root));
811
        dir.addSQLElement(new TypeRubriqueNetSQLElement(root));
842
        dir.addSQLElement(new TypeRubriqueNetSQLElement(root));
812
 
843
 
813
        dir.addSQLElement(AyantDroitTypeSQLElement.class, root);
844
        dir.addSQLElement(AyantDroitTypeSQLElement.class, root);
814
        dir.addSQLElement(TypeComposantBaseAssujettieSQLElement.class, root);
845
        dir.addSQLElement(TypeComposantBaseAssujettieSQLElement.class, root);
815
        dir.addSQLElement(CaisseModePaiementSQLElement.class, root);
846
        dir.addSQLElement(CaisseModePaiementSQLElement.class, root);
816
        dir.addSQLElement(CodeCotisationIndividuelleSQLElement.class, root);
847
        dir.addSQLElement(CodeCotisationIndividuelleSQLElement.class, root);
817
        dir.addSQLElement(CodeCotisationEtablissementSQLElement.class, root);
848
        dir.addSQLElement(CodeCotisationEtablissementSQLElement.class, root);
818
        dir.addSQLElement(CodePenibiliteSQLElement.class, root);
849
        dir.addSQLElement(CodePenibiliteSQLElement.class, root);
-
 
850
        dir.addSQLElement(CodeIdccSQLElement.class, root);
-
 
851
 
819
        dir.addSQLElement(new ImpressionRubriqueSQLElement(root));
852
        dir.addSQLElement(new ImpressionRubriqueSQLElement(root));
820
 
853
 
821
        dir.addSQLElement(new VariablePayeSQLElement(root));
854
        dir.addSQLElement(new VariablePayeSQLElement(root));
822
 
855
 
823
        return dir;
856
        return dir;
824
    }
857
    }
825
 
858
 
826
    private void setSocieteDirectory() {
859
    private void setSocieteDirectory() {
827
        try {
860
        try {
828
            // Check 1.5.3 updated
861
            // Check 1.5.3 updated
829
            if (!this.getRootSociete().getTable("SAISIE_VENTE_FACTURE").contains("T_ACOMPTE")) {
862
            if (!this.getRootSociete().getTable("SAISIE_VENTE_FACTURE").contains("T_ACOMPTE")) {
830
                throw new DBStructureItemNotFound("Base de données non à jour");
863
                throw new DBStructureItemNotFound("Base de données non à jour");
831
            }
864
            }
832
            // Check 1.6 updated
865
            // Check 1.6 updated
833
            if (!this.getRootSociete().contains("ETAT_STOCK")) {
866
            if (!this.getRootSociete().contains("ETAT_STOCK")) {
834
                throw new DBStructureItemNotFound("Base de données non à jour");
867
                throw new DBStructureItemNotFound("Base de données non à jour (<1.6)");
-
 
868
            }
-
 
869
            // Check 1.7 updated
-
 
870
            if (!this.getRootSociete().contains("AGENCE")) {
-
 
871
                throw new DBStructureItemNotFound("Base de données non à jour (< 1.7.0)");
-
 
872
            }
-
 
873
            if (!this.getRootSociete().getTable("NUMEROTATION_AUTO").contains("ARTICLE_FORMAT")) {
-
 
874
                throw new DBStructureItemNotFound("Base de données non à jour (< 1.7.1)");
835
            }
875
            }
836
            SQLElementDirectory dir = this.getDirectory();
876
            SQLElementDirectory dir = this.getDirectory();
837
 
877
 
838
            dir.addSQLElement(AttachmentSQLElement.class);
878
            dir.addSQLElement(AttachmentSQLElement.class);
839
 
879
 
840
            dir.addSQLElement(CustomerProductQtyPriceSQLElement.class);
880
            dir.addSQLElement(CustomerProductQtyPriceSQLElement.class);
841
            dir.addSQLElement(CustomerProductFamilyQtyPriceSQLElement.class);
881
            dir.addSQLElement(CustomerProductFamilyQtyPriceSQLElement.class);
842
            dir.addSQLElement(EtatStockSQLElement.class);
882
            dir.addSQLElement(EtatStockSQLElement.class);
843
            dir.addSQLElement(EtatStockItemSQLElement.class);
883
            dir.addSQLElement(EtatStockItemSQLElement.class);
844
            dir.addSQLElement(ArticleTarifSQLElement.class);
884
            dir.addSQLElement(ArticleTarifSQLElement.class);
845
            dir.addSQLElement(CoutRevientSQLElement.class);
885
            dir.addSQLElement(CoutRevientSQLElement.class);
846
            dir.addSQLElement(ReliquatBRSQLElement.class);
886
            dir.addSQLElement(ReliquatBRSQLElement.class);
847
            dir.addSQLElement(ReliquatSQLElement.class);
887
            dir.addSQLElement(ReliquatSQLElement.class);
848
            dir.addSQLElement(ProductQtyPriceSQLElement.class);
888
            dir.addSQLElement(ProductQtyPriceSQLElement.class);
849
            dir.addSQLElement(ProductItemSQLElement.class);
889
            dir.addSQLElement(ProductItemSQLElement.class);
850
            dir.addSQLElement(CategorieComptableSQLElement.class);
890
            dir.addSQLElement(CategorieComptableSQLElement.class);
851
            dir.addSQLElement(ArticleCatComptableSQLElement.class);
891
            dir.addSQLElement(ArticleCatComptableSQLElement.class);
-
 
892
            dir.addSQLElement(TaxeCatComptableSQLElement.class);
852
            dir.addSQLElement(ArticleFournisseurSecondaireSQLElement.class);
893
            dir.addSQLElement(ArticleFournisseurSecondaireSQLElement.class);
853
            dir.addSQLElement(SupplierPriceListSQLElement.class);
894
            dir.addSQLElement(SupplierPriceListSQLElement.class);
854
            dir.addSQLElement(FraisDocumentSQLElement.class);
895
            dir.addSQLElement(FraisDocumentSQLElement.class);
855
            dir.addSQLElement(ArticleDesignationSQLElement.class);
896
            dir.addSQLElement(ArticleDesignationSQLElement.class);
856
            dir.addSQLElement(BanqueSQLElement.class);
897
            dir.addSQLElement(BanqueSQLElement.class);
857
            dir.addSQLElement(ClientDepartementSQLElement.class);
898
            dir.addSQLElement(ClientDepartementSQLElement.class);
858
            dir.addSQLElement(CoefficientPrimeSQLElement.class);
899
            dir.addSQLElement(CoefficientPrimeSQLElement.class);
859
            dir.addSQLElement(ContactFournisseurSQLElement.class);
900
            dir.addSQLElement(ContactFournisseurSQLElement.class);
860
            dir.addSQLElement(ContactAdministratifSQLElement.class);
901
            dir.addSQLElement(ContactAdministratifSQLElement.class);
861
            dir.addSQLElement(ContactSalarieSQLElement.class);
902
            dir.addSQLElement(ContactSalarieSQLElement.class);
862
            dir.addSQLElement(new TitrePersonnelSQLElement());
903
            dir.addSQLElement(new TitrePersonnelSQLElement());
863
            dir.addSQLElement(new ContactSQLElement());
904
            dir.addSQLElement(new ContactSQLElement());
864
            dir.addSQLElement(new AgenceSQLElement(this.getRootSociete()));
905
            dir.addSQLElement(new AgenceSQLElement(this.getRootSociete()));
865
            dir.addSQLElement(new SaisieKmItemSQLElement());
906
            dir.addSQLElement(new SaisieKmItemSQLElement());
866
            dir.addSQLElement(new EcritureSQLElement());
907
            dir.addSQLElement(new EcritureSQLElement());
867
 
908
 
868
            dir.addSQLElement(new SharedSQLElement(this, "EMPLOYEUR_MULTIPLE", "humanresources.multipleEmployer"));
909
            dir.addSQLElement(new SharedSQLElement(this, "EMPLOYEUR_MULTIPLE", "humanresources.multipleEmployer"));
869
            dir.addSQLElement(PosteAnalytiqueSQLElement.class);
910
            dir.addSQLElement(PosteAnalytiqueSQLElement.class);
870
            dir.addSQLElement(new SharedSQLElement(this, "CLASSE_COMPTE", "finance.accounting.accountClass"));
911
            dir.addSQLElement(new SharedSQLElement(this, "CLASSE_COMPTE", "finance.accounting.accountClass"));
871
 
912
 
872
            dir.addSQLElement(CaisseTicketSQLElement.class);
913
            dir.addSQLElement(CaisseTicketSQLElement.class);
873
 
914
 
874
            dir.addSQLElement(ModeleSQLElement.class);
915
            dir.addSQLElement(ModeleSQLElement.class);
875
 
916
 
876
            dir.addSQLElement(new AdresseSQLElement());
917
            dir.addSQLElement(new AdresseSQLElement());
877
            dir.addSQLElement(ArticleCodeClientSQLElement.class);
918
            dir.addSQLElement(ArticleCodeClientSQLElement.class);
878
            dir.addSQLElement(ReferenceArticleSQLElement.class);
919
            dir.addSQLElement(ReferenceArticleSQLElement.class);
879
            dir.addSQLElement(ArticleFournisseurSQLElement.class);
920
            dir.addSQLElement(ArticleFournisseurSQLElement.class);
880
            dir.addSQLElement(FamilleArticleFounisseurSQLElement.class);
921
            dir.addSQLElement(FamilleArticleFounisseurSQLElement.class);
881
 
922
 
882
            dir.addSQLElement(new AssociationCompteAnalytiqueSQLElement());
923
            dir.addSQLElement(new AssociationCompteAnalytiqueSQLElement());
883
            dir.addSQLElement(new AvoirClientSQLElement());
924
            dir.addSQLElement(new AvoirClientSQLElement());
884
            dir.addSQLElement(new AvoirClientElementSQLElement());
925
            dir.addSQLElement(new AvoirClientElementSQLElement());
885
            dir.addSQLElement(AvoirFournisseurSQLElement.class);
926
            dir.addSQLElement(AvoirFournisseurSQLElement.class);
886
            dir.addSQLElement(new AcompteSQLElement());
927
            dir.addSQLElement(new AcompteSQLElement());
887
 
928
 
888
            dir.addSQLElement(new AxeAnalytiqueSQLElement());
929
            dir.addSQLElement(new AxeAnalytiqueSQLElement());
-
 
930
            Set<SQLTable> tablesInRoot = dir.getElement(ReferenceArticleSQLElement.class).getTable().getDBRoot().getTables();
-
 
931
            for (SQLTable table : tablesInRoot) {
-
 
932
                if (table.getName().startsWith("ARTICLE_DECLINAISON_")) {
-
 
933
                    dir.addSQLElement(new ArticleDeclinaisonSQLElement(table.getName()));
-
 
934
                }
-
 
935
            }
889
 
936
 
-
 
937
            dir.addSQLElement(LotSQLElement.class);
890
            dir.addSQLElement(new BonDeLivraisonItemSQLElement());
938
            dir.addSQLElement(new BonDeLivraisonItemSQLElement());
891
            dir.addSQLElement(new BonDeLivraisonSQLElement());
939
            dir.addSQLElement(new BonDeLivraisonSQLElement());
892
            dir.addSQLElement(new TransferShipmentSQLElement());
940
            dir.addSQLElement(new TransferShipmentSQLElement());
893
 
941
 
894
            dir.addSQLElement(new BonReceptionElementSQLElement());
942
            dir.addSQLElement(new BonReceptionElementSQLElement());
895
            dir.addSQLElement(new BonReceptionSQLElement());
943
            dir.addSQLElement(new BonReceptionSQLElement());
896
            dir.addSQLElement(new TransferReceiptSQLElement());
944
            dir.addSQLElement(new TransferReceiptSQLElement());
897
            dir.addSQLElement(new ChequeAEncaisserSQLElement());
945
            dir.addSQLElement(new ChequeAEncaisserSQLElement());
898
            dir.addSQLElement(DepotChequeSQLElement.class);
946
            dir.addSQLElement(DepotChequeSQLElement.class);
899
            dir.addSQLElement(DepotChequeElementSQLElement.class);
947
            dir.addSQLElement(DepotChequeElementSQLElement.class);
900
            dir.addSQLElement(new ChequeAvoirClientSQLElement());
948
            dir.addSQLElement(new ChequeAvoirClientSQLElement());
901
            dir.addSQLElement(new ChequeFournisseurSQLElement());
949
            dir.addSQLElement(new ChequeFournisseurSQLElement());
902
                dir.addSQLElement(new CustomerCategorySQLElement());
950
                dir.addSQLElement(new CustomerCategorySQLElement());
903
                dir.addSQLElement(new CustomerSQLElement());
951
                dir.addSQLElement(new CustomerSQLElement());
904
                dir.addSQLElement(new CompteClientTransactionSQLELement());
952
                dir.addSQLElement(new CompteClientTransactionSQLELement());
905
            dir.addSQLElement(new CourrierClientSQLElement());
953
            dir.addSQLElement(new CourrierClientSQLElement());
906
 
954
 
907
            dir.addSQLElement(new ClassementConventionnelSQLElement());
955
            dir.addSQLElement(new ClassementConventionnelSQLElement());
908
            dir.addSQLElement(CodeFournisseurSQLElement.class);
956
            dir.addSQLElement(CodeFournisseurSQLElement.class);
909
            dir.addSQLElement(new CommandeSQLElement());
957
            dir.addSQLElement(new CommandeSQLElement());
910
            dir.addSQLElement(new TransferSupplierOrderSQLElement());
958
            dir.addSQLElement(new TransferSupplierOrderSQLElement());
911
            dir.addSQLElement(new CommandeElementSQLElement());
959
            dir.addSQLElement(new CommandeElementSQLElement());
912
            dir.addSQLElement(new TransferCustomerOrderSQLElement());
960
            dir.addSQLElement(new TransferCustomerOrderSQLElement());
913
            dir.addSQLElement(new CommandeClientSQLElement());
961
            dir.addSQLElement(new CommandeClientSQLElement());
914
            dir.addSQLElement(FacturationCommandeClientSQLElement.class);
962
            dir.addSQLElement(FacturationCommandeClientSQLElement.class);
915
            dir.addSQLElement(new CommandeClientElementSQLElement());
963
            dir.addSQLElement(new CommandeClientElementSQLElement());
916
 
964
 
917
            dir.addSQLElement(DemandeAchatItemSQLElement.class);
965
            dir.addSQLElement(DemandeAchatItemSQLElement.class);
918
            dir.addSQLElement(EtatDemandeAchatItemSQLElement.class);
966
            dir.addSQLElement(EtatDemandeAchatItemSQLElement.class);
919
            dir.addSQLElement(EtatDemandePrixSQLElement.class);
967
            dir.addSQLElement(EtatDemandePrixSQLElement.class);
920
            dir.addSQLElement(DemandePrixSQLElement.class);
968
            dir.addSQLElement(DemandePrixSQLElement.class);
921
            dir.addSQLElement(DemandePrixItemSQLElement.class);
969
            dir.addSQLElement(DemandePrixItemSQLElement.class);
922
            dir.addSQLElement(FabricantSQLElement.class);
970
            dir.addSQLElement(FabricantSQLElement.class);
923
            dir.addSQLElement(ChiffrageCommandeClientSQLElement.class);
971
            dir.addSQLElement(ChiffrageCommandeClientSQLElement.class);
924
 
972
 
925
            dir.addSQLElement(new CommercialSQLElement());
973
            dir.addSQLElement(new CommercialSQLElement());
926
 
974
 
927
            dir.addSQLElement(ObjectifSQLElement.class);
975
            dir.addSQLElement(ObjectifSQLElement.class);
928
            dir.addSQLElement(new ComptePCESQLElement());
976
            dir.addSQLElement(new ComptePCESQLElement());
929
            dir.addSQLElement(new ComptePCGSQLElement());
977
            dir.addSQLElement(new ComptePCGSQLElement());
930
 
978
 
931
            dir.addSQLElement(new ContratSalarieSQLElement());
979
            dir.addSQLElement(new ContratSalarieSQLElement());
932
            dir.addSQLElement(ContratPrevoyanceSQLElement.class);
980
            dir.addSQLElement(ContratPrevoyanceSQLElement.class);
933
            dir.addSQLElement(ContratPrevoyanceRubriqueSQLElement.class);
981
            dir.addSQLElement(ContratPrevoyanceRubriqueSQLElement.class);
934
            dir.addSQLElement(ContratPrevoyanceRubriqueNetSQLElement.class);
982
            dir.addSQLElement(ContratPrevoyanceRubriqueNetSQLElement.class);
935
            dir.addSQLElement(ContratPrevoyanceSalarieSQLElement.class);
983
            dir.addSQLElement(ContratPrevoyanceSalarieSQLElement.class);
936
            dir.addSQLElement(AyantDroitSQLElement.class);
984
            dir.addSQLElement(AyantDroitSQLElement.class);
937
            dir.addSQLElement(AyantDroitContratPrevSQLElement.class);
985
            dir.addSQLElement(AyantDroitContratPrevSQLElement.class);
938
 
986
 
939
            dir.addSQLElement(new CodeRegimeSQLElement());
987
            dir.addSQLElement(new CodeRegimeSQLElement());
940
            dir.addSQLElement(new CodeEmploiSQLElement());
988
            dir.addSQLElement(new CodeEmploiSQLElement());
941
            dir.addSQLElement(new CodeContratTravailSQLElement());
989
            dir.addSQLElement(new CodeContratTravailSQLElement());
942
            dir.addSQLElement(new CodeDroitContratSQLElement());
990
            dir.addSQLElement(new CodeDroitContratSQLElement());
943
            dir.addSQLElement(new CodeCaractActiviteSQLElement());
991
            dir.addSQLElement(new CodeCaractActiviteSQLElement());
944
 
992
 
945
            dir.addSQLElement(new CodeStatutCategorielSQLElement());
993
            dir.addSQLElement(new CodeStatutCategorielSQLElement());
946
            dir.addSQLElement(CodeStatutCategorielConventionnelSQLElement.class);
994
            dir.addSQLElement(CodeStatutCategorielConventionnelSQLElement.class);
947
            dir.addSQLElement(new CodeStatutProfSQLElement());
995
            dir.addSQLElement(new CodeStatutProfSQLElement());
948
            dir.addSQLElement(CodePenibiliteContratSQLElement.class);
996
            dir.addSQLElement(CodePenibiliteContratSQLElement.class);
949
 
997
 
950
            dir.addSQLElement(PasSQLElement.class);
998
            dir.addSQLElement(PasSQLElement.class);
951
 
999
 
952
            dir.addSQLElement(new CumulsCongesSQLElement());
1000
            dir.addSQLElement(new CumulsCongesSQLElement());
953
            dir.addSQLElement(new CumulsPayeSQLElement());
1001
            dir.addSQLElement(new CumulsPayeSQLElement());
954
 
1002
 
955
            dir.addSQLElement(new DepartementSQLElement());
1003
            dir.addSQLElement(new DepartementSQLElement());
956
            dir.addSQLElement(new DevisSQLElement());
1004
            dir.addSQLElement(new DevisSQLElement());
957
            dir.addSQLElement(new TransferQuoteSQLElement());
1005
            dir.addSQLElement(new TransferQuoteSQLElement());
958
            dir.addSQLElement(new DevisItemSQLElement());
1006
            dir.addSQLElement(new DevisItemSQLElement());
959
 
1007
 
960
            dir.addSQLElement(new EcheanceClientSQLElement());
1008
            dir.addSQLElement(new EcheanceClientSQLElement());
961
            dir.addSQLElement(new EcheanceFournisseurSQLElement());
1009
            dir.addSQLElement(new EcheanceFournisseurSQLElement());
962
            dir.addSQLElement(EncaisserMontantSQLElement.class);
1010
            dir.addSQLElement(EncaisserMontantSQLElement.class);
963
            dir.addSQLElement(EncaisserMontantElementSQLElement.class);
1011
            dir.addSQLElement(EncaisserMontantElementSQLElement.class);
964
            dir.addSQLElement(EcoTaxeSQLElement.class);
1012
            dir.addSQLElement(EcoTaxeSQLElement.class);
965
 
1013
 
966
            dir.addSQLElement(new EtatCivilSQLElement());
1014
            dir.addSQLElement(new EtatCivilSQLElement());
967
            dir.addSQLElement(new EtatDevisSQLElement());
1015
            dir.addSQLElement(new EtatDevisSQLElement());
968
 
1016
 
969
            dir.addSQLElement(new FamilleArticleSQLElement());
1017
            dir.addSQLElement(new FamilleArticleSQLElement());
970
            dir.addSQLElement(new FichePayeSQLElement());
1018
            dir.addSQLElement(new FichePayeSQLElement());
971
            dir.addSQLElement(new FichePayeElementSQLElement());
1019
            dir.addSQLElement(new FichePayeElementSQLElement());
972
 
1020
 
973
            dir.addSQLElement(new FournisseurSQLElement());
1021
            dir.addSQLElement(new FournisseurSQLElement());
974
 
1022
 
975
            dir.addSQLElement(new CodeIdccSQLElement());
-
 
976
 
-
 
977
            dir.addSQLElement(new InfosSalariePayeSQLElement());
1023
            dir.addSQLElement(new InfosSalariePayeSQLElement());
978
 
1024
 
979
            dir.addSQLElement(new JournalSQLElement());
1025
            dir.addSQLElement(new JournalSQLElement());
980
 
1026
 
981
            dir.addSQLElement(LangueSQLElement.class);
1027
            dir.addSQLElement(LangueSQLElement.class);
982
 
1028
 
983
            dir.addSQLElement(new MetriqueSQLElement());
1029
            dir.addSQLElement(new MetriqueSQLElement());
984
            dir.addSQLElement(new ModeleCourrierClientSQLElement());
1030
            dir.addSQLElement(new ModeleCourrierClientSQLElement());
985
            dir.addSQLElement(new ModeVenteArticleSQLElement());
1031
            dir.addSQLElement(new ModeVenteArticleSQLElement());
986
            dir.addSQLElement(new ModeDeReglementSQLElement());
1032
            dir.addSQLElement(new ModeDeReglementSQLElement());
987
            dir.addSQLElement(new ModeReglementPayeSQLElement());
1033
            dir.addSQLElement(new ModeReglementPayeSQLElement());
988
            dir.addSQLElement(new MoisSQLElement());
1034
            dir.addSQLElement(new MoisSQLElement());
989
            dir.addSQLElement(new MouvementSQLElement());
1035
            dir.addSQLElement(new MouvementSQLElement());
990
            dir.addSQLElement(new MouvementStockSQLElement());
1036
            dir.addSQLElement(new MouvementStockSQLElement());
991
            dir.addSQLElement(DepotStockSQLElement.class);
1037
            dir.addSQLElement(DepotStockSQLElement.class);
992
 
1038
 
993
            dir.addSQLElement(new NatureCompteSQLElement());
1039
            dir.addSQLElement(new NatureCompteSQLElement());
994
 
1040
 
995
            dir.addSQLElement(new NumerotationAutoSQLElement());
1041
            dir.addSQLElement(new NumerotationAutoSQLElement());
996
 
1042
 
997
            dir.addSQLElement(new PaysSQLElement());
1043
            dir.addSQLElement(new PaysSQLElement());
998
 
1044
 
999
            dir.addSQLElement(new PieceSQLElement());
1045
            dir.addSQLElement(new PieceSQLElement());
1000
 
1046
 
1001
            dir.addSQLElement(ReferenceClientSQLElement.class);
1047
            dir.addSQLElement(ReferenceClientSQLElement.class);
1002
            dir.addSQLElement(new RegimeBaseSQLElement());
1048
            dir.addSQLElement(new RegimeBaseSQLElement());
1003
            dir.addSQLElement(new RelanceSQLElement());
1049
            dir.addSQLElement(new RelanceSQLElement());
1004
            dir.addSQLElement(new ReglementPayeSQLElement());
1050
            dir.addSQLElement(new ReglementPayeSQLElement());
1005
            dir.addSQLElement(new ReglerMontantSQLElement());
1051
            dir.addSQLElement(new ReglerMontantSQLElement());
1006
            dir.addSQLElement(ReglerMontantElementSQLElement.class);
1052
            dir.addSQLElement(ReglerMontantElementSQLElement.class);
1007
            dir.addSQLElement(RepartitionAnalytiqueSQLElement.class);
1053
            dir.addSQLElement(RepartitionAnalytiqueSQLElement.class);
1008
 
1054
 
1009
            dir.addSQLElement(new SaisieAchatSQLElement());
1055
            dir.addSQLElement(new SaisieAchatSQLElement());
1010
            dir.addSQLElement(new FactureFournisseurSQLElement());
1056
            dir.addSQLElement(new FactureFournisseurSQLElement());
1011
            dir.addSQLElement(new FactureFournisseurElementSQLElement());
1057
            dir.addSQLElement(new FactureFournisseurElementSQLElement());
1012
            dir.addSQLElement(new TransferPurchaseSQLElement());
1058
            dir.addSQLElement(new TransferPurchaseSQLElement());
1013
            dir.addSQLElement(new SaisieKmSQLElement());
1059
            dir.addSQLElement(new SaisieKmSQLElement());
1014
            dir.addSQLElement(new SaisieVenteComptoirSQLElement());
1060
            dir.addSQLElement(new SaisieVenteComptoirSQLElement());
1015
            dir.addSQLElement(new SaisieVenteFactureSQLElement());
1061
            dir.addSQLElement(new SaisieVenteFactureSQLElement());
1016
            dir.addSQLElement(new TransferInvoiceSQLElement());
1062
            dir.addSQLElement(new TransferInvoiceSQLElement());
1017
            // at the end since it specifies action which initialize foreign keys
1063
            // at the end since it specifies action which initialize foreign keys
1018
            dir.addSQLElement(AssociationAnalytiqueSQLElement.class);
1064
            dir.addSQLElement(AssociationAnalytiqueSQLElement.class);
1019
                dir.addSQLElement(new SaisieVenteFactureItemSQLElement(this));
1065
                dir.addSQLElement(new SaisieVenteFactureItemSQLElement(this));
1020
 
1066
 
1021
            dir.addSQLElement(SituationFamilialeSQLElement.class);
1067
            dir.addSQLElement(SituationFamilialeSQLElement.class);
1022
            dir.addSQLElement(new StockSQLElement());
1068
            dir.addSQLElement(new StockSQLElement());
1023
            dir.addSQLElement(new StyleSQLElement());
1069
            dir.addSQLElement(new StyleSQLElement());
1024
 
-
 
1025
            dir.addSQLElement(new SalarieSQLElement());
-
 
1026
 
-
 
1027
            dir.addSQLElement(TarifSQLElement.class);
1070
            dir.addSQLElement(TarifSQLElement.class);
-
 
1071
            dir.addSQLElement(TarifPromotionSQLElement.class);
-
 
1072
            dir.addSQLElement(ArticleTarifPromotionSQLElement.class);
1028
            dir.addSQLElement(new TaxeSQLElement());
1073
            dir.addSQLElement(new TaxeSQLElement());
1029
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
1074
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
1030
            dir.addSQLElement(TicketCaisseSQLElement.class);
1075
            dir.addSQLElement(TicketCaisseSQLElement.class);
1031
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
1076
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
1032
            dir.addSQLElement(CaisseJournalSQLElement.class);
1077
            dir.addSQLElement(CaisseJournalSQLElement.class);
1033
 
1078
 
1034
            dir.addSQLElement(new TypeComptePCGSQLElement());
1079
            dir.addSQLElement(new TypeComptePCGSQLElement());
1035
            dir.addSQLElement(new TypeLettreRelanceSQLElement());
1080
            dir.addSQLElement(new TypeLettreRelanceSQLElement());
1036
            dir.addSQLElement(new TypeReglementSQLElement());
1081
            dir.addSQLElement(new TypeReglementSQLElement());
1037
            dir.addSQLElement(new SDDMessageSQLElement(this));
1082
            dir.addSQLElement(new SDDMessageSQLElement(this));
1038
            dir.addSQLElement(new SEPAMandateSQLElement(this));
1083
            dir.addSQLElement(new SEPAMandateSQLElement(this));
-
 
1084
            dir.addSQLElement(TarifSQLElement.class);
-
 
1085
            dir.addSQLElement(TarifPromotionSQLElement.class);
-
 
1086
            dir.addSQLElement(ArticleTarifPromotionSQLElement.class);
-
 
1087
            dir.addSQLElement(new TaxeSQLElement());
-
 
1088
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
-
 
1089
            dir.addSQLElement(TicketCaisseSQLElement.class);
-
 
1090
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
-
 
1091
            dir.addSQLElement(CaisseJournalSQLElement.class);
1039
 
1092
 
1040
            dir.addSQLElement(new VariableSalarieSQLElement());
1093
            dir.addSQLElement(new VariableSalarieSQLElement());
-
 
1094
            dir.addSQLElement(SalarieSQLElement.class);
1041
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1095
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1042
 
1096
 
1043
            dir.addSQLElement(CalendarItemSQLElement.class);
1097
            dir.addSQLElement(CalendarItemSQLElement.class);
1044
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1098
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1045
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
1099
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
1046
            dir.addSQLElement(EmailTemplateSQLElement.class);
1100
            dir.addSQLElement(EmailTemplateSQLElement.class);
1047
 
1101
 
-
 
1102
            dir.addSQLElement(ArretChomageIntemperieSQLElement.class);
-
 
1103
 
1048
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1104
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1049
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1105
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1050
            }
1106
            }
1051
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
1107
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
1052
                dir.addSQLElement(new FWKSessionState(getRootSociete()));
1108
                dir.addSQLElement(new FWKSessionState(getRootSociete()));
1053
            }
1109
            }
1054
 
1110
 
1055
            // check that all codes are unique
1111
            // check that all codes are unique
1056
            Collection<SQLElement> elements = dir.getElements();
1112
            Collection<SQLElement> elements = dir.getElements();
1057
            String s = "";
1113
            String s = "";
1058
            for (SQLElement sqlElement : elements) {
1114
            for (SQLElement sqlElement : elements) {
1059
                try {
1115
                try {
1060
                    SQLElement e = dir.getElementForCode(sqlElement.getCode());
1116
                    SQLElement e = dir.getElementForCode(sqlElement.getCode());
1061
                    if (e != sqlElement) {
1117
                    if (e != sqlElement) {
1062
                        s += "Error while retrieving element from code " + sqlElement.getCode() + "\n";
1118
                        s += "Error while retrieving element from code " + sqlElement.getCode() + "\n";
1063
                    }
1119
                    }
1064
                } catch (Throwable e) {
1120
                } catch (Throwable e) {
1065
                    s += "Error while retrieving element from code " + sqlElement.getCode() + " :\n " + e.getMessage() + "\n";
1121
                    s += "Error while retrieving element from code " + sqlElement.getCode() + " :\n " + e.getMessage() + "\n";
1066
                }
1122
                }
1067
            }
1123
            }
1068
            if (!s.trim().isEmpty()) {
1124
            if (!s.trim().isEmpty()) {
1069
                ExceptionHandler.handle(s);
1125
                ExceptionHandler.handle(s);
1070
            }
1126
            }
1071
        } catch (DBStructureItemNotFound e) {
1127
        } catch (DBStructureItemNotFound e) {
1072
            if (!GraphicsEnvironment.isHeadless()) {
1128
            if (!GraphicsEnvironment.isHeadless()) {
1073
 
1129
 
1074
                if (this.getServer().getSQLSystem().equals(SQLSystem.H2)) {
1130
                if (this.getServer().getSQLSystem().equals(SQLSystem.H2)) {
1075
                    JOptionPane.showMessageDialog(null,
1131
                    JOptionPane.showMessageDialog(null,
1076
                            "Une table ou un champ est manquant dans la base de données.\nMettez à jour la base de données si vous venez de changer de version d'Openconcerto.");
1132
                            "Une table ou un champ est manquant dans la base de données.\nMettez à jour la base de données si vous venez de changer de version d'Openconcerto.");
1077
 
1133
 
1078
                    final JFrame f = new JFrame("Mise à jour de la base de données");
1134
                    final JFrame f = new JFrame("Mise à jour de la base de données");
1079
                    f.setContentPane(new InstallationPanel(null));
1135
                    f.setContentPane(new InstallationPanel(null));
1080
                    f.pack();
1136
                    f.pack();
1081
                    f.setVisible(true);
1137
                    f.setVisible(true);
1082
                    f.setLocationRelativeTo(null);
1138
                    f.setLocationRelativeTo(null);
1083
                    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
1139
                    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
1084
 
1140
 
1085
                } else {
1141
                } else {
1086
                    JOptionPane.showMessageDialog(null,
1142
                    JOptionPane.showMessageDialog(null,
1087
                            "Une table ou un champ est manquant dans la base de données. Mettez à jour votre base de données via l'outil de configuration si vous venez de changer de version d'Openconcerto.");
1143
                            "Une table ou un champ est manquant dans la base de données. Mettez à jour votre base de données via l'outil de configuration si vous venez de changer de version d'Openconcerto.");
1088
 
1144
 
1089
                }
1145
                }
1090
 
1146
 
1091
            }
1147
            }
1092
            throw e;
1148
            throw e;
1093
        }
1149
        }
1094
    }
1150
    }
1095
 
1151
 
1096
    private void setSocieteSQLInjector() {
1152
    private void setSocieteSQLInjector() {
1097
        final DBRoot rootSociete = getRootSociete();
1153
        final DBRoot rootSociete = getRootSociete();
1098
        setSocieteSQLInjector(rootSociete);
1154
        setSocieteSQLInjector(rootSociete);
1099
 
1155
 
1100
    }
1156
    }
1101
 
1157
 
1102
    public static void setSocieteSQLInjector(final DBRoot rootSociete) {
1158
    public static void setSocieteSQLInjector(final DBRoot rootSociete) {
1103
        new AchatAvoirSQLInjector(rootSociete);
1159
        new AchatAvoirSQLInjector(rootSociete);
1104
        new CommandeFactureEltSQLInjector(rootSociete);
1160
        new CommandeFactureEltSQLInjector(rootSociete);
1105
        new ArticleCommandeEltSQLInjector(rootSociete);
1161
        new ArticleCommandeEltSQLInjector(rootSociete);
1106
        new CommandeCliCommandeSQLInjector(rootSociete);
1162
        new CommandeCliCommandeSQLInjector(rootSociete);
1107
        new FactureAvoirSQLInjector(rootSociete);
1163
        new FactureAvoirSQLInjector(rootSociete);
1108
        new FactureBonSQLInjector(rootSociete);
1164
        new FactureBonSQLInjector(rootSociete);
1109
        new FactureCommandeSQLInjector(rootSociete);
1165
        new FactureCommandeSQLInjector(rootSociete);
1110
        new DevisFactureSQLInjector(rootSociete);
1166
        new DevisFactureSQLInjector(rootSociete);
1111
        new DevisCommandeSQLInjector(rootSociete);
1167
        new DevisCommandeSQLInjector(rootSociete);
-
 
1168
        new DevisEltCmdEltSQLInjector(rootSociete);
1112
        new DevisCommandeFournisseurSQLInjector(rootSociete);
1169
        new DevisCommandeFournisseurSQLInjector(rootSociete);
1113
        new DevisBlEltSQLInjector(rootSociete);
1170
        new DevisBlEltSQLInjector(rootSociete);
1114
        new DevisBlSQLInjector(rootSociete);
1171
        new DevisBlSQLInjector(rootSociete);
1115
        new CommandeBlEltSQLInjector(rootSociete);
1172
        new CommandeBlEltSQLInjector(rootSociete);
1116
        new CmdEltFactEltSQLInjector(rootSociete);
1173
        new CmdEltFactEltSQLInjector(rootSociete);
1117
        new BrEltFactEltSQLInjector(rootSociete);
1174
        new BrEltFactEltSQLInjector(rootSociete);
1118
        new CommandeBrEltSQLInjector(rootSociete);
1175
        new CommandeBrEltSQLInjector(rootSociete);
1119
        new CommandeBlSQLInjector(rootSociete);
1176
        new CommandeBlSQLInjector(rootSociete);
1120
        new BonFactureSQLInjector(rootSociete);
1177
        new BonFactureSQLInjector(rootSociete);
1121
        new BonFactureEltSQLInjector(rootSociete);
1178
        new BonFactureEltSQLInjector(rootSociete);
1122
        new CommandeFactureClientSQLInjector(rootSociete);
1179
        new CommandeFactureClientSQLInjector(rootSociete);
1123
        new CommandeBrSQLInjector(rootSociete);
1180
        new CommandeBrSQLInjector(rootSociete);
1124
        new BonReceptionFactureFournisseurSQLInjector(rootSociete);
1181
        new BonReceptionFactureFournisseurSQLInjector(rootSociete);
1125
        new CommandeFactureAchatSQLInjector(rootSociete);
1182
        new CommandeFactureAchatSQLInjector(rootSociete);
1126
        new CommandeFactureFournisseurSQLInjector(rootSociete);
1183
        new CommandeFactureFournisseurSQLInjector(rootSociete);
1127
        new EcheanceEncaisseSQLInjector(rootSociete);
1184
        new EcheanceEncaisseSQLInjector(rootSociete);
1128
        new EcheanceRegleSQLInjector(rootSociete);
1185
        new EcheanceRegleSQLInjector(rootSociete);
1129
        new BrFactureAchatSQLInjector(rootSociete);
1186
        new BrFactureAchatSQLInjector(rootSociete);
1130
        new DevisEltFactureEltSQLInjector(rootSociete);
1187
        new DevisEltFactureEltSQLInjector(rootSociete);
1131
 
1188
 
1132
        if (rootSociete.contains("DEMANDE_PRIX_ACHAT_ELEMENT")) {
1189
        if (rootSociete.contains("DEMANDE_PRIX_ACHAT_ELEMENT")) {
1133
            new DmdAchatDmdPrixEltSQLInjector(rootSociete);
1190
            new DmdAchatDmdPrixEltSQLInjector(rootSociete);
1134
            new DmdPrixCmdSQLInjector(rootSociete);
1191
            new DmdPrixCmdSQLInjector(rootSociete);
1135
        }
1192
        }
1136
 
1193
 
1137
    }
1194
    }
1138
 
1195
 
1139
 
1196
 
1140
    private void setSocieteShowAs() {
1197
    private void setSocieteShowAs() {
1141
        final ShowAs showAs = this.getShowAs();
1198
        final ShowAs showAs = this.getShowAs();
1142
        final DBRoot root = this.getRootSociete();
1199
        final DBRoot root = this.getRootSociete();
1143
        showAs.setRoot(getRootSociete());
1200
        showAs.setRoot(getRootSociete());
1144
 
1201
 
1145
        showAs.show("AXE_ANALYTIQUE", "NOM");
1202
        showAs.show("AXE_ANALYTIQUE", "NOM");
1146
 
1203
 
1147
        List<String> lEcr = new ArrayList<String>();
1204
        List<String> lEcr = new ArrayList<String>();
1148
 
1205
 
1149
        lEcr.add("ID_MOUVEMENT");
1206
        lEcr.add("ID_MOUVEMENT");
1150
        lEcr.add("ID_JOURNAL");
1207
        lEcr.add("ID_JOURNAL");
1151
        lEcr.add("ID_COMPTE_PCE");
1208
        lEcr.add("ID_COMPTE_PCE");
1152
        lEcr.add("DATE");
1209
        lEcr.add("DATE");
1153
 
1210
 
1154
        showAs.show(root.getTable("ASSOCIATION_ANALYTIQUE").getField("ID_ECRITURE"), lEcr);
1211
        showAs.show(root.getTable("ASSOCIATION_ANALYTIQUE").getField("ID_ECRITURE"), lEcr);
1155
 
1212
 
1156
        showAs.show("CHEQUE_A_ENCAISSER", "MONTANT", "ID_CLIENT");
1213
        showAs.show("CHEQUE_A_ENCAISSER", "MONTANT", "ID_CLIENT");
1157
 
1214
 
1158
                if (getRootSociete().getTable("CLIENT").getFieldsName().contains("LOCALISATION")) {
1215
                if (getRootSociete().getTable("CLIENT").getFieldsName().contains("LOCALISATION")) {
1159
                    showAs.show("CLIENT", "NOM", "LOCALISATION");
1216
                    showAs.show("CLIENT", "NOM", "LOCALISATION");
1160
                } else {
1217
                } else {
1161
                    SQLPreferences prefs = SQLPreferences.getMemCached(root);
1218
                    SQLPreferences prefs = SQLPreferences.getMemCached(root);
1162
                    if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_PCE, false)) {
1219
                    if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_PCE, false)) {
1163
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM", "ID_COMPTE_PCE");
1220
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM", "ID_COMPTE_PCE");
1164
                    } else {
1221
                    } else {
1165
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM");
1222
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM");
1166
                    }
1223
                    }
1167
                }
1224
                }
1168
 
1225
 
1169
        showAs.show(BanqueSQLElement.TABLENAME, "NOM");
1226
        showAs.show(BanqueSQLElement.TABLENAME, "NOM");
1170
 
1227
 
1171
        showAs.show("CLASSEMENT_CONVENTIONNEL", "NIVEAU", "COEFF");
1228
        showAs.show("CLASSEMENT_CONVENTIONNEL", "NIVEAU", "COEFF");
1172
        showAs.show("CODE_EMPLOI", SQLRow.toList("CODE,NOM"));
1229
        showAs.show("CODE_EMPLOI", SQLRow.toList("CODE,NOM"));
1173
        showAs.show("CODE_CONTRAT_TRAVAIL", SQLRow.toList("CODE,NOM"));
1230
        showAs.show("CODE_CONTRAT_TRAVAIL", SQLRow.toList("CODE,NOM"));
1174
        showAs.show("CODE_DROIT_CONTRAT", SQLRow.toList("CODE,NOM"));
1231
        showAs.show("CODE_DROIT_CONTRAT", SQLRow.toList("CODE,NOM"));
1175
        showAs.show("CODE_CARACT_ACTIVITE", SQLRow.toList("CODE,NOM"));
1232
        showAs.show("CODE_CARACT_ACTIVITE", SQLRow.toList("CODE,NOM"));
1176
        showAs.show("CODE_STATUT_PROF", SQLRow.toList("CODE,NOM"));
1233
        showAs.show("CODE_STATUT_PROF", SQLRow.toList("CODE,NOM"));
1177
        showAs.show("CODE_STATUT_CATEGORIEL", SQLRow.toList("CODE,NOM"));
1234
        showAs.show("CODE_STATUT_CATEGORIEL", SQLRow.toList("CODE,NOM"));
1178
        showAs.show("CODE_REGIME", SQLRow.toList("CODE,NOM"));
1235
        showAs.show("CODE_REGIME", SQLRow.toList("CODE,NOM"));
1179
 
1236
 
1180
        showAs.show("COMMANDE", "NUMERO", "DATE", "DATE_RECEPTION_DEMANDEE", "NOM", "ID_FOURNISSEUR");
1237
        showAs.show("COMMANDE", "NUMERO", "DATE", "DATE_RECEPTION_DEMANDEE", "NOM", "ID_FOURNISSEUR");
1181
        if (root.getTable("COMMANDE_CLIENT").contains("ID_AFFAIRE")) {
1238
        if (root.getTable("COMMANDE_CLIENT").contains("ID_AFFAIRE")) {
1182
            showAs.show("COMMANDE_CLIENT", "NUMERO", "DATE", "ID_CLIENT", "ID_AFFAIRE", "NOM", "T_HT");
1239
            showAs.show("COMMANDE_CLIENT", "NUMERO", "DATE", "ID_CLIENT", "ID_AFFAIRE", "NOM", "T_HT");
1183
        } else {
1240
        } else {
1184
            showAs.show("COMMANDE_CLIENT", "NUMERO", "ID_CLIENT", "DATE", "NOM", "T_HT");
1241
            showAs.show("COMMANDE_CLIENT", "NUMERO", "ID_CLIENT", "DATE", "NOM", "T_HT");
1185
        }
1242
        }
1186
 
1243
 
1187
        showAs.show("COMPTE_PCE", "NUMERO", "NOM");
1244
        showAs.show("COMPTE_PCE", "NUMERO", "NOM");
1188
        showAs.show("COMPTE_PCG", "NUMERO", "NOM");
1245
        showAs.show("COMPTE_PCG", "NUMERO", "NOM");
1189
        showAs.show("CONTACT", "NOM");
1246
        showAs.show("CONTACT", "NOM");
1190
        showAs.show("CONTRAT_SALARIE", "NATURE");
1247
        showAs.show("CONTRAT_SALARIE", "NATURE");
1191
 
1248
 
1192
        List<String> listFieldDevisElt = new ArrayList<String>();
1249
        List<String> listFieldDevisElt = new ArrayList<String>();
1193
        listFieldDevisElt.add("NUMERO");
1250
        listFieldDevisElt.add("NUMERO");
-
 
1251
        listFieldDevisElt.add("OBJET");
1194
        listFieldDevisElt.add("DATE");
1252
        listFieldDevisElt.add("DATE");
1195
        listFieldDevisElt.add("ID_CLIENT");
1253
        listFieldDevisElt.add("ID_CLIENT");
-
 
1254
        if (root.getTable("DEVIS").contains("DATE_LIVRAISON")) {
-
 
1255
            listFieldDevisElt.add("DATE_LIVRAISON");
-
 
1256
        }
-
 
1257
        if (root.getTable("DEVIS").contains("TRANSFORMATION")) {
-
 
1258
            listFieldDevisElt.add("TRANSFORMATION");
-
 
1259
        }
1196
 
1260
 
1197
        listFieldDevisElt.add("ID_ETAT_DEVIS");
1261
        listFieldDevisElt.add("ID_ETAT_DEVIS");
1198
        showAs.showField("DEVIS_ELEMENT.ID_DEVIS", listFieldDevisElt);
1262
        showAs.showField("DEVIS_ELEMENT.ID_DEVIS", listFieldDevisElt);
1199
 
1263
 
1200
        showAs.show("DEPARTEMENT", "NUMERO", "NOM");
1264
        showAs.show("DEPARTEMENT", "NUMERO", "NOM");
1201
 
1265
 
1202
        showAs.show("ECRITURE", SQLRow.toList("NOM,DATE,ID_COMPTE_PCE,DEBIT,CREDIT"));
1266
        showAs.show("ECRITURE", SQLRow.toList("NOM,DATE,ID_COMPTE_PCE,DEBIT,CREDIT"));
1203
        showAs.show("ECHEANCE_CLIENT", SQLRow.toList("ID_CLIENT,ID_MOUVEMENT"));
1267
        showAs.show("ECHEANCE_CLIENT", SQLRow.toList("ID_CLIENT,ID_MOUVEMENT"));
1204
        final List<String> lEchFact = new ArrayList<String>();
1268
        final List<String> lEchFact = new ArrayList<String>();
1205
        lEchFact.add("NUMERO");
1269
        lEchFact.add("NUMERO");
1206
        lEchFact.add("DATE");
1270
        lEchFact.add("DATE");
1207
        lEchFact.add("ID_MODE_REGLEMENT");
1271
        lEchFact.add("ID_MODE_REGLEMENT");
1208
        lEchFact.add("ID_COMMERCIAL");
1272
        lEchFact.add("ID_COMMERCIAL");
1209
        SQLTable tableEch = root.getTable("ECHEANCE_CLIENT");
1273
        SQLTable tableEch = root.getTable("ECHEANCE_CLIENT");
1210
        showAs.show(tableEch.getField("ID_SAISIE_VENTE_FACTURE"), lEchFact);
1274
        showAs.show(tableEch.getField("ID_SAISIE_VENTE_FACTURE"), lEchFact);
1211
 
1275
 
1212
        showAs.show("ECHEANCE_FOURNISSEUR", SQLRow.toList("ID_FOURNISSEUR,ID_MOUVEMENT"));
1276
        showAs.show("ECHEANCE_FOURNISSEUR", SQLRow.toList("ID_FOURNISSEUR,ID_MOUVEMENT"));
1213
        showAs.show("FICHE_PAYE", SQLRow.toList("ID_MOIS,ANNEE,ID_PROFIL_PAYE"));
1277
        showAs.show("FICHE_PAYE", SQLRow.toList("ID_MOIS,ANNEE,ID_PROFIL_PAYE"));
1214
 
1278
 
1215
        showAs.show("FOURNISSEUR", "NOM");
1279
        showAs.show("FOURNISSEUR", "NOM");
1216
 
1280
 
1217
        showAs.show("IDCC", "NOM");
1281
        showAs.show("IDCC", "NOM");
1218
 
1282
 
1219
        showAs.show("JOURNAL", "NOM");
1283
        showAs.show("JOURNAL", "NOM");
1220
        showAs.show("MOIS", "NOM");
1284
        showAs.show("MOIS", "NOM");
1221
        showAs.show("MOUVEMENT", "NUMERO", "ID_PIECE");
1285
        showAs.show("MOUVEMENT", "NUMERO", "ID_PIECE");
1222
        showAs.show("MODE_VENTE_ARTICLE", "NOM");
1286
        showAs.show("MODE_VENTE_ARTICLE", "NOM");
1223
        showAs.show("MODE_REGLEMENT", "ID_TYPE_REGLEMENT", "AJOURS");
1287
        showAs.show("MODE_REGLEMENT", "ID_TYPE_REGLEMENT", "AJOURS");
1224
        showAs.show("MODE_REGLEMENT_PAYE", "NOM");
1288
        showAs.show("MODE_REGLEMENT_PAYE", "NOM");
1225
        showAs.show("MODELE_COURRIER_CLIENT", "NOM", "CONTENU");
1289
        showAs.show("MODELE_COURRIER_CLIENT", "NOM", "CONTENU");
1226
 
1290
 
1227
        showAs.show("NATURE_COMPTE", "NOM");
1291
        showAs.show("NATURE_COMPTE", "NOM");
1228
        showAs.show("POSTE_ANALYTIQUE", "NOM", "ID_AXE_ANALYTIQUE");
1292
        showAs.show("POSTE_ANALYTIQUE", "NOM", "ID_AXE_ANALYTIQUE");
1229
        showAs.show("PAYS", "CODE", "NOM");
1293
        showAs.show("PAYS", "CODE", "NOM");
1230
        showAs.show("PIECE", "ID", "NOM");
1294
        showAs.show("PIECE", "ID", "NOM");
1231
 
1295
 
1232
        final SQLElementDirectory directory = this.getDirectory();
1296
        final SQLElementDirectory directory = this.getDirectory();
1233
        showAs.show("REPARTITION_ANALYTIQUE", "NOM");
1297
        showAs.show("REPARTITION_ANALYTIQUE", "NOM");
1234
        showAs.show("REGIME_BASE", "ID_CODE_REGIME_BASE");
1298
        showAs.show("REGIME_BASE", "ID_CODE_REGIME_BASE");
1235
        showAs.show("REGLEMENT_PAYE", "NOM_BANQUE", "IBAN", "BIC");
1299
        showAs.show("REGLEMENT_PAYE", "NOM_BANQUE", "IBAN", "BIC");
1236
 
1300
 
1237
        List<String> listFieldModReglMontant = new ArrayList<String>();
1301
        List<String> listFieldModReglMontant = new ArrayList<String>();
1238
        listFieldModReglMontant.add("ID_TYPE_REGLEMENT");
1302
        listFieldModReglMontant.add("ID_TYPE_REGLEMENT");
1239
        listFieldModReglMontant.add("ID_" + BanqueSQLElement.TABLENAME);
1303
        listFieldModReglMontant.add("ID_" + BanqueSQLElement.TABLENAME);
1240
 
1304
 
1241
        showAs.showField("REGLER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1305
        showAs.showField("REGLER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1242
        showAs.showField("ENCAISSER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1306
        showAs.showField("ENCAISSER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1243
 
1307
 
1244
        List<String> listFieldFactureElt = new ArrayList<String>();
1308
        List<String> listFieldFactureElt = new ArrayList<String>();
1245
        listFieldFactureElt.add("NUMERO");
1309
        listFieldFactureElt.add("NUMERO");
-
 
1310
        listFieldFactureElt.add("NOM");
1246
        listFieldFactureElt.add("DATE");
1311
        listFieldFactureElt.add("DATE");
1247
        listFieldFactureElt.add("ID_COMMERCIAL");
1312
        listFieldFactureElt.add("ID_COMMERCIAL");
1248
        listFieldFactureElt.add("ID_CLIENT");
1313
        listFieldFactureElt.add("ID_CLIENT");
1249
        showAs.showField("SAISIE_VENTE_FACTURE_ELEMENT.ID_SAISIE_VENTE_FACTURE", listFieldFactureElt);
1314
        showAs.showField("SAISIE_VENTE_FACTURE_ELEMENT.ID_SAISIE_VENTE_FACTURE", listFieldFactureElt);
1250
 
-
 
1251
        showAs.show("SALARIE", SQLRow.toList("CODE,NOM,PRENOM"));
1315
        showAs.show("SALARIE", SQLRow.toList("CODE,NOM,PRENOM"));
1252
 
-
 
1253
        showAs.show("SITUATION_FAMILIALE", "NOM");
1316
        showAs.show("SITUATION_FAMILIALE", "NOM");
1254
        if (root.getTable("STOCK").contains("ID_ARTICLE")) {
-
 
1255
            List<String> listFieldArtElt = new ArrayList<String>();
-
 
1256
            listFieldArtElt.add("CODE");
-
 
1257
            listFieldArtElt.add("NOM");
-
 
1258
            listFieldArtElt.add("ID_FAMILLE_ARTICLE");
-
 
1259
            showAs.showField("STOCK.ID_ARTICLE", listFieldArtElt);
-
 
1260
        }
1317
 
1261
        showAs.show("STYLE", "NOM");
1318
        showAs.show("STYLE", "NOM");
1262
 
1319
 
1263
        showAs.show("TAXE", "TAUX");
1320
        showAs.show("TAXE", "TAUX");
1264
 
1321
 
1265
        showAs.show(directory.getElement("TITRE_PERSONNEL").getTable(), asList("NOM"));
1322
        showAs.show(directory.getElement("TITRE_PERSONNEL").getTable(), asList("NOM"));
1266
 
1323
 
1267
        showAs.show("TYPE_COMPTE_PCG", "NOM");
1324
        showAs.show("TYPE_COMPTE_PCG", "NOM");
1268
        showAs.show("TYPE_LETTRE_RELANCE", "NOM");
1325
        showAs.show("TYPE_LETTRE_RELANCE", "NOM");
1269
        showAs.show("TYPE_REGLEMENT", "NOM");
1326
        showAs.show("TYPE_REGLEMENT", "NOM");
1270
 
1327
 
1271
    }
1328
    }
1272
 
1329
 
1273
    public String setUpSocieteStructure(int base) {
1330
    public String setUpSocieteStructure(int base) {
1274
        setRowSociete(base);
1331
        setRowSociete(base);
1275
 
1332
 
1276
        // find customer
1333
        // find customer
1277
        String customerName = "openconcerto";
1334
        String customerName = "openconcerto";
1278
        final String dbMD = getRootSociete().getMetadata("CUSTOMER");
1335
        final String dbMD = getRootSociete().getMetadata("CUSTOMER");
1279
        if (dbMD != null && !dbMD.equals(customerName))
1336
        if (dbMD != null && !dbMD.equals(customerName))
1280
            throw new IllegalStateException("customer is '" + customerName + "' but db says '" + dbMD + "'");
1337
            throw new IllegalStateException("customer is '" + customerName + "' but db says '" + dbMD + "'");
1281
        return customerName;
1338
        return customerName;
1282
    }
1339
    }
1283
 
1340
 
1284
    @Override
1341
    @Override
1285
    public void setUpSocieteDataBaseConnexion(int base) {
1342
    public void setUpSocieteDataBaseConnexion(int base) {
1286
        final String customerName = setUpSocieteStructure(base);
1343
        final String customerName = setUpSocieteStructure(base);
1287
        final DBRoot rootSociete = this.getRootSociete();
1344
        final DBRoot rootSociete = this.getRootSociete();
1288
 
1345
 
1289
        try {
1346
        try {
1290
            // create table if necessary
1347
            // create table if necessary
1291
            SQLPreferences.getPrefTable(rootSociete);
1348
            SQLPreferences.getPrefTable(rootSociete);
1292
            SQLPreferences.startMemCached(rootSociete);
1349
            SQLPreferences.startMemCached(rootSociete);
1293
        } catch (Exception e) {
1350
        } catch (Exception e) {
1294
            // don't die now, we might not need them
1351
            // don't die now, we might not need them
1295
            ExceptionHandler.handle("Impossible d'accéder aux préférences", e);
1352
            ExceptionHandler.handle("Impossible d'accéder aux préférences", e);
1296
        }
1353
        }
1297
 
1354
 
1298
        closeSocieteConnexion();
1355
        closeSocieteConnexion();
1299
        setSocieteDirectory();
1356
        setSocieteDirectory();
1300
        NumerotationAutoSQLElement.addListeners();
1357
        NumerotationAutoSQLElement.addListeners();
1301
        loadTranslations(this.getTranslator(), rootSociete, Arrays.asList("mappingCompta", "mapping-" + customerName));
1358
        loadTranslations(this.getTranslator(), rootSociete, Arrays.asList("mappingCompta", "mapping-" + customerName));
1302
        setSocieteShowAs();
1359
        setSocieteShowAs();
1303
        setSocieteSQLInjector();
1360
        setSocieteSQLInjector();
1304
        configureGlobalMapper();
1361
        configureGlobalMapper();
1305
        setFieldMapper(new FieldMapper(this.getRootSociete()));
1362
        setFieldMapper(new FieldMapper(this.getRootSociete()));
1306
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1363
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1307
        TemplateNXProps.getInstance();
1364
        TemplateNXProps.getInstance();
1308
        // Prefetch undefined
1365
        // Prefetch undefined
1309
        rootSociete.getTables().iterator().next().getUndefinedID();
1366
        rootSociete.getTables().iterator().next().getUndefinedID();
1310
 
1367
 
1311
        this.getModuleManager().addFactories(Gestion.MODULES_DIR);
-
 
1312
        this.getModuleManager().setup(this.getRootSociete(), this);
1368
        this.getModuleManager().setup(this.getRootSociete(), this);
1313
    }
1369
    }
1314
 
1370
 
1315
    public final ModuleManager getModuleManager() {
1371
    public final ModuleManager getModuleManager() {
1316
        return this.moduleMngr;
1372
        return this.moduleMngr;
1317
    }
1373
    }
1318
 
1374
 
1319
    public void setupBarCodeIfNeeded() {
1375
    public void setupBarCodeIfNeeded() {
1320
        final DBRoot rootSociete = this.getRootSociete();
1376
        final DBRoot rootSociete = this.getRootSociete();
1321
        SQLPreferences pref = SQLPreferences.getMemCached(rootSociete);
1377
        SQLPreferences pref = SQLPreferences.getMemCached(rootSociete);
1322
        if (pref.getBoolean(GestionCommercialeGlobalPreferencePanel.BARCODE_INSERTION, false)) {
1378
        if (pref.getBoolean(GestionCommercialeGlobalPreferencePanel.BARCODE_INSERTION, false)) {
1323
            this.barcodeReader = new BarcodeReader(80);
1379
            this.barcodeReader = new BarcodeReader(80);
1324
            this.barcodeReader.start();
1380
            this.barcodeReader.start();
1325
        }
1381
        }
1326
    }
1382
    }
1327
 
1383
 
1328
    private BarcodeReader barcodeReader = null;
1384
    private BarcodeReader barcodeReader = null;
1329
 
1385
 
1330
    public BarcodeReader getBarcodeReader() {
1386
    public BarcodeReader getBarcodeReader() {
1331
        return barcodeReader;
1387
        return barcodeReader;
1332
    }
1388
    }
1333
 
1389
 
1334
    private void configureGlobalMapper() {
1390
    private void configureGlobalMapper() {
1335
 
1391
 
1336
        FieldMapper fieldMapper = new FieldMapper(this.getRootSociete());
1392
        FieldMapper fieldMapper = new FieldMapper(this.getRootSociete());
1337
        fieldMapper.addMapperStreamFromClass(Gestion.class);
1393
        fieldMapper.addMapperStreamFromClass(Gestion.class);
1338
 
1394
 
1339
    }
1395
    }
1340
 
1396
 
1341
    private void closeSocieteConnexion() {
1397
    private void closeSocieteConnexion() {
1342
 
1398
 
1343
    }
1399
    }
1344
 
1400
 
1345
    public String getServerIp() {
1401
    public String getServerIp() {
1346
        return getProperty("server.ip");
1402
        return getProperty("server.ip");
1347
    }
1403
    }
1348
 
1404
 
1349
    @Override
1405
    @Override
1350
    protected DateFormat getLogDateFormat() {
1406
    protected DateFormat getLogDateFormat() {
1351
        return new SimpleDateFormat("yyyy-MM/dd_HH-mm EEEE");
1407
        return new SimpleDateFormat("yyyy-MM/dd_HH-mm EEEE");
1352
    }
1408
    }
1353
 
1409
 
1354
    @Override
1410
    @Override
1355
    protected SQLServer createServer() {
1411
    protected SQLServer createServer() {
1356
        if (GraphicsEnvironment.isHeadless()) {
1412
        if (GraphicsEnvironment.isHeadless()) {
1357
            return super.createServer();
1413
            return super.createServer();
1358
        }
1414
        }
1359
        InProgressFrame progress = new InProgressFrame();
1415
        InProgressFrame progress = new InProgressFrame();
1360
        if (isOnCloud) {
1416
        if (isOnCloud) {
1361
            progress.show("Connexion au cloud en cours");
1417
            progress.show("Connexion au cloud en cours");
1362
        } else {
1418
        } else {
1363
            progress.show("Connexion à la base de données en cours");
1419
            progress.show("Connexion à la base de données en cours");
1364
        }
1420
        }
1365
        try {
1421
        try {
1366
            SQLServer server = super.createServer();
1422
            SQLServer server = super.createServer();
1367
            return server;
1423
            return server;
1368
        } catch (Throwable e) {
1424
        } catch (Throwable e) {
1369
            if (isOnCloud) {
1425
            if (isOnCloud) {
1370
                JOptionPane.showMessageDialog(null, "Impossible de se connecter au cloud.\n\nVérifiez votre connexion internet.", "Erreur", JOptionPane.ERROR_MESSAGE);
1426
                JOptionPane.showMessageDialog(null, "Impossible de se connecter au cloud.\n\nVérifiez votre connexion internet.", "Erreur", JOptionPane.ERROR_MESSAGE);
1371
            } else {
1427
            } else {
1372
                JOptionPane.showMessageDialog(null, "Impossible de se connecter à la base de données.\n\nVérifiez votre connexion.", "Erreur réseau", JOptionPane.ERROR_MESSAGE);
1428
                JOptionPane.showMessageDialog(null, "Impossible de se connecter à la base de données.\n\nVérifiez votre connexion.", "Erreur réseau", JOptionPane.ERROR_MESSAGE);
1373
            }
1429
            }
1374
            System.exit(1);
1430
            System.exit(1);
1375
            return null;
1431
            return null;
1376
        } finally {
1432
        } finally {
1377
            progress.dispose();
1433
            progress.dispose();
1378
        }
1434
        }
1379
 
1435
 
1380
    }
1436
    }
1381
 
1437
 
1382
    public static ComptaPropsConfiguration getInstanceCompta() {
1438
    public static ComptaPropsConfiguration getInstanceCompta() {
1383
        return (ComptaPropsConfiguration) getInstance();
1439
        return (ComptaPropsConfiguration) getInstance();
1384
    }
1440
    }
1385
 
1441
 
1386
    public String getStorageServer() {
1442
    public String getStorageServer() {
1387
        return this.getProperty("storage.server");
1443
        return this.getProperty("storage.server");
1388
    }
1444
    }
1389
 
1445
 
1390
    public Image getCustomLogo() {
1446
    public Image getCustomLogo() {
1391
        final File dir = new File(getConfFile(getProductInfo()).getParent());
1447
        final File dir = new File(getConfFile(getProductInfo()).getParent());
1392
        final File file = new File(dir, "logo.png");
1448
        final File file = new File(dir, "logo.png");
1393
 
1449
 
1394
        BufferedImage im = null;
1450
        BufferedImage im = null;
1395
        if (file.exists()) {
1451
        if (file.exists()) {
1396
            try {
1452
            try {
1397
                im = ImageIO.read(file);
1453
                im = ImageIO.read(file);
1398
                if (im.getHeight() < 16) {
1454
                if (im.getHeight() < 16) {
1399
                    JOptionPane.showMessageDialog(new JFrame(), "Logo too small (height < 16 pixels)");
1455
                    JOptionPane.showMessageDialog(new JFrame(), "Logo too small (height < 16 pixels)");
1400
                    return null;
1456
                    return null;
1401
                }
1457
                }
1402
                if (im.getWidth() < 200) {
1458
                if (im.getWidth() < 200) {
1403
                    JOptionPane.showMessageDialog(new JFrame(), "Logo too small (width < 200 pixels)");
1459
                    JOptionPane.showMessageDialog(new JFrame(), "Logo too small (width < 200 pixels)");
1404
                    return null;
1460
                    return null;
1405
                }
1461
                }
1406
                final Graphics g = im.getGraphics();
1462
                final Graphics g = im.getGraphics();
1407
 
1463
 
1408
                g.setFont(new Font(Font.SANS_SERIF, Font.ITALIC, 11));
1464
                g.setFont(new Font(Font.SANS_SERIF, Font.ITALIC, 11));
1409
                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
1465
                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
1410
                final String str = "Powered by OpenConcerto";
1466
                final String str = "Powered by OpenConcerto";
1411
                final Rectangle2D r = g.getFontMetrics().getStringBounds(str, g);
1467
                final Rectangle2D r = g.getFontMetrics().getStringBounds(str, g);
1412
                g.setColor(new Color(255, 255, 255, 200));
1468
                g.setColor(new Color(255, 255, 255, 200));
1413
                g.fillRect(0, im.getHeight() - (int) r.getHeight() - 2, (int) r.getWidth() + 8, (int) r.getHeight() + 4);
1469
                g.fillRect(0, im.getHeight() - (int) r.getHeight() - 2, (int) r.getWidth() + 8, (int) r.getHeight() + 4);
1414
                g.setColor(Color.BLACK);
1470
                g.setColor(Color.BLACK);
1415
                g.drawString(str, 4, im.getHeight() - 4);
1471
                g.drawString(str, 4, im.getHeight() - 4);
1416
                g.dispose();
1472
                g.dispose();
1417
            } catch (IOException e) {
1473
            } catch (IOException e) {
1418
                e.printStackTrace();
1474
                e.printStackTrace();
1419
            }
1475
            }
1420
 
1476
 
1421
        }
1477
        }
1422
        return im;
1478
        return im;
1423
    }
1479
    }
1424
 
1480
 
1425
    public synchronized Currency getCurrency() {
1481
    public synchronized Currency getCurrency() {
1426
        if (currency == null) {
1482
        if (currency == null) {
1427
            String code = getRowSociete().getForeign("ID_DEVISE").getString("CODE");
1483
            String code = getRowSociete().getForeign("ID_DEVISE").getString("CODE");
1428
            currency = new Currency(code);
1484
            currency = new Currency(code);
1429
        }
1485
        }
1430
        return currency;
1486
        return currency;
1431
    }
1487
    }
1432
 
1488
 
1433
    public static void checkJava() {
1489
    public static void checkJava() {
1434
        final String javaversion = System.getProperty("java.version");
1490
        final String javaversion = System.getProperty("java.version");
1435
        if (javaversion != null && javaversion.startsWith("1.")) {
1491
        if (javaversion != null && javaversion.startsWith("1.")) {
1436
            final String v = javaversion.substring(2);
1492
            final String v = javaversion.substring(2);
1437
            final StringBuilder b = new StringBuilder();
1493
            final StringBuilder b = new StringBuilder();
1438
            for (int i = 0; i < v.length(); i++) {
1494
            for (int i = 0; i < v.length(); i++) {
1439
                final char c = v.charAt(i);
1495
                final char c = v.charAt(i);
1440
                if (Character.isDigit(c)) {
1496
                if (Character.isDigit(c)) {
1441
                    b.append(c);
1497
                    b.append(c);
1442
                } else {
1498
                } else {
1443
                    break;
1499
                    break;
1444
                }
1500
                }
1445
            }
1501
            }
1446
            final int version = Integer.parseInt(b.toString());
1502
            final int version = Integer.parseInt(b.toString());
1447
            if (version < 8) {
1503
            if (version < 8) {
1448
                System.err.println("Java " + javaversion + " not supported, please upgrade your java from https://www.java.com");
1504
                System.err.println("Java " + javaversion + " not supported, please upgrade your java from https://www.java.com");
1449
                if (GraphicsEnvironment.isHeadless()) {
1505
                if (GraphicsEnvironment.isHeadless()) {
1450
                    JOptionPane.showMessageDialog(null, "Please upgrade your Java.\n\nMerci de mettre à jour votre Java.\n\n https://www.java.com", "Java version", JOptionPane.ERROR_MESSAGE);
1506
                    JOptionPane.showMessageDialog(null, "Please upgrade your Java.\n\nMerci de mettre à jour votre Java.\n\n https://www.java.com", "Java version", JOptionPane.ERROR_MESSAGE);
1451
                }
1507
                }
1452
                System.exit(666);
1508
                System.exit(666);
1453
            }
1509
            }
1454
        }
1510
        }
1455
    }
1511
    }
1456
 
1512
 
1457
}
1513
}