OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 80 | Rev 90 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80 Rev 83
Line 14... Line 14...
14
 package org.openconcerto.erp.config;
14
 package org.openconcerto.erp.config;
15
 
15
 
16
import org.openconcerto.erp.action.AboutAction;
16
import org.openconcerto.erp.action.AboutAction;
17
import org.openconcerto.erp.action.AstuceAction;
17
import org.openconcerto.erp.action.AstuceAction;
18
import org.openconcerto.erp.action.GestionDroitsAction;
18
import org.openconcerto.erp.action.GestionDroitsAction;
-
 
19
import org.openconcerto.erp.action.ListeBanqueAction;
19
import org.openconcerto.erp.action.NouvelleSocieteAction;
20
import org.openconcerto.erp.action.NouvelleSocieteAction;
20
import org.openconcerto.erp.action.PreferencesAction;
21
import org.openconcerto.erp.action.PreferencesAction;
21
import org.openconcerto.erp.action.SauvegardeBaseAction;
22
import org.openconcerto.erp.action.SauvegardeBaseAction;
22
import org.openconcerto.erp.action.TaskAdminAction;
23
import org.openconcerto.erp.action.TaskAdminAction;
23
import org.openconcerto.erp.action.list.ListeDesSocietesCommonsAction;
24
import org.openconcerto.erp.action.list.ListeDesSocietesCommonsAction;
Line 33... Line 34...
33
import org.openconcerto.erp.core.finance.accounting.action.EtatGrandLivreAction;
34
import org.openconcerto.erp.core.finance.accounting.action.EtatGrandLivreAction;
34
import org.openconcerto.erp.core.finance.accounting.action.EtatJournauxAction;
35
import org.openconcerto.erp.core.finance.accounting.action.EtatJournauxAction;
35
import org.openconcerto.erp.core.finance.accounting.action.ExportRelationExpertAction;
36
import org.openconcerto.erp.core.finance.accounting.action.ExportRelationExpertAction;
36
import org.openconcerto.erp.core.finance.accounting.action.GenerePointageAction;
37
import org.openconcerto.erp.core.finance.accounting.action.GenerePointageAction;
37
import org.openconcerto.erp.core.finance.accounting.action.GestionPlanComptableEAction;
38
import org.openconcerto.erp.core.finance.accounting.action.GestionPlanComptableEAction;
-
 
39
import org.openconcerto.erp.core.finance.accounting.action.ImpressionJournauxAnalytiqueAction;
38
import org.openconcerto.erp.core.finance.accounting.action.ImpressionLivrePayeAction;
40
import org.openconcerto.erp.core.finance.accounting.action.ImpressionLivrePayeAction;
-
 
41
import org.openconcerto.erp.core.finance.accounting.action.ListeDesDevisesAction;
39
import org.openconcerto.erp.core.finance.accounting.action.ListeDesEcrituresAction;
42
import org.openconcerto.erp.core.finance.accounting.action.ListeDesEcrituresAction;
-
 
43
import org.openconcerto.erp.core.finance.accounting.action.ListeDesEcrituresAnalytiquesAction;
40
import org.openconcerto.erp.core.finance.accounting.action.ListeDesJournauxAction;
44
import org.openconcerto.erp.core.finance.accounting.action.ListeDesJournauxAction;
41
import org.openconcerto.erp.core.finance.accounting.action.ListeEcritureParClasseAction;
45
import org.openconcerto.erp.core.finance.accounting.action.ListeEcritureParClasseAction;
42
import org.openconcerto.erp.core.finance.accounting.action.NouveauClotureAction;
46
import org.openconcerto.erp.core.finance.accounting.action.NouveauClotureAction;
43
import org.openconcerto.erp.core.finance.accounting.action.NouveauJournalAction;
-
 
