OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 25... Line 25...
25
import org.openconcerto.erp.core.common.element.PaysSQLElement;
25
import org.openconcerto.erp.core.common.element.PaysSQLElement;
26
import org.openconcerto.erp.core.common.element.SocieteCommonSQLElement;
26
import org.openconcerto.erp.core.common.element.SocieteCommonSQLElement;
27
import org.openconcerto.erp.core.common.element.StyleSQLElement;
27
import org.openconcerto.erp.core.common.element.StyleSQLElement;
28
import org.openconcerto.erp.core.common.element.TitrePersonnelSQLElement;
28
import org.openconcerto.erp.core.common.element.TitrePersonnelSQLElement;
29
import org.openconcerto.erp.core.customerrelationship.customer.element.ClientDepartementSQLElement;
29
import org.openconcerto.erp.core.customerrelationship.customer.element.ClientDepartementSQLElement;
-
 
30
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactAdministratifSQLElement;
-
 
31
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactFournisseurSQLElement;
-
 
32
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSQLElement;
-
 
33
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement.ContactSalarieSQLElement;
30
import org.openconcerto.erp.core.customerrelationship.customer.element.CompteClientTransactionSQLELement;
34
import org.openconcerto.erp.core.customerrelationship.customer.element.CompteClientTransactionSQLELement;
31
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement;
-
 
32
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement.ContactAdministratifSQLElement;
-
 
33
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement.ContactFournisseurSQLElement;
-
 
34
import org.openconcerto.erp.core.customerrelationship.customer.element.CourrierClientSQLElement;
35
import org.openconcerto.erp.core.customerrelationship.customer.element.CourrierClientSQLElement;
35
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerCategorySQLElement;
36
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerCategorySQLElement;
36
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
37
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
37
import org.openconcerto.erp.core.customerrelationship.customer.element.ModeleCourrierClientSQLElement;
38
import org.openconcerto.erp.core.customerrelationship.customer.element.ModeleCourrierClientSQLElement;
38
import org.openconcerto.erp.core.customerrelationship.customer.element.ReferenceClientSQLElement;
39
import org.openconcerto.erp.core.customerrelationship.customer.element.ReferenceClientSQLElement;
39
import org.openconcerto.erp.core.customerrelationship.customer.element.RelanceSQLElement;
40
import org.openconcerto.erp.core.customerrelationship.customer.element.RelanceSQLElement;
40
import org.openconcerto.erp.core.customerrelationship.customer.element.TypeLettreRelanceSQLElement;
41
import org.openconcerto.erp.core.customerrelationship.customer.element.TypeLettreRelanceSQLElement;
-
 
42
import org.openconcerto.erp.core.customerrelationship.mail.EmailTemplateSQLElement;
41
import org.openconcerto.erp.core.edm.AttachmentSQLElement;
43
import org.openconcerto.erp.core.edm.AttachmentSQLElement;
42
import org.openconcerto.erp.core.finance.accounting.element.AssociationAnalytiqueSQLElement;
44
import org.openconcerto.erp.core.finance.accounting.element.AssociationAnalytiqueSQLElement;
43
import org.openconcerto.erp.core.finance.accounting.element.AssociationCompteAnalytiqueSQLElement;
45
import org.openconcerto.erp.core.finance.accounting.element.AssociationCompteAnalytiqueSQLElement;
44
import org.openconcerto.erp.core.finance.accounting.element.AxeAnalytiqueSQLElement;
46
import org.openconcerto.erp.core.finance.accounting.element.AxeAnalytiqueSQLElement;
45
import org.openconcerto.erp.core.finance.accounting.element.CategorieComptableSQLElement;
47
import org.openconcerto.erp.core.finance.accounting.element.CategorieComptableSQLElement;
Line 170... Line 172...
170
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
172
import org.openconcerto.erp.core.sales.product.element.ArticleCodeClientSQLElement;
171
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
173
import org.openconcerto.erp.core.sales.product.element.ArticleDesignationSQLElement;
172
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
174
import org.openconcerto.erp.core.sales.product.element.ArticleFournisseurSecondaireSQLElement;
173
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
175
import org.openconcerto.erp.core.sales.product.element.ArticleTarifSQLElement;
174
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
176
import org.openconcerto.erp.core.sales.product.element.CoutRevientSQLElement;
-
 
