OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Rev 182 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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