OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 180 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 81... Line 81...
81
import org.openconcerto.erp.core.humanresources.employe.element.CommercialSQLElement;
81
import org.openconcerto.erp.core.humanresources.employe.element.CommercialSQLElement;
82
import org.openconcerto.erp.core.humanresources.employe.element.EtatCivilSQLElement;
82
import org.openconcerto.erp.core.humanresources.employe.element.EtatCivilSQLElement;
83
import org.openconcerto.erp.core.humanresources.employe.element.ObjectifSQLElement;
83
import org.openconcerto.erp.core.humanresources.employe.element.ObjectifSQLElement;
84
import org.openconcerto.erp.core.humanresources.employe.element.SituationFamilialeSQLElement;
84
import org.openconcerto.erp.core.humanresources.employe.element.SituationFamilialeSQLElement;
85
import org.openconcerto.erp.core.humanresources.payroll.element.AcompteSQLElement;
85
import org.openconcerto.erp.core.humanresources.payroll.element.AcompteSQLElement;
-
 
86
import org.openconcerto.erp.core.humanresources.payroll.element.ArretChomageIntemperieSQLElement;
86
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitContratPrevSQLElement;
87
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitContratPrevSQLElement;
87
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitSQLElement;
88
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitSQLElement;
88
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitTypeSQLElement;
89
import org.openconcerto.erp.core.humanresources.payroll.element.AyantDroitTypeSQLElement;
89
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationRenseignentSQLElement;
90
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationRenseignentSQLElement;
90
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationSQLElement;
91
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseCotisationSQLElement;
91
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseModePaiementSQLElement;
92
import org.openconcerto.erp.core.humanresources.payroll.element.CaisseModePaiementSQLElement;
92
import org.openconcerto.erp.core.humanresources.payroll.element.ClassementConventionnelSQLElement;
93
import org.openconcerto.erp.core.humanresources.payroll.element.ClassementConventionnelSQLElement;
93
import org.openconcerto.erp.core.humanresources.payroll.element.CodeAmenagementPartielSQLElement;
94
import org.openconcerto.erp.core.humanresources.payroll.element.CodeAmenagementPartielSQLElement;
94
import org.openconcerto.erp.core.humanresources.payroll.element.CodeBaseAssujettieSQLElement;
95
import org.openconcerto.erp.core.humanresources.payroll.element.CodeBaseAssujettieSQLElement;
-
 
96
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseCongesPayesSQLElement;
95
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseTypeRubriqueSQLElement;
97
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaisseTypeRubriqueSQLElement;
96
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaractActiviteSQLElement;
98
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCaractActiviteSQLElement;
97
import org.openconcerto.erp.core.humanresources.payroll.element.CodeContratTravailSQLElement;
99
import org.openconcerto.erp.core.humanresources.payroll.element.CodeContratTravailSQLElement;
98
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationEtablissementSQLElement;
100
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationEtablissementSQLElement;
99
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationIndividuelleSQLElement;
101
import org.openconcerto.erp.core.humanresources.payroll.element.CodeCotisationIndividuelleSQLElement;
Line 129... Line 131...
129
import org.openconcerto.erp.core.humanresources.payroll.element.ImpressionRubriqueSQLElement;
131
import org.openconcerto.erp.core.humanresources.payroll.element.ImpressionRubriqueSQLElement;
130
import org.openconcerto.erp.core.humanresources.payroll.element.InfosSalariePayeSQLElement;
132
import org.openconcerto.erp.core.humanresources.payroll.element.InfosSalariePayeSQLElement;
131
import org.openconcerto.erp.core.humanresources.payroll.element.ModeReglementPayeSQLElement;
133
import org.openconcerto.erp.core.humanresources.payroll.element.ModeReglementPayeSQLElement;
132
import org.openconcerto.erp.core.humanresources.payroll.element.MotifArretTravailSQLElement;
134
import org.openconcerto.erp.core.humanresources.payroll.element.MotifArretTravailSQLElement;
133
import org.openconcerto.erp.core.humanresources.payroll.element.MotifFinContratSQLElement;
135
import org.openconcerto.erp.core.humanresources.payroll.element.MotifFinContratSQLElement;
-
 
136
import org.openconcerto.erp.core.humanresources.payroll.element.MotifNonAssujettisTASQLElement;
134
import org.openconcerto.erp.core.humanresources.payroll.element.MotifRepriseArretTravailSQLElement;
137
import org.openconcerto.erp.core.humanresources.payroll.element.MotifRepriseArretTravailSQLElement;
135
import org.openconcerto.erp.core.humanresources.payroll.element.PasSQLElement;
138
import org.openconcerto.erp.core.humanresources.payroll.element.PasSQLElement;
136
import org.openconcerto.erp.core.humanresources.payroll.element.PeriodeValiditeSQLElement;
139
import org.openconcerto.erp.core.humanresources.payroll.element.PeriodeValiditeSQLElement;
137
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeElementSQLElement;
140
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeElementSQLElement;
138
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeSQLElement;
141
import org.openconcerto.erp.core.humanresources.payroll.element.ProfilPayeSQLElement;
Line 169... Line 172...
169
import org.openconcerto.erp.core.sales.pos.element.ClôtureCaisseSQLElement;
172
import org.openconcerto.erp.core.sales.pos.element.ClôtureCaisseSQLElement;
170
import org.openconcerto.erp.core.sales.pos.element.SaisieVenteComptoirSQLElement;
173
import org.openconcerto.erp.core.sales.pos.element.SaisieVenteComptoirSQLElement;
171
import org.openconcerto.erp.core.sales.pos.element.TicketCaisseSQLElement;
174
import org.openconcerto.erp.core.sales.pos.element.TicketCaisseSQLElement;
172
import org.openconcerto.erp.core.sales.pos.io.BarcodeReader;
175
import org.openconcerto.erp.core.sales.pos.io.BarcodeReader;
173
import org.openconcerto.erp.core.sales.price.element.DeviseSQLElement;
176
import org.openconcerto.erp.core.sales.price.element.DeviseSQLElement;
-
 