177
import org.openconcerto.erp.core.sales.product.element.CustomerProductQtyPriceSQLElement;
175
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
178
import org.openconcerto.erp.core.sales.product.element.EcoContributionSQLElement;
176
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.FamilleArticleSQLElement;
177
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
180
import org.openconcerto.erp.core.sales.product.element.FamilleEcoContributionSQLElement;
178
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
181
import org.openconcerto.erp.core.sales.product.element.MetriqueSQLElement;
179
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
182
import org.openconcerto.erp.core.sales.product.element.ModeVenteArticleSQLElement;
Line 225... Line 228...
225
import org.openconcerto.erp.generationDoc.provider.AdresseRueClientValueProvider;
228
import org.openconcerto.erp.generationDoc.provider.AdresseRueClientValueProvider;
226
import org.openconcerto.erp.generationDoc.provider.AdresseVilleCPClientValueProvider;
229
import org.openconcerto.erp.generationDoc.provider.AdresseVilleCPClientValueProvider;
227
import org.openconcerto.erp.generationDoc.provider.AdresseVilleClientValueProvider;
230
import org.openconcerto.erp.generationDoc.provider.AdresseVilleClientValueProvider;
228
import org.openconcerto.erp.generationDoc.provider.AdresseVilleNomClientValueProvider;
231
import org.openconcerto.erp.generationDoc.provider.AdresseVilleNomClientValueProvider;
229
import org.openconcerto.erp.generationDoc.provider.ArticleCodeClientProvider;
232
import org.openconcerto.erp.generationDoc.provider.ArticleCodeClientProvider;
-
 
233
import org.openconcerto.erp.generationDoc.provider.ArticleCodeFournisseurProvider;
230
import org.openconcerto.erp.generationDoc.provider.ConditionsReglementDetailsProvider;
234
import org.openconcerto.erp.generationDoc.provider.ConditionsReglementDetailsProvider;
231
import org.openconcerto.erp.generationDoc.provider.DateBLProvider;
235
import org.openconcerto.erp.generationDoc.provider.DateBLProvider;
232
import org.openconcerto.erp.generationDoc.provider.DateProvider;
236
import org.openconcerto.erp.generationDoc.provider.DateProvider;
233
import org.openconcerto.erp.generationDoc.provider.FacturableValueProvider;
237
import org.openconcerto.erp.generationDoc.provider.FacturableValueProvider;
234
import org.openconcerto.erp.generationDoc.provider.FormatedGlobalQtyTotalProvider;
238
import org.openconcerto.erp.generationDoc.provider.FormatedGlobalQtyTotalProvider;
Line 238... Line 242...
238
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
242
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedDevisProvider;
239
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
243
import org.openconcerto.erp.generationDoc.provider.PaiementRemainedProvider;
240
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
244
import org.openconcerto.erp.generationDoc.provider.PrixUVProvider;
241
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
245
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireProvider;
242
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
246
import org.openconcerto.erp.generationDoc.provider.PrixUnitaireRemiseProvider;
-
 
247
import org.openconcerto.erp.generationDoc.provider.QteTotalDocProvider;
243
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
248
import org.openconcerto.erp.generationDoc.provider.QteTotalProvider;
244
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
249
import org.openconcerto.erp.generationDoc.provider.RecapFactureProvider;
245
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
250
import org.openconcerto.erp.generationDoc.provider.RefClientValueProvider;
246
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
251
import org.openconcerto.erp.generationDoc.provider.RemiseProvider;
247
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
252
import org.openconcerto.erp.generationDoc.provider.RemiseTotalProvider;
Line 267... Line 272...
267
import org.openconcerto.erp.injector.CommandeBrEltSQLInjector;
272
import org.openconcerto.erp.injector.CommandeBrEltSQLInjector;
268
import org.openconcerto.erp.injector.CommandeBrSQLInjector;
273
import org.openconcerto.erp.injector.CommandeBrSQLInjector;
269
import org.openconcerto.erp.injector.CommandeCliCommandeSQLInjector;
274
import org.openconcerto.erp.injector.CommandeCliCommandeSQLInjector;
270
import org.openconcerto.erp.injector.CommandeFactureAchatSQLInjector;
275
import org.openconcerto.erp.injector.CommandeFactureAchatSQLInjector;
271
import org.openconcerto.erp.injector.CommandeFactureClientSQLInjector;
276
import org.openconcerto.erp.injector.CommandeFactureClientSQLInjector;
-
 
