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