44
import org.openconcerto.erp.core.finance.accounting.action.NouveauLettrageAction;
47
import org.openconcerto.erp.core.finance.accounting.action.NouveauLettrageAction;
45
import org.openconcerto.erp.core.finance.accounting.action.NouveauPointageAction;
48
import org.openconcerto.erp.core.finance.accounting.action.NouveauPointageAction;
46
import org.openconcerto.erp.core.finance.accounting.action.NouvelleValidationAction;
49
import org.openconcerto.erp.core.finance.accounting.action.NouvelleValidationAction;
47
import org.openconcerto.erp.core.finance.accounting.action.ResultatAnalytiqueAction;
50
import org.openconcerto.erp.core.finance.accounting.action.ResultatAnalytiqueAction;
48
import org.openconcerto.erp.core.finance.payment.action.ListeDesChequesAEncaisserAction;
51
import org.openconcerto.erp.core.finance.payment.action.ListeDesChequesAEncaisserAction;
Line 53... Line 56...
53
import org.openconcerto.erp.core.finance.payment.action.ListeDesRelancesAction;
56
import org.openconcerto.erp.core.finance.payment.action.ListeDesRelancesAction;
54
import org.openconcerto.erp.core.finance.payment.action.ListeDesTraitesFournisseursAction;
57
import org.openconcerto.erp.core.finance.payment.action.ListeDesTraitesFournisseursAction;
55
import org.openconcerto.erp.core.finance.payment.action.NouveauDecaissementChequeAvoirAction;
58
import org.openconcerto.erp.core.finance.payment.action.NouveauDecaissementChequeAvoirAction;
56
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesADecaisserAction;
59
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesADecaisserAction;
57
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesAEncaisserAction;
60
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesAEncaisserAction;
58
import org.openconcerto.erp.core.finance.tax.action.DeclarationTVAAction;
-
 
59
import org.openconcerto.erp.core.humanresources.ListeDesContactsAdministratif;
61
import org.openconcerto.erp.core.humanresources.ListeDesContactsAdministratif;
60
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesCommerciauxAction;
62
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesCommerciauxAction;
61
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSalariesAction;
63
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSalariesAction;
62
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSecretairesAction;
64
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSecretairesAction;
63
import org.openconcerto.erp.core.humanresources.employe.action.N4DSAction;
65
import org.openconcerto.erp.core.humanresources.employe.action.N4DSAction;
Line 101... Line 103...
101
import org.openconcerto.erp.core.supplychain.order.action.ListeDesFacturesFournisseurAction;
103
import org.openconcerto.erp.core.supplychain.order.action.ListeDesFacturesFournisseurAction;
102
import org.openconcerto.erp.core.supplychain.order.action.ListeSaisieAchatAction;
104
import org.openconcerto.erp.core.supplychain.order.action.ListeSaisieAchatAction;
103
import org.openconcerto.erp.core.supplychain.order.action.NouveauSaisieAchatAction;
105
import org.openconcerto.erp.core.supplychain.order.action.NouveauSaisieAchatAction;
104
import org.openconcerto.erp.core.supplychain.order.action.NouvelleCommandeAction;
106
import org.openconcerto.erp.core.supplychain.order.action.NouvelleCommandeAction;
105
import org.openconcerto.erp.core.supplychain.order.action.NouvelleFactureFournisseurAction;
107
import org.openconcerto.erp.core.supplychain.order.action.NouvelleFactureFournisseurAction;
-
 