277
import org.openconcerto.erp.injector.CommandeFactureEltSQLInjector;
-
 
278
import org.openconcerto.erp.injector.CommandeFactureFournisseurSQLInjector;
272
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
279
import org.openconcerto.erp.injector.DevisBlEltSQLInjector;
273
import org.openconcerto.erp.injector.DevisBlSQLInjector;
280
import org.openconcerto.erp.injector.DevisBlSQLInjector;
274
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
281
import org.openconcerto.erp.injector.DevisCommandeFournisseurSQLInjector;
275
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
282
import org.openconcerto.erp.injector.DevisCommandeSQLInjector;
276
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
283
import org.openconcerto.erp.injector.DevisEltFactureEltSQLInjector;
Line 296... Line 303...
296
import org.openconcerto.sql.element.SharedSQLElement;
303
import org.openconcerto.sql.element.SharedSQLElement;
297
import org.openconcerto.sql.model.DBRoot;
304
import org.openconcerto.sql.model.DBRoot;
298
import org.openconcerto.sql.model.DBStructureItemNotFound;
305
import org.openconcerto.sql.model.DBStructureItemNotFound;
299
import org.openconcerto.sql.model.DBSystemRoot;
306
import org.openconcerto.sql.model.DBSystemRoot;
300
import org.openconcerto.sql.model.FieldMapper;
307
import org.openconcerto.sql.model.FieldMapper;
301
import org.openconcerto.sql.model.LoadingListener;
-
 
302
import org.openconcerto.sql.model.SQLDataSource;
308
import org.openconcerto.sql.model.SQLDataSource;
303
import org.openconcerto.sql.model.SQLRow;
309
import org.openconcerto.sql.model.SQLRow;
304
import org.openconcerto.sql.model.SQLServer;
310
import org.openconcerto.sql.model.SQLServer;
305
import org.openconcerto.sql.model.SQLSystem;
311
import org.openconcerto.sql.model.SQLSystem;
306
import org.openconcerto.sql.model.SQLTable;
312
import org.openconcerto.sql.model.SQLTable;
Line 336... Line 342...
336
import java.util.ArrayList;
342
import java.util.ArrayList;
337
import java.util.Arrays;
343
import java.util.Arrays;
338
import java.util.Collection;
344
import java.util.Collection;
339
import java.util.List;
345
import java.util.List;
340
import java.util.Properties;
346
import java.util.Properties;
341
import java.util.concurrent.Executors;
-
 
342
import java.util.concurrent.ScheduledExecutorService;
-
 
343
import java.util.concurrent.ScheduledFuture;
-
 
344
import java.util.concurrent.ThreadFactory;
-
 
345
import java.util.concurrent.TimeUnit;
-
 
346
 
347
 
347
import javax.imageio.ImageIO;
348
import javax.imageio.ImageIO;
348
import javax.swing.JDialog;
-
 
349
import javax.swing.JFrame;
349
import javax.swing.JFrame;
350
import javax.swing.JOptionPane;
350
import javax.swing.JOptionPane;
351
import javax.swing.SwingUtilities;
351
import javax.swing.SwingUtilities;
352
 
352
 