177
import org.openconcerto.erp.core.sales.price.element.TarifPromotionSQLElement;
174
import org.openconcerto.erp.core.sales.price.element.TarifSQLElement;
178
import org.openconcerto.erp.core.sales.price.element.TarifSQLElement;
175
import org.openconcerto.erp.core.sales.product.element.ArticleCatComptableSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.ArticleCatComptableSQLElement;
176
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
180
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
-
 
181
import org.openconcerto.erp.core.sales.product.element.ArticleDeclinaisonSQLElement;
177
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
182
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
178
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
183
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
-
 
184
import org.openconcerto.erp.core.sales.product.element.ArticleTarifPromotionSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
185
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
180
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
186
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
181
import org.openconcerto.erp.core.sales.product.element.CustomerProductFamilyQtyPriceSQLElement;
187
import org.openconcerto.erp.core.sales.product.element.CustomerProductFamilyQtyPriceSQLElement;
182
import org.openconcerto.erp.core.sales.product.element.CustomerProductQtyPriceSQLElement;
188
import org.openconcerto.erp.core.sales.product.element.CustomerProductQtyPriceSQLElement;
183
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
189
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
184
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
190
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
185
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
191
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
-
 
192
import org.openconcerto.erp.core.sales.product.element.LotSQLElement;
186
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
193
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
187
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
194
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
188
import org.openconcerto.erp.core.sales.product.element.ProductItemSQLElement;
195
import org.openconcerto.erp.core.sales.product.element.ProductItemSQLElement;
189
import org.openconcerto.erp.core.sales.product.element.ProductQtyPriceSQLElement;
196
import org.openconcerto.erp.core.sales.product.element.ProductQtyPriceSQLElement;
190
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
197
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
191
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement;
198
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement;
192
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement.ReliquatBRSQLElement;
199
import org.openconcerto.erp.core.sales.product.element.ReliquatSQLElement.ReliquatBRSQLElement;
193
import org.openconcerto.erp.core.sales.product.element.SupplierPriceListSQLElement;
200
import org.openconcerto.erp.core.sales.product.element.SupplierPriceListSQLElement;
-
 
201
import org.openconcerto.erp.core.sales.product.element.TaxeCatComptableSQLElement;
194
import org.openconcerto.erp.core.sales.product.element.UniteVenteArticleSQLElement;
202
import org.openconcerto.erp.core.sales.product.element.UniteVenteArticleSQLElement;
195
import org.openconcerto.erp.core.sales.quote.element.DevisItemSQLElement;
203
import org.openconcerto.erp.core.sales.quote.element.DevisItemSQLElement;
196
import org.openconcerto.erp.core.sales.quote.element.DevisLogMailSQLElement;
204
import org.openconcerto.erp.core.sales.quote.element.DevisLogMailSQLElement;
197
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
205
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
198
import org.openconcerto.erp.core.sales.quote.element.EtatDevisSQLElement;
206
import org.openconcerto.erp.core.sales.quote.element.EtatDevisSQLElement;
Line 252... Line 260...
252
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
260
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
253
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
261
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
254
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
262
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
255
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
263
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
256
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
264
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
-
 
265
import org.openconcerto.erp.generationDoc.provider.QteLineDocProvider;
257
import org.openconcerto.erp.generationDoc.provider.QteTotalDocProvider;
266
import org.openconcerto.erp.generationDoc.provider.QteTotalDocProvider;
-
 
267
import org.openconcerto.erp.generationDoc.provider.QteTotalLineDocProvider;
258
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
268
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
259
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
269
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
260
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
270
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
261
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
271
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
262
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
272
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
Line 290... Line 300...
290
import org.openconcerto.erp.injector.CommandeFactureFournisseurSQLInjector;
300
import org.openconcerto.erp.injector.CommandeFactureFournisseurSQLInjector;
291
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
301
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
292
import org.openconcerto.erp.injector.DevisBlSQLInjector;
302
import org.openconcerto.erp.injector.DevisBlSQLInjector;
293
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
303
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
294
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
304
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
-
 