108
import org.openconcerto.erp.core.supplychain.product.action.ListeDesArticlesFournisseurAction;
106
import org.openconcerto.erp.core.supplychain.receipt.action.ListeDesBonsReceptionsAction;
109
import org.openconcerto.erp.core.supplychain.receipt.action.ListeDesBonsReceptionsAction;
107
import org.openconcerto.erp.core.supplychain.receipt.action.NouveauBonReceptionAction;
110
import org.openconcerto.erp.core.supplychain.receipt.action.NouveauBonReceptionAction;
108
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesMouvementsStockAction;
111
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesMouvementsStockAction;
109
import org.openconcerto.erp.core.supplychain.stock.action.NouvelleSaisieMouvementStockAction;
112
import org.openconcerto.erp.core.supplychain.stock.action.NouvelleSaisieMouvementStockAction;
110
import org.openconcerto.erp.core.supplychain.supplier.action.ListeDesContactsFournisseursAction;
113
import org.openconcerto.erp.core.supplychain.supplier.action.ListeDesContactsFournisseursAction;
Line 119... Line 122...
119
import org.openconcerto.sql.model.DBRoot;
122
import org.openconcerto.sql.model.DBRoot;
120
import org.openconcerto.sql.model.SQLSelect;
123
import org.openconcerto.sql.model.SQLSelect;
121
import org.openconcerto.sql.users.UserManager;
124
import org.openconcerto.sql.users.UserManager;
122
import org.openconcerto.sql.users.rights.LockAdminUserRight;
125
import org.openconcerto.sql.users.rights.LockAdminUserRight;
123
import org.openconcerto.sql.users.rights.UserRights;
126
import org.openconcerto.sql.users.rights.UserRights;
-
 
127
import org.openconcerto.sql.users.rights.UserRightsManager;
-
 
128
import org.openconcerto.sql.utils.BackupPanel;
124
import org.openconcerto.ui.FrameUtil;
129
import org.openconcerto.ui.FrameUtil;
125
import org.openconcerto.ui.group.Group;
130
import org.openconcerto.ui.group.Group;
126
import org.openconcerto.ui.group.LayoutHints;
131
import org.openconcerto.ui.group.LayoutHints;
127
 
132
 
128
import java.awt.Component;
133
import java.awt.Component;
Line 190... Line 195...
190
    /**
195
    /**
191
     * Groups
196
     * Groups
192
     */
197
     */