353
/***************************************************************************************************
353
/***************************************************************************************************
Line 603... Line 603...
603
        AdresseVilleClientValueProvider.register();
603
        AdresseVilleClientValueProvider.register();
604
        AdresseVilleCPClientValueProvider.register();
604
        AdresseVilleCPClientValueProvider.register();
605
        AdresseVilleNomClientValueProvider.register();
605
        AdresseVilleNomClientValueProvider.register();
606
        AdresseFullClientValueProvider.register();
606
        AdresseFullClientValueProvider.register();
607
        QteTotalProvider.register();
607
        QteTotalProvider.register();
-
 
608
        QteTotalDocProvider.register();
608
        StockLocationProvider.register();
609
        StockLocationProvider.register();
609
        RefClientValueProvider.register();
610
        RefClientValueProvider.register();
610
        ModeDeReglementDetailsProvider.register();
611
        ModeDeReglementDetailsProvider.register();
611
        FormatedGlobalQtyTotalProvider.register();
612
        FormatedGlobalQtyTotalProvider.register();
612
        MergedGlobalQtyTotalProvider.register();
613
        MergedGlobalQtyTotalProvider.register();
Line 616... Line 617...
616
        DateProvider.register();
617
        DateProvider.register();
617
        RemiseTotalProvider.register();
618
        RemiseTotalProvider.register();
618
        RecapFactureProvider.register();
619
        RecapFactureProvider.register();
619
        RestantAReglerProvider.register();
620
        RestantAReglerProvider.register();
620
        SaledTotalNotDiscountedProvider.register();
621
        SaledTotalNotDiscountedProvider.register();
621
    }
-
 
622
 
-
 
623
    @Override
-
 
624
    protected void initSystemRoot(DBSystemRoot input) {
-
 
625
        super.initSystemRoot(input);
-
 
626
        if (!GraphicsEnvironment.isHeadless()) {
-
 
627
            final JDialog f = new JOptionPane("Mise à jour des caches en cours...\nCette opération prend généralement moins d'une minute.", JOptionPane.INFORMATION_MESSAGE, JOptionPane.DEFAULT_OPTION,
-
 
628
                    null, new Object[] {}).createDialog("Veuillez patienter");
-
 
629
            input.addLoadingListener(new LoadingListener() {
622
        ArticleCodeFournisseurProvider.register();
630
 
-
 
631
                private int loadingCount = 0;
-
 
632
                private final ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
-
 
633
                    @Override
-
 
634
                    public Thread newThread(Runnable r) {
-
 
635
                        final Thread thread = new Thread(r, "Loading listener thread");
-
 
636
                        thread.setDaemon(true);
-
 
637
                        return thread;
-
 
638
                    }
-
 
639
                });
-
 
640
                private ScheduledFuture<?> future = null;
-
 
641
 
-
 
642
                @Override
-
 
643
                public synchronized void loading(LoadingEvent evt) {
-
 
644
                    this.loadingCount += evt.isStarting() ? 1 : -1;
-
 
645
                    if (this.loadingCount < 0) {
-
 
646
                        throw new IllegalStateException();
-
 
647
                    } else if (this.loadingCount == 0) {
-
 
648
                        this.future.cancel(false);
-
 
649
                        this.future = null;
-
 
650
                        SwingUtilities.invokeLater(new Runnable() {
-
 
651
                            @Override
-
 
652
                            public void run() {
-
 
653
                                f.setVisible(false);
-
 
654
                                f.dispose();
-
 
655
                            }
-
 
656
                        });
-
 
657
                    } else if (this.future == null) {
-
 
658
                        this.future = this.exec.schedule(new Runnable() {
-
 
659
                            @Override
-
 
660
                            public void run() {
-
 
661
                                SwingUtilities.invokeLater(new Runnable() {
-
 
662
                                    @Override
-
 
663
                                    public void run() {
-
 
664
                                        f.setVisible(true);
-
 
665
                                    }
-
 
666
                                });
-
 
667
                            }
-
 
668
                        }, 1, TimeUnit.SECONDS);
-
 
669
                    }
-
 
670
                }
-
 
671
 
-
 
672
            });
-
 
673
        }
-
 
674
    }
623
    }
675
 
624
 
676
    @Override
625
    @Override
677
    protected void initDS(SQLDataSource ds) {
626
    protected void initDS(SQLDataSource ds) {
678
        super.initDS(ds);
627
        super.initDS(ds);
Line 860... Line 809...
860
            }
809
            }
861
            SQLElementDirectory dir = this.getDirectory();
810
            SQLElementDirectory dir = this.getDirectory();
862
 
811
 
863
            dir.addSQLElement(AttachmentSQLElement.class);
812
            dir.addSQLElement(AttachmentSQLElement.class);
864
 
813
 
865
 
-
 
-
 
814
            dir.addSQLElement(CustomerProductQtyPriceSQLElement.class);
866
            dir.addSQLElement(EtatStockSQLElement.class);
815
            dir.addSQLElement(EtatStockSQLElement.class);
867
            dir.addSQLElement(EtatStockItemSQLElement.class);
816
            dir.addSQLElement(EtatStockItemSQLElement.class);
868
            dir.addSQLElement(ArticleTarifSQLElement.class);
817
            dir.addSQLElement(ArticleTarifSQLElement.class);
869
            dir.addSQLElement(CoutRevientSQLElement.class);
818
            dir.addSQLElement(CoutRevientSQLElement.class);
870
            dir.addSQLElement(ReliquatBRSQLElement.class);
819
            dir.addSQLElement(ReliquatBRSQLElement.class);
Line 880... Line 829...
880
            dir.addSQLElement(BanqueSQLElement.class);
829
            dir.addSQLElement(BanqueSQLElement.class);
881
            dir.addSQLElement(ClientDepartementSQLElement.class);
830
            dir.addSQLElement(ClientDepartementSQLElement.class);
882
            dir.addSQLElement(CoefficientPrimeSQLElement.class);
831
            dir.addSQLElement(CoefficientPrimeSQLElement.class);
883
            dir.addSQLElement(ContactFournisseurSQLElement.class);
832
            dir.addSQLElement(ContactFournisseurSQLElement.class);
884
            dir.addSQLElement(ContactAdministratifSQLElement.class);
833
            dir.addSQLElement(ContactAdministratifSQLElement.class);
-
 
834
            dir.addSQLElement(ContactSalarieSQLElement.class);
885
            dir.addSQLElement(new TitrePersonnelSQLElement());
835
            dir.addSQLElement(new TitrePersonnelSQLElement());
886
            dir.addSQLElement(new ContactSQLElement());
836
            dir.addSQLElement(new ContactSQLElement());
887
            dir.addSQLElement(new SaisieKmItemSQLElement());
837
            dir.addSQLElement(new SaisieKmItemSQLElement());
888
            dir.addSQLElement(new EcritureSQLElement());
838
            dir.addSQLElement(new EcritureSQLElement());
889
 
839
 
Line 1063... Line 1013...
1063
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1013
            dir.addSQLElement(UniteVenteArticleSQLElement.class);
1064
 
1014
 
1065
            dir.addSQLElement(CalendarItemSQLElement.class);
1015
            dir.addSQLElement(CalendarItemSQLElement.class);
1066
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1016
            dir.addSQLElement(CalendarItemGroupSQLElement.class);
1067
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
1017
            dir.addSQLElement(DeviseHistoriqueSQLElement.class);
-
 
1018
            dir.addSQLElement(EmailTemplateSQLElement.class);
1068
 
1019
 
1069
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1020
            if (getRootSociete().contains("FWK_LIST_PREFS")) {
1070
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1021
                dir.addSQLElement(new FWKListPrefs(getRootSociete()));
1071
            }
1022
            }
1072
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
1023
            if (getRootSociete().contains("FWK_SESSION_STATE")) {
Line 1120... Line 1071...
1120
 
1071
 
1121
    }
1072
    }
1122
 
1073
 
1123
    public static void setSocieteSQLInjector(final DBRoot rootSociete) {
1074
    public static void setSocieteSQLInjector(final DBRoot rootSociete) {
1124
        new AchatAvoirSQLInjector(rootSociete);
1075
        new AchatAvoirSQLInjector(rootSociete);
-
 
1076
        new CommandeFactureEltSQLInjector(rootSociete);
1125
        new ArticleCommandeEltSQLInjector(rootSociete);
1077
        new ArticleCommandeEltSQLInjector(rootSociete);
1126
        new CommandeCliCommandeSQLInjector(rootSociete);
1078
        new CommandeCliCommandeSQLInjector(rootSociete);
1127
        new FactureAvoirSQLInjector(rootSociete);
1079
        new FactureAvoirSQLInjector(rootSociete);
1128
        new FactureBonSQLInjector(rootSociete);
1080
        new FactureBonSQLInjector(rootSociete);
1129
        new FactureCommandeSQLInjector(rootSociete);
1081
        new FactureCommandeSQLInjector(rootSociete);
Line 1139... Line 1091...
1139
        new BonFactureEltSQLInjector(rootSociete);
1091
        new BonFactureEltSQLInjector(rootSociete);
1140
        new CommandeFactureClientSQLInjector(rootSociete);
1092
        new CommandeFactureClientSQLInjector(rootSociete);
1141
        new CommandeBrSQLInjector(rootSociete);
1093
        new CommandeBrSQLInjector(rootSociete);
1142
        new BonReceptionFactureFournisseurSQLInjector(rootSociete);
1094
        new BonReceptionFactureFournisseurSQLInjector(rootSociete);
1143
        new CommandeFactureAchatSQLInjector(rootSociete);
1095
        new CommandeFactureAchatSQLInjector(rootSociete);
-
 
1096
        new CommandeFactureFournisseurSQLInjector(rootSociete);
1144
        new EcheanceEncaisseSQLInjector(rootSociete);
1097
        new EcheanceEncaisseSQLInjector(rootSociete);
1145
        new EcheanceRegleSQLInjector(rootSociete);
1098
        new EcheanceRegleSQLInjector(rootSociete);
1146
        new BrFactureAchatSQLInjector(rootSociete);
1099
        new BrFactureAchatSQLInjector(rootSociete);
1147
        new DevisEltFactureEltSQLInjector(rootSociete);
1100
        new DevisEltFactureEltSQLInjector(rootSociete);
1148
 
1101
 
Line 1179... Line 1132...
1179
        showAs.show("CHEQUE_A_ENCAISSER", "MONTANT", "ID_CLIENT");
1132
        showAs.show("CHEQUE_A_ENCAISSER", "MONTANT", "ID_CLIENT");
1180
 
1133
 
1181
                if (getRootSociete().getTable("CLIENT").getFieldsName().contains("LOCALISATION")) {
1134
                if (getRootSociete().getTable("CLIENT").getFieldsName().contains("LOCALISATION")) {
1182
                    showAs.show("CLIENT", "NOM", "LOCALISATION");
1135
                    showAs.show("CLIENT", "NOM", "LOCALISATION");
1183
                } else {
1136
                } else {
1184
                    SQLPreferences prefs = new SQLPreferences(root);
1137
                    SQLPreferences prefs = SQLPreferences.getMemCached(root);
1185
                    if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_PCE, false)) {
1138
                    if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_PCE, false)) {
1186
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM", "ID_COMPTE_PCE");
1139
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM", "ID_COMPTE_PCE");
1187
                    } else {
1140
                    } else {
1188
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM");
1141
                        showAs.show("CLIENT", "ID_PAYS", "GROUPE", "NOM");
1189
                    }
1142
                    }
Line 1225... Line 1178...
1225
        showAs.show("ECRITURE", SQLRow.toList("NOM,DATE,ID_COMPTE_PCE,DEBIT,CREDIT"));
1178
        showAs.show("ECRITURE", SQLRow.toList("NOM,DATE,ID_COMPTE_PCE,DEBIT,CREDIT"));
1226
        showAs.show("ECHEANCE_CLIENT", SQLRow.toList("ID_CLIENT,ID_MOUVEMENT"));
1179
        showAs.show("ECHEANCE_CLIENT", SQLRow.toList("ID_CLIENT,ID_MOUVEMENT"));
1227
        final List<String> lEchFact = new ArrayList<String>();
1180
        final List<String> lEchFact = new ArrayList<String>();
1228
        lEchFact.add("NUMERO");
1181
        lEchFact.add("NUMERO");
1229
        lEchFact.add("DATE");
1182
        lEchFact.add("DATE");
-
 
1183
        lEchFact.add("ID_MODE_REGLEMENT");
1230
        lEchFact.add("ID_COMMERCIAL");
1184
        lEchFact.add("ID_COMMERCIAL");
1231
        SQLTable tableEch = root.getTable("ECHEANCE_CLIENT");
1185
        SQLTable tableEch = root.getTable("ECHEANCE_CLIENT");
1232
        showAs.show(tableEch.getField("ID_SAISIE_VENTE_FACTURE"), lEchFact);
1186
        showAs.show(tableEch.getField("ID_SAISIE_VENTE_FACTURE"), lEchFact);
1233
 
1187
 
1234
        showAs.show("ECHEANCE_FOURNISSEUR", SQLRow.toList("ID_FOURNISSEUR,ID_MOUVEMENT"));
1188
        showAs.show("ECHEANCE_FOURNISSEUR", SQLRow.toList("ID_FOURNISSEUR,ID_MOUVEMENT"));
1235
        showAs.show("FICHE_PAYE", SQLRow.toList("ID_MOIS,ANNEE"));
1189
        showAs.show("FICHE_PAYE", SQLRow.toList("ID_MOIS,ANNEE,ID_PROFIL_PAYE"));
-
 
1190
 
1236
        showAs.show("FOURNISSEUR", "NOM");
1191
        showAs.show("FOURNISSEUR", "NOM");
1237
 
1192
 
1238
        showAs.show("IDCC", "NOM");
1193
        showAs.show("IDCC", "NOM");
1239
 
1194
 
1240
        showAs.show("JOURNAL", "NOM");
1195
        showAs.show("JOURNAL", "NOM");
Line 1303... Line 1258...
1303
 
1258
 
1304
    @Override
1259
    @Override
1305
    public void setUpSocieteDataBaseConnexion(int base) {
1260
    public void setUpSocieteDataBaseConnexion(int base) {
1306
        final String customerName = setUpSocieteStructure(base);
1261
        final String customerName = setUpSocieteStructure(base);
1307
        final DBRoot rootSociete = this.getRootSociete();
1262
        final DBRoot rootSociete = this.getRootSociete();
-
 
1263
 
-
 
1264
        try {
-
 
1265
            // create table if necessary
-
 
1266
            SQLPreferences.getPrefTable(rootSociete);
-
 
1267
            SQLPreferences.startMemCached(rootSociete);
-
 
1268
        } catch (Exception e) {
-
 
1269
            // don't die now, we might not need them
-
 
1270
            ExceptionHandler.handle("Impossible d'accéder aux préférences", e);
-
 
1271
        }
-
 
1272
 
1308
        closeSocieteConnexion();
1273
        closeSocieteConnexion();
1309
        setSocieteDirectory();
1274
        setSocieteDirectory();
1310
        NumerotationAutoSQLElement.addListeners();
1275
        NumerotationAutoSQLElement.addListeners();
1311
        loadTranslations(this.getTranslator(), rootSociete, Arrays.asList("mappingCompta", "mapping-" + customerName));
1276
        loadTranslations(this.getTranslator(), rootSociete, Arrays.asList("mappingCompta", "mapping-" + customerName));
1312
        setSocieteShowAs();
1277
        setSocieteShowAs();
Line 1316... Line 1281...
1316
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1281
        getFieldMapper().addMapperStreamFromClass(Gestion.class);
1317
        TemplateNXProps.getInstance();
1282
        TemplateNXProps.getInstance();
1318
        // Prefetch undefined
1283
        // Prefetch undefined
1319
        rootSociete.getTables().iterator().next().getUndefinedID();
1284
        rootSociete.getTables().iterator().next().getUndefinedID();
1320
 
1285
 
1321
        try {
-
 
1322
            // create table if necessary
-
 
1323
            SQLPreferences.getPrefTable(rootSociete);
-
 
1324
            SQLPreferences.startMemCached(rootSociete);
-
 
1325
        } catch (Exception e) {
-
 
1326
            // don't die now, we might not need them
-
 
1327
            ExceptionHandler.handle("Impossible d'accéder aux préférences", e);
-
 
1328
        }
-
 
1329
 
-
 
1330
        this.getModuleManager().addFactories(Gestion.MODULES_DIR);
1286
        this.getModuleManager().addFactories(Gestion.MODULES_DIR);
1331
        this.getModuleManager().setup(this.getRootSociete(), this);
1287
        this.getModuleManager().setup(this.getRootSociete(), this);
1332
    }
1288
    }
1333
 
1289
 
1334
    public final ModuleManager getModuleManager() {
1290
    public final ModuleManager getModuleManager() {
1335
        return this.moduleMngr;
1291
        return this.moduleMngr;
1336
    }
1292
    }
1337
 
1293
 
1338
    public void setupBarCodeIfNeeded() {
1294
    public void setupBarCodeIfNeeded() {
1339
        final DBRoot rootSociete = this.getRootSociete();
1295
        final DBRoot rootSociete = this.getRootSociete();
1340
 
-
 
1341
        // TODO check is the SQLPreferences returned by startMemCached() can be used
-
 
1342
        SQLPreferences pref = new SQLPreferences(rootSociete);
1296
        SQLPreferences pref = SQLPreferences.getMemCached(rootSociete);
1343
        if (pref.getBoolean(GestionCommercialeGlobalPreferencePanel.BARCODE_INSERTION, false)) {
1297
        if (pref.getBoolean(GestionCommercialeGlobalPreferencePanel.BARCODE_INSERTION, false)) {
1344
            this.barcodeReader = new BarcodeReader(80);
1298
            this.barcodeReader = new BarcodeReader(80);
1345
            this.barcodeReader.start();
1299
            this.barcodeReader.start();
1346
        }
1300
        }
1347
    }
1301
    }