305
import org.openconcerto.erp.injector.DevisEltCmdEltSQLInjector;
295
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
306
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
296
import org.openconcerto.erp.injector.DevisFactureSQLInjector;
307
import org.openconcerto.erp.injector.DevisFactureSQLInjector;
297
import org.openconcerto.erp.injector.DmdAchatDmdPrixEltSQLInjector;
308
import org.openconcerto.erp.injector.DmdAchatDmdPrixEltSQLInjector;
298
import org.openconcerto.erp.injector.DmdPrixCmdSQLInjector;
309
import org.openconcerto.erp.injector.DmdPrixCmdSQLInjector;
299
import org.openconcerto.erp.injector.EcheanceEncaisseSQLInjector;
310
import org.openconcerto.erp.injector.EcheanceEncaisseSQLInjector;
Line 355... Line 366...
355
import java.util.ArrayList;
366
import java.util.ArrayList;
356
import java.util.Arrays;
367
import java.util.Arrays;
357
import java.util.Collection;
368
import java.util.Collection;
358
import java.util.List;
369
import java.util.List;
359
import java.util.Properties;
370
import java.util.Properties;
-
 
371
import java.util.Set;
360
 
372
 
361
import javax.imageio.ImageIO;
373
import javax.imageio.ImageIO;
362
import javax.swing.JFrame;
374
import javax.swing.JFrame;
363
import javax.swing.JOptionPane;
375
import javax.swing.JOptionPane;
364
import javax.swing.SwingUtilities;
376
import javax.swing.SwingUtilities;
Line 436... Line 448...
436
        // Ordre de recherche:
448
        // Ordre de recherche:
437
        // a/ fichier de configuration
449
        // a/ fichier de configuration
438
        // b/ dans le jar
450
        // b/ dans le jar