193
    private Group createFilesMenuGroup() {
198
    private Group createFilesMenuGroup() {
194
        Group group = new Group(MainFrame.FILE_MENU);
199
        Group group = new Group(MainFrame.FILE_MENU);
-
 
200
        if (UserRightsManager.getCurrentUserRights().haveRight(BackupPanel.RIGHT_CODE))
195
        group.addItem("backup");
201
            group.addItem("backup");
196
        group.addItem("export.accounting");
202
        group.addItem("export.accounting");
197
        group.addItem("modules");
203
        group.addItem("modules");
198
        if (!Gestion.MAC_OS_X) {
204
        if (!Gestion.MAC_OS_X) {
199
            group.addItem("preferences");
205
            group.addItem("preferences");
Line 257... Line 263...
257
        if (rights.haveRight(ComptaUserRight.MENU)) {
263
        if (rights.haveRight(ComptaUserRight.MENU)) {
258
            final Group gAccounting = new Group("menu.organization.accounting", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
264
            final Group gAccounting = new Group("menu.organization.accounting", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
259
            gAccounting.addItem("accounting.chart");
265
            gAccounting.addItem("accounting.chart");
260
            gAccounting.addItem("accounting.journal");
266
            gAccounting.addItem("accounting.journal");
261
            gAccounting.addItem("accounting.checkDB");
267
            gAccounting.addItem("accounting.checkDB");
-
 
268
            gAccounting.addItem("accounting.currency");
262
            group.add(gAccounting);
269
            group.add(gAccounting);
263
        }
270
        }
264
 
271
 
265
        if (rights.haveRight(LockAdminUserRight.LOCK_MENU_ADMIN)) {
272
        if (rights.haveRight(LockAdminUserRight.LOCK_MENU_ADMIN)) {
266
            final Group gUser = new Group("menu.organization.user", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
273
            final Group gUser = new Group("menu.organization.user", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
Line 278... Line 285...
278
        group.add(gPos);
285
        group.add(gPos);
279
 
286
 
280
 
287
 
281
            group.addItem("enterprise.list");
288
            group.addItem("enterprise.list");
282
 
289
 
-
 
290
        group.addItem("divison.bank.list");
283
            group.addItem("enterprise.create");
291
            group.addItem("enterprise.create");
284
        return group;
292
        return group;
285
    }
293
    }
286
 
294
 
287
    private Group createPayrollMenuGroup() {
295
    private Group createPayrollMenuGroup() {
Line 359... Line 367...
359
    private Group createAccountingMenuGroup() {
367
    private Group createAccountingMenuGroup() {
360
        final Group group = new Group(MainFrame.STATE_MENU);
368
        final Group group = new Group(MainFrame.STATE_MENU);
361
        group.addItem("accounting.balance");
369
        group.addItem("accounting.balance");
362
        group.addItem("accounting.client.balance");
370
        group.addItem("accounting.client.balance");
363
        group.addItem("accounting.ledger");
371
        group.addItem("accounting.ledger");
-
 
372
        Group analytic = new Group("accounting.analytical");
-
 
373
        analytic.addItem("accounting.analytical.ledger");
-
 
374
        analytic.addItem("accounting.analytical.entries.ledger");
-
 
375
        group.add(analytic);
364
        group.addItem("accounting.general.ledger");
376
        group.addItem("accounting.general.ledger");
365
        group.addItem("accounting.entries.ledger");
377
        group.addItem("accounting.entries.ledger");
366
        group.addItem("accounting.entries.list");
378
        group.addItem("accounting.entries.list");
367
        final Group gClosing = new Group("menu.accounting.closing", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
379
        final Group gClosing = new Group("menu.accounting.closing", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
368
        gClosing.addItem("accounting.validating");
380
        gClosing.addItem("accounting.validating");
Line 418... Line 430...
418
            }
430
            }
419
            group.add(gSupplier);
431
            group.add(gSupplier);
420
 
432
 
421
            final Group gProduct = new Group("menu.list.product", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
433
            final Group gProduct = new Group("menu.list.product", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
422
            gProduct.addItem("product.list");
434
            gProduct.addItem("product.list");
-
 
435
            // gProduct.addItem("product.supplychain.list");
423
            gProduct.addItem("stock.io.list");
436
            gProduct.addItem("stock.io.list");
424
            group.add(gProduct);
437
            group.add(gProduct);
425
 
438
 
426
        return group;
439
        return group;
427
    }
440
    }
Line 527... Line 540...
527
                mManager.registerAction("supplier.invoice.purchase.list", new ListeDesFacturesFournisseurAction());
540
                mManager.registerAction("supplier.invoice.purchase.list", new ListeDesFacturesFournisseurAction());
528
                    mManager.registerAction("supplier.credit.list", new ListeDesAvoirsFournisseurAction());
541
                    mManager.registerAction("supplier.credit.list", new ListeDesAvoirsFournisseurAction());
529
            }
542
            }
530
 
543
 
531
            mManager.registerAction("product.list", new ListeDesArticlesAction());
544
            mManager.registerAction("product.list", new ListeDesArticlesAction());
-
 
545
            mManager.registerAction("product.supplychain.list", new ListeDesArticlesFournisseurAction());
532
            mManager.registerAction("stock.io.list", new ListeDesMouvementsStockAction());
546
            mManager.registerAction("stock.io.list", new ListeDesMouvementsStockAction());
533
 
547
 
534
 
548
 
535
    }
549
    }
536
 
550
 
537
    private void registerAccountingMenuActions(final MenuAndActions mManager) {
551
    private void registerAccountingMenuActions(final MenuAndActions mManager) {
538
        mManager.registerAction("accounting.balance", new EtatBalanceAction());
552
        mManager.registerAction("accounting.balance", new EtatBalanceAction());
539
        mManager.registerAction("accounting.client.balance", new BalanceAgeeAction());
553
        mManager.registerAction("accounting.client.balance", new BalanceAgeeAction());
-
 
554
        mManager.registerAction("accounting.analytical.ledger", new ImpressionJournauxAnalytiqueAction());
540
        mManager.registerAction("accounting.ledger", new EtatJournauxAction());
555
        mManager.registerAction("accounting.ledger", new EtatJournauxAction());
541
        mManager.registerAction("accounting.general.ledger", new EtatGrandLivreAction());
556
        mManager.registerAction("accounting.general.ledger", new EtatGrandLivreAction());
542
        mManager.registerAction("accounting.entries.ledger", new ListeDesEcrituresAction());
557
        mManager.registerAction("accounting.entries.ledger", new ListeDesEcrituresAction());
-
 
558
        mManager.registerAction("accounting.analytical.entries.ledger", new ListeDesEcrituresAnalytiquesAction());
543
        mManager.registerAction("accounting.entries.list", new ListeEcritureParClasseAction());
559
        mManager.registerAction("accounting.entries.list", new ListeEcritureParClasseAction());
544
        mManager.registerAction("accounting.validating", new NouvelleValidationAction());
560
        mManager.registerAction("accounting.validating", new NouvelleValidationAction());
545
        mManager.registerAction("accounting.closing", new NouveauClotureAction());
561
        mManager.registerAction("accounting.closing", new NouveauClotureAction());
546
    }
562
    }
547
 
563
 
Line 608... Line 624...
608
 
624
 
609
    private void registerOrganizationMenuActions(final MenuAndActions mManager) {
625
    private void registerOrganizationMenuActions(final MenuAndActions mManager) {
610
        final UserRights rights = UserManager.getInstance().getCurrentUser().getRights();
626
        final UserRights rights = UserManager.getInstance().getCurrentUser().getRights();
611
        final ComptaPropsConfiguration configuration = ComptaPropsConfiguration.getInstanceCompta();
627
        final ComptaPropsConfiguration configuration = ComptaPropsConfiguration.getInstanceCompta();
612
        if (rights.haveRight(ComptaUserRight.MENU)) {
628
        if (rights.haveRight(ComptaUserRight.MENU)) {
613
            mManager.registerAction("accounting.chart", new GestionPlanComptableEAction());
629
            mManager.putAction(new GestionPlanComptableEAction(), "accounting.chart");
614
            mManager.registerAction("accounting.journal", new ListeDesJournauxAction());
630
            mManager.putAction(new ListeDesJournauxAction(), "accounting.journal");
-
 
631
            mManager.putAction(new ListeDesDevisesAction(), "accounting.currency");
615
            mManager.putAction(new AbstractAction("Check DB") {
632
            mManager.putAction(new AbstractAction("Check DB") {
616
                @Override
633
                @Override
617
                public void actionPerformed(ActionEvent e) {
634
                public void actionPerformed(ActionEvent e) {
618
                    final DBRoot rootSociete = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
635
                    final DBRoot rootSociete = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
619
                    final SQLSelect sel = CorrectMouvement.createUnbalancedSelect(rootSociete);
636
                    final SQLSelect sel = CorrectMouvement.createUnbalancedSelect(rootSociete);
Line 635... Line 652...
635
        mManager.registerAction("pos.list", new ListeDesCaissesTicketAction());
652
        mManager.registerAction("pos.list", new ListeDesCaissesTicketAction());
636
 
653
 
637
 
654
 
638
            mManager.registerAction("enterprise.list", new ListeDesSocietesCommonsAction());
655
            mManager.registerAction("enterprise.list", new ListeDesSocietesCommonsAction());
639
 
656
 
-
 
657
        mManager.registerAction("divison.bank.list", new ListeBanqueAction());
640
            mManager.registerAction("enterprise.create", new NouvelleSocieteAction());
658
            mManager.registerAction("enterprise.create", new NouvelleSocieteAction());
641
    }
659
    }
642
 
660
 
643
    private void registerHelpMenuActions(final MenuAndActions mManager) {
661
    private void registerHelpMenuActions(final MenuAndActions mManager) {
644
        mManager.registerAction("information", AboutAction.getInstance());
662
        mManager.registerAction("information", AboutAction.getInstance());