439
        try {
451
        try {
440
            final Properties props;
452
            final Properties props;
441
            // webstart should be self-contained, e.g. if a user launches from the web it shoudln't
453
            // webstart should be self-contained, e.g. if a user launches from the web it
-
 
454
            // shoudln't
442
            // read an old preference file but should always read its own configuration.
455
            // read an old preference file but should always read its own configuration.
443
            if (confFile != null && confFile.exists() && !inWebStart) {
456
            if (confFile != null && confFile.exists() && !inWebStart) {
444
                props = create(new FileInputStream(confFile), defaults);
457
                props = create(new FileInputStream(confFile), defaults);
445
            } else {
458
            } else {
446
                final InputStream stream = ComptaPropsConfiguration.class.getResourceAsStream(PROPERTIES);
459
                final InputStream stream = ComptaPropsConfiguration.class.getResourceAsStream(PROPERTIES);
Line 472... Line 485...
472
    private boolean isOnCloud;
485
    private boolean isOnCloud;
473
    private boolean isPortable;
486
    private boolean isPortable;
474
    private File portableDir = null;
487
    private File portableDir = null;
475
    private Currency currency = null;
488
    private Currency currency = null;
476
    private final ModuleManager moduleMngr = new ModuleManager();
489
    private final ModuleManager moduleMngr = new ModuleManager();
-
 
490
    private boolean isExperimental;
477
 
491
 
478
    public ComptaPropsConfiguration(Properties props, final ProductInfo productInfo) {
492
    public ComptaPropsConfiguration(Properties props, final ProductInfo productInfo) {
479
        super(props, productInfo);
493
        super(props, productInfo);
480
        this.isServerless = false;
494
        this.isServerless = false;
481
        this.isMain = true;
495
        this.isMain = true;
Line 486... Line 500...
486
    public ComptaPropsConfiguration(Properties props, final boolean inWebstart, final boolean main) {
500
    public ComptaPropsConfiguration(Properties props, final boolean inWebstart, final boolean main) {
487
        super(props, productInfo);
501
        super(props, productInfo);
488
        this.isMain = main;
502
        this.isMain = main;
489
        this.inWebstart = inWebstart;
503
        this.inWebstart = inWebstart;
490
        this.isPortable = Boolean.parseBoolean(this.getProperty("portable", "false"));
504
        this.isPortable = Boolean.parseBoolean(this.getProperty("portable", "false"));
-
 
505
        this.isExperimental = Boolean.parseBoolean(this.getProperty("experimental", "false"));
491
        String pDir = this.getProperty("portableDir", null);
506
        String pDir = this.getProperty("portableDir", null);
492
        if (isPortable) {
507
        if (isPortable) {
493
            if (pDir == null) {
508
            if (pDir == null) {
494
                System.out.println("Portable mode, using current directory");
509
                System.out.println("Portable mode, using current directory");
495
                portableDir = new File(".");
510
                portableDir = new File(".");
Line 575... Line 590...
575
                    setProperty("server.password", "openconcerto");
590
                    setProperty("server.password", "openconcerto");
576
                }
591
                }
577
            }
592
            }
578
            this.setProperty("server.ip", getProperty("server.ip").replace(DATA_DIR_VAR, getDataDir().getPath()));
593
            this.setProperty("server.ip", getProperty("server.ip").replace(DATA_DIR_VAR, getDataDir().getPath()));
579
            final SQLSystem system = getSystem();
594
            final SQLSystem system = getSystem();
580
            this.isServerless = system == SQLSystem.H2 && system.getHostname(getServerIp()) == null;
595
            this.isServerless = system == SQLSystem.H2 && system.getHostnameAndPath(getServerIp()).get0() == null;
581
        }
596
        }
582
        if (this.isMain) {
597
        if (this.isMain) {
583
            // ATTN this works because this is executed last (i.e. if you put this in a superclass
598
            // ATTN this works because this is executed last (i.e. if you put this in a
-
 
599
            // superclass
584
            // this won't work since e.g. app.name won't have its correct value)
600
            // this won't work since e.g. app.name won't have its correct value)
585
            try {
601
            try {
586
                this.setupLogging("logs");
602
                this.setupLogging("logs");
587
            } catch (Exception e) {
603
            } catch (Exception e) {
588
                System.err.println("ComptaPropsConfiguration() error in log setup : " + e.getMessage());
604
                System.err.println("ComptaPropsConfiguration() error in log setup : " + e.getMessage());
589
            }
605
            }
590
            registerAccountingProvider();
606
            registerAccountingProvider();
591
            registerCellValueProvider();
607
            registerCellValueProvider();
592
        }
608
        }
-
 
609
 
-
 
610
        // Early so that other apps may add jars before setUpSocieteDataBaseConnexion()
-
 
611
        // Perhaps add a folder relative to VMLauncher.getJPackageAppDir()
-
 
612
        this.getModuleManager().setFolders(new File(Gestion.MODULES_DIR_NAME), new File(this.getBaseDirs().getAppDataFolder(), Gestion.MODULES_DIR_NAME));
593
    }
613
    }
594
 
614
 
595
    public final TM getERP_TM() {
615
    public final TM getERP_TM() {
596
        return TM.getERP_TM(this.getLocale());
616
        return TM.getERP_TM(this.getLocale());
597
    }
617
    }
Line 620... Line 640...
620
        AdresseVilleClientValueProvider.register();
640
        AdresseVilleClientValueProvider.register();
621
        AdresseVilleCPClientValueProvider.register();
641
        AdresseVilleCPClientValueProvider.register();
622
        AdresseVilleNomClientValueProvider.register();
642
        AdresseVilleNomClientValueProvider.register();
623
        AdresseFullClientValueProvider.register();
643
        AdresseFullClientValueProvider.register();
624
        QteTotalProvider.register();
644
        QteTotalProvider.register();
-
 
645
        QteLineDocProvider.register();
-
 
646
        QteTotalLineDocProvider.register();
625
        QteTotalDocProvider.register();
647
        QteTotalDocProvider.register();
626
        StockLocationProvider.register();
648
        StockLocationProvider.register();
627
        RefClientValueProvider.register();
649
        RefClientValueProvider.register();
628
        ModeDeReglementDetailsProvider.register();
650
        ModeDeReglementDetailsProvider.register();
629
        FormatedGlobalQtyTotalProvider.register();
651
        FormatedGlobalQtyTotalProvider.register();
Line 655... Line 677...
655
 
677
 
656
    public String getToken() {
678
    public String getToken() {
657
        return getProperty("token");
679
        return getProperty("token");
658
    }
680
    }
659
 
681
 
-
 
682
    public boolean isExperimental() {
-
 
683
        return isExperimental;
-
 
684
    }
-
 
685
 
660
    public final boolean isServerless() {
686
    public final boolean isServerless() {
661
        return this.isServerless;
687
        return this.isServerless;
662
    }
688
    }
663
 
689
 
664
    public final boolean isOnCloud() {
690
    public final boolean isOnCloud() {
Line 720... Line 746...
720
    private final void createDB(final DBSystemRoot sysRoot) {
746
    private final void createDB(final DBSystemRoot sysRoot) {
721
        if (!this.isServerless())
747
        if (!this.isServerless())
722
            return;
748
            return;
723
        try {
749
        try {
724
            // H2 create the database on connection
750
            // H2 create the database on connection
725
            // don't create if root explicitly excluded (e.g. map no roots just to quickly test
751
            // don't create if root explicitly excluded (e.g. map no roots just to quickly
-
 
752
            // test
726
            // connection)
753
            // connection)
727
            if (sysRoot.shouldMap(getRootName()) && !sysRoot.contains(getRootName())) {
754
            if (sysRoot.shouldMap(getRootName()) && !sysRoot.contains(getRootName())) {
728
                Log.get().warning("Creating DB");
755
                Log.get().warning("Creating DB");
729
                String createScript = null;
756
                String createScript = null;
730
                try {
757
                try {
Line 747... Line 774...
747
    }
774
    }
748
 
775
 
749
    @Override
776
    @Override
750
    protected DBSystemRoot createSystemRoot() {
777
    protected DBSystemRoot createSystemRoot() {
751
        final DBSystemRoot res = super.createSystemRoot();
778
        final DBSystemRoot res = super.createSystemRoot();
752
        // Don't create a separate server for createDB() as on normal databases just setting up a
779
        // Don't create a separate server for createDB() as on normal databases just
-
 
780
        // setting up a
753
        // data source can take 2 seconds (e.g. validateConnectionFactory()). And this is for every
781
        // data source can take 2 seconds (e.g. validateConnectionFactory()). And this
-
 
782
        // is for every
754
        // boot.
783
        // boot.
755
        this.createDB(res);
784
        this.createDB(res);
756
        return res;
785
        return res;
757
    }
786
    }
758
 
787
 
Line 775... Line 804...
775
        // DSN
804
        // DSN
776
        dir.addSQLElement(CaisseCotisationRenseignentSQLElement.class, root);
805
        dir.addSQLElement(CaisseCotisationRenseignentSQLElement.class, root);
777
        dir.addSQLElement(CodeBaseAssujettieSQLElement.class, root);
806
        dir.addSQLElement(CodeBaseAssujettieSQLElement.class, root);
778
        dir.addSQLElement(ContratModaliteTempsSQLElement.class, root);
807
        dir.addSQLElement(ContratModaliteTempsSQLElement.class, root);
779
        dir.addSQLElement(CodeCaisseTypeRubriqueSQLElement.class, root);
808
        dir.addSQLElement(CodeCaisseTypeRubriqueSQLElement.class, root);
-
 
809
        dir.addSQLElement(CodeCaisseCongesPayesSQLElement.class, root);
-
 
810
        dir.addSQLElement(MotifNonAssujettisTASQLElement.class, root);
780
        dir.addSQLElement(CodeTypeRubriqueBrutSQLElement.class, root);
811
        dir.addSQLElement(CodeTypeRubriqueBrutSQLElement.class, root);
781
        dir.addSQLElement(MotifArretTravailSQLElement.class, root);
812
        dir.addSQLElement(MotifArretTravailSQLElement.class, root);
782
        dir.addSQLElement(ContratDispositifPolitiqueSQLElement.class, root);
813
        dir.addSQLElement(ContratDispositifPolitiqueSQLElement.class, root);
783
        dir.addSQLElement(ContratDetacheExpatrieSQLElement.class, root);
814
        dir.addSQLElement(ContratDetacheExpatrieSQLElement.class, root);
784
        dir.addSQLElement(ContratRegimeMaladieSQLElement.class, root);
815
        dir.addSQLElement(ContratRegimeMaladieSQLElement.class, root);
Line 814... Line 845...
814
        dir.addSQLElement(TypeComposantBaseAssujettieSQLElement.class, root);
845
        dir.addSQLElement(TypeComposantBaseAssujettieSQLElement.class, root);
815
        dir.addSQLElement(CaisseModePaiementSQLElement.class, root);
846
        dir.addSQLElement(CaisseModePaiementSQLElement.class, root);
816
        dir.addSQLElement(CodeCotisationIndividuelleSQLElement.class, root);
847
        dir.addSQLElement(CodeCotisationIndividuelleSQLElement.class, root);
817
        dir.addSQLElement(CodeCotisationEtablissementSQLElement.class, root);
848
        dir.addSQLElement(CodeCotisationEtablissementSQLElement.class, root);
818
        dir.addSQLElement(CodePenibiliteSQLElement.class, root);
849
        dir.addSQLElement(CodePenibiliteSQLElement.class, root);
-
 
850
        dir.addSQLElement(CodeIdccSQLElement.class, root);
-
 
851
 
819
        dir.addSQLElement(new ImpressionRubriqueSQLElement(root));
852
        dir.addSQLElement(new ImpressionRubriqueSQLElement(root));
820
 
853
 
821
        dir.addSQLElement(new VariablePayeSQLElement(root));
854
        dir.addSQLElement(new VariablePayeSQLElement(root));
822
 
855
 
823
        return dir;
856
        return dir;
Line 829... Line 862...
829
            if (!this.getRootSociete().getTable("SAISIE_VENTE_FACTURE").contains("T_ACOMPTE")) {
862
            if (!this.getRootSociete().getTable("SAISIE_VENTE_FACTURE").contains("T_ACOMPTE")) {
830
                throw new DBStructureItemNotFound("Base de données non à jour");
863
                throw new DBStructureItemNotFound("Base de données non à jour");
831
            }
864
            }
832
            // Check 1.6 updated
865
            // Check 1.6 updated
833
            if (!this.getRootSociete().contains("ETAT_STOCK")) {
866
            if (!this.getRootSociete().contains("ETAT_STOCK")) {
834
                throw new DBStructureItemNotFound("Base de données non à jour");
867
                throw new DBStructureItemNotFound("Base de données non à jour (<1.6)");
-
 
868
            }
-
 
869
            // Check 1.7 updated
-
 
870
            if (!this.getRootSociete().contains("AGENCE")) {
-
 
871
                throw new DBStructureItemNotFound("Base de données non à jour (< 1.7.0)");
-
 
872
            }
-
 
873
            if (!this.getRootSociete().getTable("NUMEROTATION_AUTO").contains("ARTICLE_FORMAT")) {
-
 
874
                throw new DBStructureItemNotFound("Base de données non à jour (< 1.7.1)");
835
            }
875
            }
836
            SQLElementDirectory dir = this.getDirectory();
876
            SQLElementDirectory dir = this.getDirectory();
837
 
877
 
838
            dir.addSQLElement(AttachmentSQLElement.class);
878
            dir.addSQLElement(AttachmentSQLElement.class);
839
 
879
 
Line 847... Line 887...
847
            dir.addSQLElement(ReliquatSQLElement.class);
887
            dir.addSQLElement(ReliquatSQLElement.class);
848
            dir.addSQLElement(ProductQtyPriceSQLElement.class);
888
            dir.addSQLElement(ProductQtyPriceSQLElement.class);
849
            dir.addSQLElement(ProductItemSQLElement.class);
889
            dir.addSQLElement(ProductItemSQLElement.class);
850
            dir.addSQLElement(CategorieComptableSQLElement.class);
890
            dir.addSQLElement(CategorieComptableSQLElement.class);
851
            dir.addSQLElement(ArticleCatComptableSQLElement.class);
891
            dir.addSQLElement(ArticleCatComptableSQLElement.class);
-
 
892
            dir.addSQLElement(TaxeCatComptableSQLElement.class);
852
            dir.addSQLElement(ArticleFournisseurSecondaireSQLElement.class);
893
            dir.addSQLElement(ArticleFournisseurSecondaireSQLElement.class);
853
            dir.addSQLElement(SupplierPriceListSQLElement.class);
894
            dir.addSQLElement(SupplierPriceListSQLElement.class);
854
            dir.addSQLElement(FraisDocumentSQLElement.class);
895
            dir.addSQLElement(FraisDocumentSQLElement.class);
855
            dir.addSQLElement(ArticleDesignationSQLElement.class);
896
            dir.addSQLElement(ArticleDesignationSQLElement.class);
856
            dir.addSQLElement(BanqueSQLElement.class);
897
            dir.addSQLElement(BanqueSQLElement.class);
Line 884... Line 925...
884
            dir.addSQLElement(new AvoirClientElementSQLElement());
925
            dir.addSQLElement(new AvoirClientElementSQLElement());
885
            dir.addSQLElement(AvoirFournisseurSQLElement.class);
926
            dir.addSQLElement(AvoirFournisseurSQLElement.class);
886
            dir.addSQLElement(new AcompteSQLElement());
927
            dir.addSQLElement(new AcompteSQLElement());
887
 
928
 
888
            dir.addSQLElement(new AxeAnalytiqueSQLElement());
929
            dir.addSQLElement(new AxeAnalytiqueSQLElement());
-
 
930
            Set<SQLTable> tablesInRoot = dir.getElement(ReferenceArticleSQLElement.class).getTable().getDBRoot().getTables();
-
 
931
            for (SQLTable table : tablesInRoot) {
-
 
932
                if (table.getName().startsWith("ARTICLE_DECLINAISON_")) {
-
 
933
                    dir.addSQLElement(new ArticleDeclinaisonSQLElement(table.getName()));
-
 
934
                }
-
 
935
            }
889
 
936
 
-
 
937
            dir.addSQLElement(LotSQLElement.class);
890
            dir.addSQLElement(new BonDeLivraisonItemSQLElement());
938
            dir.addSQLElement(new BonDeLivraisonItemSQLElement());
891
            dir.addSQLElement(new BonDeLivraisonSQLElement());
939
            dir.addSQLElement(new BonDeLivraisonSQLElement());
892
            dir.addSQLElement(new TransferShipmentSQLElement());
940
            dir.addSQLElement(new TransferShipmentSQLElement());
893
 
941
 
894
            dir.addSQLElement(new BonReceptionElementSQLElement());
942
            dir.addSQLElement(new BonReceptionElementSQLElement());
Line 970... Line 1018...
970
            dir.addSQLElement(new FichePayeSQLElement());
1018
            dir.addSQLElement(new FichePayeSQLElement());
971
            dir.addSQLElement(new FichePayeElementSQLElement());
1019
            dir.addSQLElement(new FichePayeElementSQLElement());
972
 
1020
 
973
            dir.addSQLElement(new FournisseurSQLElement());
1021
            dir.addSQLElement(new FournisseurSQLElement());
974
 
1022
 
975
            dir.addSQLElement(new CodeIdccSQLElement());
-
 
976
 
-
 
977
            dir.addSQLElement(new InfosSalariePayeSQLElement());
1023
            dir.addSQLElement(new InfosSalariePayeSQLElement());
978
 
1024
 
979
            dir.addSQLElement(new JournalSQLElement());
1025
            dir.addSQLElement(new JournalSQLElement());
980
 
1026
 
981
            dir.addSQLElement(LangueSQLElement.class);
1027
            dir.addSQLElement(LangueSQLElement.class);
Line 1019... Line 1065...
1019
                dir.addSQLElement(new SaisieVenteFactureItemSQLElement(this));
1065
                dir.addSQLElement(new SaisieVenteFactureItemSQLElement(this));
1020
 
1066
 
1021
            dir.addSQLElement(SituationFamilialeSQLElement.class);
1067
            dir.addSQLElement(SituationFamilialeSQLElement.class);
1022
            dir.addSQLElement(new StockSQLElement());
1068
            dir.addSQLElement(new StockSQLElement());
1023
            dir.addSQLElement(new StyleSQLElement());
1069
            dir.addSQLElement(new StyleSQLElement());
1024
 
-
 
1025
            dir.addSQLElement(new SalarieSQLElement());
-
 
1026
 
-
 
1027
            dir.addSQLElement(TarifSQLElement.class);
1070
            dir.addSQLElement(TarifSQLElement.class);
-
 
1071
            dir.addSQLElement(TarifPromotionSQLElement.class);
-
 
1072
            dir.addSQLElement(ArticleTarifPromotionSQLElement.class);
1028
            dir.addSQLElement(new TaxeSQLElement());
1073
            dir.addSQLElement(new TaxeSQLElement());
1029
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
1074
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
1030
            dir.addSQLElement(TicketCaisseSQLElement.class);
1075
            dir.addSQLElement(TicketCaisseSQLElement.class);
1031
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
1076
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
1032
            dir.addSQLElement(CaisseJournalSQLElement.class);
1077
            dir.addSQLElement(CaisseJournalSQLElement.class);
Line 1034... Line 1079...
1034
            dir.addSQLElement(new TypeComptePCGSQLElement());
1079
            dir.addSQLElement(new TypeComptePCGSQLElement());
1035
            dir.addSQLElement(new TypeLettreRelanceSQLElement());
1080
            dir.addSQLElement(new TypeLettreRelanceSQLElement());
1036
            dir.addSQLElement(new TypeReglementSQLElement());
1081
            dir.addSQLElement(new TypeReglementSQLElement());
1037
            dir.addSQLElement(new SDDMessageSQLElement(this));
1082
            dir.addSQLElement(new SDDMessageSQLElement(this));
1038
            dir.addSQLElement(new SEPAMandateSQLElement(this));
1083
            dir.addSQLElement(new SEPAMandateSQLElement(this));
-
 
1084
            dir.addSQLElement(TarifSQLElement.class);
-
 
1085
            dir.addSQLElement(TarifPromotionSQLElement.class);
-
 
1086
            dir.addSQLElement(ArticleTarifPromotionSQLElement.class);
-
 
1087
            dir.addSQLElement(new TaxeSQLElement());
-
 
1088
            dir.addSQLElement(TaxeComplementaireSQLElement.class);
-
 
1089
            dir.addSQLElement(TicketCaisseSQLElement.class);
-
 
1090
            dir.addSQLElement(ClôtureCaisseSQLElement.class);
-
 
1091
            dir.addSQLElement(CaisseJournalSQLElement.class);
1039
 
1092
 
1040
            dir.addSQLElement(new VariableSalarieSQLElement());
1093
            dir.addSQLElement(new VariableSalarieSQLElement());
-
 
1094
            dir.addSQLElement(SalarieSQLElement.class);
1041
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1095
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1042
 
1096
 
1043
            dir.addSQLElement(CalendarItemSQLElement.class);
1097
            dir.addSQLElement(CalendarItemSQLElement.class);
1044
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1098
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1045
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
1099
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
1046
            dir.addSQLElement(EmailTemplateSQLElement.class);
1100
            dir.addSQLElement(EmailTemplateSQLElement.class);
1047
 
1101
 
-
 
1102
            dir.addSQLElement(ArretChomageIntemperieSQLElement.class);
-
 
1103
 
1048
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1104
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1049
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1105
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1050
            }
1106
            }
1051
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
1107
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
1052
                dir.addSQLElement(new FWKSessionState(getRootSociete()));
1108
                dir.addSQLElement(new FWKSessionState(getRootSociete()));
Line 1107... Line 1163...
1107
        new FactureAvoirSQLInjector(rootSociete);
1163
        new FactureAvoirSQLInjector(rootSociete);
1108
        new FactureBonSQLInjector(rootSociete);
1164
        new FactureBonSQLInjector(rootSociete);
1109
        new FactureCommandeSQLInjector(rootSociete);
1165
        new FactureCommandeSQLInjector(rootSociete);
1110
        new DevisFactureSQLInjector(rootSociete);
1166
        new DevisFactureSQLInjector(rootSociete);
1111
        new DevisCommandeSQLInjector(rootSociete);
1167
        new DevisCommandeSQLInjector(rootSociete);
-
 
1168
        new DevisEltCmdEltSQLInjector(rootSociete);
1112
        new DevisCommandeFournisseurSQLInjector(rootSociete);
1169
        new DevisCommandeFournisseurSQLInjector(rootSociete);
1113
        new DevisBlEltSQLInjector(rootSociete);
1170
        new DevisBlEltSQLInjector(rootSociete);
1114
        new DevisBlSQLInjector(rootSociete);
1171
        new DevisBlSQLInjector(rootSociete);
1115
        new CommandeBlEltSQLInjector(rootSociete);
1172
        new CommandeBlEltSQLInjector(rootSociete);
1116
        new CmdEltFactEltSQLInjector(rootSociete);
1173
        new CmdEltFactEltSQLInjector(rootSociete);
Line 1189... Line 1246...
1189
        showAs.show("CONTACT", "NOM");
1246
        showAs.show("CONTACT", "NOM");
1190
        showAs.show("CONTRAT_SALARIE", "NATURE");
1247
        showAs.show("CONTRAT_SALARIE", "NATURE");
1191
 
1248
 
1192
        List<String> listFieldDevisElt = new ArrayList<String>();
1249
        List<String> listFieldDevisElt = new ArrayList<String>();
1193
        listFieldDevisElt.add("NUMERO");
1250
        listFieldDevisElt.add("NUMERO");
-
 
1251
        listFieldDevisElt.add("OBJET");
1194
        listFieldDevisElt.add("DATE");
1252
        listFieldDevisElt.add("DATE");
1195
        listFieldDevisElt.add("ID_CLIENT");
1253
        listFieldDevisElt.add("ID_CLIENT");
-
 
1254
        if (root.getTable("DEVIS").contains("DATE_LIVRAISON")) {
-
 
1255
            listFieldDevisElt.add("DATE_LIVRAISON");
-
 
1256
        }
-
 
1257
        if (root.getTable("DEVIS").contains("TRANSFORMATION")) {
-
 
1258
            listFieldDevisElt.add("TRANSFORMATION");
-
 
1259
        }
1196
 
1260
 
1197
        listFieldDevisElt.add("ID_ETAT_DEVIS");
1261
        listFieldDevisElt.add("ID_ETAT_DEVIS");
1198
        showAs.showField("DEVIS_ELEMENT.ID_DEVIS", listFieldDevisElt);
1262
        showAs.showField("DEVIS_ELEMENT.ID_DEVIS", listFieldDevisElt);
1199
 
1263
 
1200
        showAs.show("DEPARTEMENT", "NUMERO", "NOM");
1264
        showAs.show("DEPARTEMENT", "NUMERO", "NOM");
Line 1241... Line 1305...
1241
        showAs.showField("REGLER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1305
        showAs.showField("REGLER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1242
        showAs.showField("ENCAISSER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1306
        showAs.showField("ENCAISSER_MONTANT.ID_MODE_REGLEMENT", listFieldModReglMontant);
1243
 
1307
 
1244
        List<String> listFieldFactureElt = new ArrayList<String>();
1308
        List<String> listFieldFactureElt = new ArrayList<String>();
1245
        listFieldFactureElt.add("NUMERO");
1309
        listFieldFactureElt.add("NUMERO");
-
 
1310
        listFieldFactureElt.add("NOM");
1246
        listFieldFactureElt.add("DATE");
1311
        listFieldFactureElt.add("DATE");
1247
        listFieldFactureElt.add("ID_COMMERCIAL");
1312
        listFieldFactureElt.add("ID_COMMERCIAL");
1248
        listFieldFactureElt.add("ID_CLIENT");
1313
        listFieldFactureElt.add("ID_CLIENT");
1249
        showAs.showField("SAISIE_VENTE_FACTURE_ELEMENT.ID_SAISIE_VENTE_FACTURE", listFieldFactureElt);
1314
        showAs.showField("SAISIE_VENTE_FACTURE_ELEMENT.ID_SAISIE_VENTE_FACTURE", listFieldFactureElt);
1250
 
-
 
1251
        showAs.show("SALARIE", SQLRow.toList("CODE,NOM,PRENOM"));
1315
        showAs.show("SALARIE", SQLRow.toList("CODE,NOM,PRENOM"));
1252
 
-
 
1253
        showAs.show("SITUATION_FAMILIALE", "NOM");
1316
        showAs.show("SITUATION_FAMILIALE", "NOM");
1254
        if (root.getTable("STOCK").contains("ID_ARTICLE")) {
-
 
1255
            List<String> listFieldArtElt = new ArrayList<String>();
-
 
1256
            listFieldArtElt.add("CODE");
-
 
1257
            listFieldArtElt.add("NOM");
-
 
1258
            listFieldArtElt.add("ID_FAMILLE_ARTICLE");
-
 
1259
            showAs.showField("STOCK.ID_ARTICLE", listFieldArtElt);
-
 
1260
        }
1317
 
1261
        showAs.show("STYLE", "NOM");
1318
        showAs.show("STYLE", "NOM");
1262
 
1319
 
1263
        showAs.show("TAXE", "TAUX");
1320
        showAs.show("TAXE", "TAUX");
1264
 
1321
 
1265
        showAs.show(directory.getElement("TITRE_PERSONNEL").getTable(), asList("NOM"));
1322
        showAs.show(directory.getElement("TITRE_PERSONNEL").getTable(), asList("NOM"));
Line 1306... Line 1363...
1306
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1363
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1307
        TemplateNXProps.getInstance();
1364
        TemplateNXProps.getInstance();
1308
        // Prefetch undefined
1365
        // Prefetch undefined
1309
        rootSociete.getTables().iterator().next().getUndefinedID();
1366
        rootSociete.getTables().iterator().next().getUndefinedID();
1310
 
1367
 
1311
        this.getModuleManager().addFactories(Gestion.MODULES_DIR);
-
 
1312
        this.getModuleManager().setup(this.getRootSociete(), this);
1368
        this.getModuleManager().setup(this.getRootSociete(), this);
1313
    }
1369
    }
1314
 
1370
 
1315
    public final ModuleManager getModuleManager() {
1371
    public final ModuleManager getModuleManager() {
1316
        return this.moduleMngr;
1372
        return this.moduleMngr;