OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
67 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.config;
15
 
16
import org.openconcerto.erp.action.AboutAction;
17
import org.openconcerto.erp.action.AstuceAction;
18
import org.openconcerto.erp.action.GestionDroitsAction;
83 ilm 19
import org.openconcerto.erp.action.ListeBanqueAction;
67 ilm 20
import org.openconcerto.erp.action.NouvelleSocieteAction;
21
import org.openconcerto.erp.action.PreferencesAction;
22
import org.openconcerto.erp.action.SauvegardeBaseAction;
23
import org.openconcerto.erp.action.TaskAdminAction;
24
import org.openconcerto.erp.action.list.ListeDesSocietesCommonsAction;
25
import org.openconcerto.erp.action.list.ListeDesUsersCommonAction;
26
import org.openconcerto.erp.core.customerrelationship.customer.action.ListeDesClientsAction;
27
import org.openconcerto.erp.core.customerrelationship.customer.action.ListeDesContactsAction;
93 ilm 28
import org.openconcerto.erp.core.customerrelationship.customer.action.ListeDesDepartementsClientsAction;
67 ilm 29
import org.openconcerto.erp.core.customerrelationship.customer.action.NouvelHistoriqueListeClientAction;
30
import org.openconcerto.erp.core.customerrelationship.mail.action.ListeDesCourriersClientsAction;
174 ilm 31
import org.openconcerto.erp.core.customerrelationship.mail.action.ListeDesModelesEmailAction;
67 ilm 32
import org.openconcerto.erp.core.finance.accounting.action.BalanceAgeeAction;
33
import org.openconcerto.erp.core.finance.accounting.action.CompteResultatBilanAction;
34
import org.openconcerto.erp.core.finance.accounting.action.EtatBalanceAction;
35
import org.openconcerto.erp.core.finance.accounting.action.EtatChargeAction;
36
import org.openconcerto.erp.core.finance.accounting.action.EtatGrandLivreAction;
37
import org.openconcerto.erp.core.finance.accounting.action.EtatJournauxAction;
38
import org.openconcerto.erp.core.finance.accounting.action.ExportRelationExpertAction;
39
import org.openconcerto.erp.core.finance.accounting.action.GenerePointageAction;
40
import org.openconcerto.erp.core.finance.accounting.action.GestionPlanComptableEAction;
93 ilm 41
import org.openconcerto.erp.core.finance.accounting.action.ImportEcritureAction;
83 ilm 42
import org.openconcerto.erp.core.finance.accounting.action.ImpressionJournauxAnalytiqueAction;
67 ilm 43
import org.openconcerto.erp.core.finance.accounting.action.ImpressionLivrePayeAction;
93 ilm 44
import org.openconcerto.erp.core.finance.accounting.action.ImpressionRepartitionAnalytiqueAction;
156 ilm 45
import org.openconcerto.erp.core.finance.accounting.action.ListeDesCategorieComptableAction;
142 ilm 46
import org.openconcerto.erp.core.finance.accounting.action.ListeDesComptesAction;
83 ilm 47
import org.openconcerto.erp.core.finance.accounting.action.ListeDesDevisesAction;
67 ilm 48
import org.openconcerto.erp.core.finance.accounting.action.ListeDesEcrituresAction;
83 ilm 49
import org.openconcerto.erp.core.finance.accounting.action.ListeDesEcrituresAnalytiquesAction;
80 ilm 50
import org.openconcerto.erp.core.finance.accounting.action.ListeDesJournauxAction;
94 ilm 51
import org.openconcerto.erp.core.finance.accounting.action.ListeDesPostesAnalytiquesAction;
93 ilm 52
import org.openconcerto.erp.core.finance.accounting.action.ListeDesTauxDeChangeAction;
67 ilm 53
import org.openconcerto.erp.core.finance.accounting.action.ListeEcritureParClasseAction;
54
import org.openconcerto.erp.core.finance.accounting.action.NouveauClotureAction;
156 ilm 55
import org.openconcerto.erp.core.finance.accounting.action.NouveauClotureSansAnouveauxAction;
67 ilm 56
import org.openconcerto.erp.core.finance.accounting.action.NouveauLettrageAction;
57
import org.openconcerto.erp.core.finance.accounting.action.NouveauPointageAction;
58
import org.openconcerto.erp.core.finance.accounting.action.NouvelleValidationAction;
59
import org.openconcerto.erp.core.finance.accounting.action.ResultatAnalytiqueAction;
149 ilm 60
import org.openconcerto.erp.core.finance.accounting.ui.SaisieJournalAction;
67 ilm 61
import org.openconcerto.erp.core.finance.payment.action.ListeDesChequesAEncaisserAction;
62
import org.openconcerto.erp.core.finance.payment.action.ListeDesChequesAvoirAction;
63
import org.openconcerto.erp.core.finance.payment.action.ListeDesChequesFournisseursAction;
156 ilm 64
import org.openconcerto.erp.core.finance.payment.action.ListeDesDepostChequesAction;
67 ilm 65
import org.openconcerto.erp.core.finance.payment.action.ListeDesEncaissementsAction;
66
import org.openconcerto.erp.core.finance.payment.action.ListeDesReferencesAction;
67
import org.openconcerto.erp.core.finance.payment.action.ListeDesRelancesAction;
68
import org.openconcerto.erp.core.finance.payment.action.ListeDesTraitesFournisseursAction;
69
import org.openconcerto.erp.core.finance.payment.action.NouveauDecaissementChequeAvoirAction;
70
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesADecaisserAction;
71
import org.openconcerto.erp.core.finance.payment.action.NouveauListeDesChequesAEncaisserAction;
174 ilm 72
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantSQLElement;
142 ilm 73
import org.openconcerto.erp.core.finance.tax.action.ReportingEcoContributionPanel;
144 ilm 74
import org.openconcerto.erp.core.finance.tax.action.ReportingTaxeComplementairePanel;
67 ilm 75
import org.openconcerto.erp.core.humanresources.ListeDesContactsAdministratif;
142 ilm 76
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesAyantsDroitsAction;
77
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesCaissesCotisationsAction;
67 ilm 78
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesCommerciauxAction;
142 ilm 79
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesContratsPrevoyanceAction;
67 ilm 80
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSalariesAction;
81
import org.openconcerto.erp.core.humanresources.employe.action.ListeDesSecretairesAction;
82
import org.openconcerto.erp.core.humanresources.employe.action.N4DSAction;
83
import org.openconcerto.erp.core.humanresources.payroll.action.ClotureMensuellePayeAction;
84
import org.openconcerto.erp.core.humanresources.payroll.action.EditionFichePayeAction;
142 ilm 85
import org.openconcerto.erp.core.humanresources.payroll.action.ListeDesInfosSalariePayeAction;
67 ilm 86
import org.openconcerto.erp.core.humanresources.payroll.action.ListeDesProfilsPayeAction;
87
import org.openconcerto.erp.core.humanresources.payroll.action.ListeDesRubriquesDePayeAction;
88
import org.openconcerto.erp.core.humanresources.payroll.action.ListeDesVariablesPayes;
89
import org.openconcerto.erp.core.humanresources.payroll.action.NouvelAcompteAction;
90
import org.openconcerto.erp.core.humanresources.payroll.action.NouvelHistoriqueFichePayeAction;
91
import org.openconcerto.erp.core.humanresources.payroll.action.NouvelleSaisieKmAction;
92
import org.openconcerto.erp.core.reports.stat.action.EvolutionCAAction;
90 ilm 93
import org.openconcerto.erp.core.reports.stat.action.EvolutionCACumulAction;
94
import org.openconcerto.erp.core.reports.stat.action.EvolutionCmdAction;
95
import org.openconcerto.erp.core.reports.stat.action.EvolutionCmdCumulAction;
67 ilm 96
import org.openconcerto.erp.core.reports.stat.action.EvolutionMargeAction;
174 ilm 97
import org.openconcerto.erp.core.reports.stat.action.ReportingCommercialAction;
90 ilm 98
import org.openconcerto.erp.core.reports.stat.action.VenteArticleFamilleGraphAction;
67 ilm 99
import org.openconcerto.erp.core.reports.stat.action.VenteArticleGraphAction;
100
import org.openconcerto.erp.core.reports.stat.action.VenteArticleMargeGraphAction;
101
import org.openconcerto.erp.core.sales.credit.action.ListeDesAvoirsClientsAction;
102
import org.openconcerto.erp.core.sales.credit.action.NouveauAvoirClientAction;
103
import org.openconcerto.erp.core.sales.invoice.action.EtatVenteAction;
144 ilm 104
import org.openconcerto.erp.core.sales.invoice.action.GenEtatStockAction;
67 ilm 105
import org.openconcerto.erp.core.sales.invoice.action.GenListeVenteAction;
144 ilm 106
import org.openconcerto.erp.core.sales.invoice.action.GenReportingVenteAction;
174 ilm 107
import org.openconcerto.erp.core.sales.invoice.action.ImportReglementSageAction;
67 ilm 108
import org.openconcerto.erp.core.sales.invoice.action.ListeDebiteursAction;
109
import org.openconcerto.erp.core.sales.invoice.action.ListeDesElementsFactureAction;
149 ilm 110
import org.openconcerto.erp.core.sales.invoice.action.ListeDesFactureItemsAction;
67 ilm 111
import org.openconcerto.erp.core.sales.invoice.action.ListeDesVentesAction;
151 ilm 112
import org.openconcerto.erp.core.sales.invoice.action.ListeSDDMessageAction;
67 ilm 113
import org.openconcerto.erp.core.sales.invoice.action.ListeSaisieVenteFactureAction;
114
import org.openconcerto.erp.core.sales.invoice.action.ListesFacturesClientsImpayeesAction;
115
import org.openconcerto.erp.core.sales.invoice.action.NouveauSaisieVenteComptoirAction;
116
import org.openconcerto.erp.core.sales.invoice.action.NouveauSaisieVenteFactureAction;
156 ilm 117
import org.openconcerto.erp.core.sales.invoice.report.ReportingClientPanel;
67 ilm 118
import org.openconcerto.erp.core.sales.order.action.ListeDesCommandesClientAction;
151 ilm 119
import org.openconcerto.erp.core.sales.order.action.ListeDesCommandesClientItemsAction;
142 ilm 120
import org.openconcerto.erp.core.sales.order.action.ListeDesElementsACommanderClientAction;
144 ilm 121
import org.openconcerto.erp.core.sales.order.action.ListeDesFacturationCommandesClientAction;
67 ilm 122
import org.openconcerto.erp.core.sales.order.action.NouvelleCommandeClientAction;
123
import org.openconcerto.erp.core.sales.pos.action.ListeDesCaissesTicketAction;
124
import org.openconcerto.erp.core.sales.product.action.FamilleArticleAction;
125
import org.openconcerto.erp.core.sales.product.action.ListeDesArticlesAction;
142 ilm 126
import org.openconcerto.erp.core.sales.product.action.ListeEcoContributionAction;
144 ilm 127
import org.openconcerto.erp.core.sales.product.action.ListeHistoCodeClientArticleAction;
174 ilm 128
import org.openconcerto.erp.core.sales.product.action.TransfertStockAction;
67 ilm 129
import org.openconcerto.erp.core.sales.quote.action.ListeDesDevisAction;
156 ilm 130
import org.openconcerto.erp.core.sales.quote.action.ListeDesDevisActionTCP;
93 ilm 131
import org.openconcerto.erp.core.sales.quote.action.ListeDesElementsDevisAction;
67 ilm 132
import org.openconcerto.erp.core.sales.quote.action.NouveauDevisAction;
133
import org.openconcerto.erp.core.sales.shipment.action.ListeDesBonsDeLivraisonAction;
142 ilm 134
import org.openconcerto.erp.core.sales.shipment.action.ListeDesReliquatsBonsLivraisonsAction;
67 ilm 135
import org.openconcerto.erp.core.sales.shipment.action.NouveauBonLivraisonAction;
136
import org.openconcerto.erp.core.supplychain.credit.action.ListeDesAvoirsFournisseurAction;
137
import org.openconcerto.erp.core.supplychain.credit.action.NouvelAvoirFournisseurAction;
138
import org.openconcerto.erp.core.supplychain.order.action.ListeDesCommandesAction;
144 ilm 139
import org.openconcerto.erp.core.supplychain.order.action.ListeDesDemandesAchatsAction;
140
import org.openconcerto.erp.core.supplychain.order.action.ListeDesDemandesPrixAction;
142 ilm 141
import org.openconcerto.erp.core.supplychain.order.action.ListeDesElementsACommanderAction;
80 ilm 142
import org.openconcerto.erp.core.supplychain.order.action.ListeDesFacturesFournisseurAction;
67 ilm 143
import org.openconcerto.erp.core.supplychain.order.action.ListeSaisieAchatAction;
144
import org.openconcerto.erp.core.supplychain.order.action.NouveauSaisieAchatAction;
145
import org.openconcerto.erp.core.supplychain.order.action.NouvelleCommandeAction;
156 ilm 146
import org.openconcerto.erp.core.supplychain.order.action.NouvelleDemandePrixAction;
80 ilm 147
import org.openconcerto.erp.core.supplychain.order.action.NouvelleFactureFournisseurAction;
83 ilm 148
import org.openconcerto.erp.core.supplychain.product.action.ListeDesArticlesFournisseurAction;
67 ilm 149
import org.openconcerto.erp.core.supplychain.receipt.action.ListeDesBonsReceptionsAction;
94 ilm 150
import org.openconcerto.erp.core.supplychain.receipt.action.ListeDesReliquatsBonsReceptionsAction;
67 ilm 151
import org.openconcerto.erp.core.supplychain.receipt.action.NouveauBonReceptionAction;
156 ilm 152
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesDepotsStocksAction;
153
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesEtatsStocksAction;
67 ilm 154
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesMouvementsStockAction;
156 ilm 155
import org.openconcerto.erp.core.supplychain.stock.action.ListeDesStocksAction;
67 ilm 156
import org.openconcerto.erp.core.supplychain.stock.action.NouvelleSaisieMouvementStockAction;
157
import org.openconcerto.erp.core.supplychain.supplier.action.ListeDesContactsFournisseursAction;
158
import org.openconcerto.erp.core.supplychain.supplier.action.ListeDesFournisseursAction;
159
import org.openconcerto.erp.core.supplychain.supplier.action.ListesFacturesFournImpayeesAction;
160
import org.openconcerto.erp.core.supplychain.supplier.action.NouvelHistoriqueListeFournAction;
161
import org.openconcerto.erp.modules.ModuleFrame;
162
import org.openconcerto.erp.preferences.DefaultNXProps;
156 ilm 163
import org.openconcerto.erp.preferences.GestionArticleGlobalPreferencePanel;
93 ilm 164
import org.openconcerto.erp.preferences.GestionClientPreferencePanel;
67 ilm 165
import org.openconcerto.erp.rights.ComptaUserRight;
166
import org.openconcerto.erp.rights.NXRights;
80 ilm 167
import org.openconcerto.erp.utils.correct.CorrectMouvement;
168
import org.openconcerto.sql.model.DBRoot;
169
import org.openconcerto.sql.model.SQLSelect;
93 ilm 170
import org.openconcerto.sql.preferences.SQLPreferences;
67 ilm 171
import org.openconcerto.sql.users.rights.LockAdminUserRight;
172
import org.openconcerto.sql.users.rights.UserRights;
83 ilm 173
import org.openconcerto.sql.users.rights.UserRightsManager;
174
import org.openconcerto.sql.utils.BackupPanel;
80 ilm 175
import org.openconcerto.ui.FrameUtil;
142 ilm 176
import org.openconcerto.ui.PanelFrame;
67 ilm 177
import org.openconcerto.ui.group.Group;
178
import org.openconcerto.ui.group.LayoutHints;
179
 
80 ilm 180
import java.awt.Component;
67 ilm 181
import java.awt.event.ActionEvent;
80 ilm 182
import java.util.List;
67 ilm 183
 
184
import javax.swing.AbstractAction;
80 ilm 185
import javax.swing.JOptionPane;
67 ilm 186
 
73 ilm 187
public class DefaultMenuConfiguration implements MenuConfiguration {
144 ilm 188
    private ComptaPropsConfiguration configuration;
189
 
190
    public DefaultMenuConfiguration(ComptaPropsConfiguration configuration) {
191
        this.configuration = configuration;
192
    }
193
 
194
    public ComptaPropsConfiguration getConfiguration() {
195
        return configuration;
196
    }
197
 
67 ilm 198
    public void registerMenuTranslations() {
199
 
200
    }
201
 
73 ilm 202
    @Override
144 ilm 203
    public MenuAndActions createMenuAndActions() {
73 ilm 204
        final MenuAndActions res = new MenuAndActions();
205
        this.createMenuGroup(res.getGroup());
206
        this.registerMenuActions(res);
207
        return res;
208
    }
209
 
144 ilm 210
    public void createMenuGroup(Group mGroup) {
142 ilm 211
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 212
 
213
        mGroup.add(createFilesMenuGroup());
214
        mGroup.add(createCreationMenuGroup());
215
        mGroup.add(createListMenuGroup());
216
        if (rights.haveRight(ComptaUserRight.MENU)) {
217
            mGroup.add(createAccountingMenuGroup());
218
            mGroup.add(createStatsDocumentsGroup());
219
        }
220
        if (rights.haveRight(NXRights.ACCES_MENU_STAT.getCode())) {
221
            mGroup.add(createStatsMenuGroup());
222
        }
223
            mGroup.add(createPaymentMenuGroup());
224
        if (rights.haveRight(NXRights.LOCK_MENU_PAYE.getCode())) {
225
            mGroup.add(createPayrollMenuGroup());
226
        }
227
        if (rights.haveRight(NXRights.ACCES_MENU_STRUCTURE.getCode())) {
228
            mGroup.add(createOrganizationMenuGroup());
229
        }
230
        mGroup.add(createHelpMenuGroup());
231
        if (rights.haveRight(NXRights.LOCK_MENU_TEST.getCode())) {
232
            mGroup.add(createTestMenuGroup());
233
        }
234
 
235
    }
236
 
90 ilm 237
    public void registerMenuActions(final MenuAndActions ma) {
73 ilm 238
        registerFilesMenuActions(ma);
239
        registerCreationMenuActions(ma);
240
        registerListMenuActions(ma);
241
        registerAccountingMenuActions(ma);
242
        registerStatsDocumentsActions(ma);
243
        registerStatsMenuActions(ma);
244
        registerPaymentMenuActions(ma);
245
        registerPayrollMenuActions(ma);
246
        registerOrganizationMenuActions(ma);
247
        registerHelpMenuActions(ma);
248
        registerHelpTestActions(ma);
67 ilm 249
    }
250
 
251
    /**
252
     * Groups
253
     */
144 ilm 254
    public Group createFilesMenuGroup() {
73 ilm 255
        Group group = new Group(MainFrame.FILE_MENU);
83 ilm 256
        if (UserRightsManager.getCurrentUserRights().haveRight(BackupPanel.RIGHT_CODE))
257
            group.addItem("backup");
67 ilm 258
        group.addItem("modules");
73 ilm 259
        if (!Gestion.MAC_OS_X) {
260
            group.addItem("preferences");
261
            group.addItem("quit");
262
        }
67 ilm 263
        return group;
264
    }
265
 
144 ilm 266
    public Group createCreationMenuGroup() {
73 ilm 267
        final Group group = new Group(MainFrame.CREATE_MENU);
268
 
67 ilm 269
        final Boolean bModeVenteComptoir = DefaultNXProps.getInstance().getBooleanValue("ArticleVenteComptoir", true);
142 ilm 270
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 271
        final Group accountingGroup = new Group("accounting");
272
        if (rights.haveRight(ComptaUserRight.MENU)) {
273
            accountingGroup.addItem("accounting.entry.create");
149 ilm 274
            accountingGroup.addItem("accounting.entry.ledger.create");
67 ilm 275
        }
276
        group.add(accountingGroup);
277
 
278
        final Group customerGroup = new Group("customer", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
279
 
73 ilm 280
            customerGroup.addItem("customer.quote.create");
67 ilm 281
 
73 ilm 282
            customerGroup.addItem("customer.delivery.create");
283
            customerGroup.addItem("customer.order.create");
284
            if (bModeVenteComptoir && rights.haveRight("VENTE_COMPTOIR")) {
285
                customerGroup.addItem("pos.sale.create");
286
            }
287
            customerGroup.addItem("customer.invoice.create");
67 ilm 288
 
73 ilm 289
            customerGroup.addItem("customer.credit.create");
290
            group.add(customerGroup);
291
 
292
            final Group supplierGroup = new Group("supplier", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
293
            group.add(supplierGroup);
294
            if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
295
                supplierGroup.addItem("supplier.order.create");
296
                supplierGroup.addItem("supplier.receipt.create");
297
                supplierGroup.addItem("supplier.purchase.create");
80 ilm 298
                supplierGroup.addItem("supplier.invoice.purchase.create");
73 ilm 299
                supplierGroup.addItem("supplier.credit.create");
300
                group.addItem("stock.io.create");
301
            }
174 ilm 302
            group.addItem("product.stock.transfert");
73 ilm 303
 
67 ilm 304
        return group;
305
    }
306
 
144 ilm 307
    public Group createHelpMenuGroup() {
73 ilm 308
        final Group group = new Group(MainFrame.HELP_MENU);
67 ilm 309
        group.addItem("information");
310
        group.addItem("tips");
311
        return group;
312
    }
313
 
144 ilm 314
    public Group createOrganizationMenuGroup() {
73 ilm 315
        final Group group = new Group(MainFrame.STRUCTURE_MENU);
142 ilm 316
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 317
 
318
        if (rights.haveRight(ComptaUserRight.MENU)) {
319
            final Group gAccounting = new Group("menu.organization.accounting", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
320
            gAccounting.addItem("accounting.chart");
142 ilm 321
            gAccounting.addItem("accounting.list");
67 ilm 322
            gAccounting.addItem("accounting.journal");
156 ilm 323
            gAccounting.addItem("accounting.category.list");
80 ilm 324
            gAccounting.addItem("accounting.checkDB");
83 ilm 325
            gAccounting.addItem("accounting.currency");
93 ilm 326
            gAccounting.addItem("accounting.currency.rates");
67 ilm 327
            group.add(gAccounting);
328
        }
329
 
330
        if (rights.haveRight(LockAdminUserRight.LOCK_MENU_ADMIN)) {
331
            final Group gUser = new Group("menu.organization.user", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
332
            gUser.addItem("user.list");
333
            gUser.addItem("user.right.list");
334
            gUser.addItem("user.task.right");
335
            group.add(gUser);
336
        }
174 ilm 337
        group.addItem("email.template.list");
142 ilm 338
        group.addItem("product.ecotax");
73 ilm 339
        group.addItem("office.contact.list");
67 ilm 340
        group.addItem("salesman.list");
341
 
342
        final Group gPos = new Group("menu.organization.pos", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
343
        gPos.addItem("pos.list");
344
        group.add(gPos);
345
 
346
 
347
            group.addItem("enterprise.list");
348
 
83 ilm 349
        group.addItem("divison.bank.list");
67 ilm 350
            group.addItem("enterprise.create");
351
        return group;
352
    }
353
 
144 ilm 354
    public Group createPayrollMenuGroup() {
73 ilm 355
        final Group group = new Group(MainFrame.PAYROLL_MENU);
67 ilm 356
        group.addItem("payroll.list.report.print");
357
        group.addItem("payroll.profile.list");
358
        group.addItem("payroll.history");
142 ilm 359
        group.addItem("payroll.infos.history");
67 ilm 360
        group.addItem("payroll.create");
361
        group.addItem("payroll.deposit.create");
362
        group.addItem("employee.list");
363
        final Group groupConfig = new Group("menu.payroll.config", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
364
        groupConfig.addItem("payroll.section");
365
        groupConfig.addItem("payroll.variable");
142 ilm 366
        groupConfig.addItem("payroll.caisse");
367
        groupConfig.addItem("employee.contrat.prev.list");
368
        // groupConfig.addItem("employee.contrat.prev.ayantdroit.list");
67 ilm 369
        group.add(groupConfig);
370
        group.addItem("payroll.closing");
371
        return group;
372
    }
373
 
90 ilm 374
    public Group createPaymentMenuGroup() {
73 ilm 375
        final Group group = new Group(MainFrame.PAYMENT_MENU);
142 ilm 376
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 377
 
378
        if (rights.haveRight(ComptaUserRight.MENU) || rights.haveRight(ComptaUserRight.POINTAGE_LETTRAGE)) {
379
            group.addItem("payment.checking.create");
380
            group.addItem("payment.reconciliation.create");
381
        }
382
 
383
        if (rights.haveRight(NXRights.GESTION_ENCAISSEMENT.getCode())) {
384
            Group gCustomer = new Group("menu.payment.customer");
385
            gCustomer.addItem("customer.invoice.unpaid.list");
156 ilm 386
            gCustomer.addItem("customer.payment.report");
67 ilm 387
            gCustomer.addItem("customer.dept.list");
388
            gCustomer.addItem("customer.payment.list");
389
            gCustomer.addItem("customer.payment.followup.list");
390
            gCustomer.addItem("customer.payment.check.pending.list");
156 ilm 391
            gCustomer.addItem("customer.payment.check.deposit.list");
67 ilm 392
            gCustomer.addItem("customer.payment.check.pending.create");
156 ilm 393
            gCustomer.addItem("customer.payment.check.deposit.list");
151 ilm 394
            gCustomer.addItem("customer.payment.sddMessage.list");
67 ilm 395
            gCustomer.addItem("customer.credit.check.list");
396
            gCustomer.addItem("customer.credit.check.create");
397
            group.add(gCustomer);
398
        }
399
        if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
400
            Group gSupplier = new Group("menu.payment.supplier");
401
            gSupplier.addItem("supplier.invoice.unpaid.list");
402
            gSupplier.addItem("supplier.bill.list");
403
            gSupplier.addItem("supplier.payment.check.list");
404
            gSupplier.addItem("supplier.payment.check.pending.list");
405
            group.add(gSupplier);
406
        }
407
        return group;
408
    }
409
 
90 ilm 410
    public Group createStatsMenuGroup() {
73 ilm 411
        final Group group = new Group(MainFrame.STATS_MENU);
67 ilm 412
 
413
        group.addItem("sales.graph");
90 ilm 414
        group.addItem("sales.graph.cumulate");
415
        group.addItem("sales.graph.cmd");
416
        group.addItem("sales.graph.cmd.cumulate");
67 ilm 417
 
418
            group.addItem("sales.margin.graph");
144 ilm 419
        group.addItem("sales.list.stock.report");
420
        group.addItem("sales.list.reporting");
421
        group.addItem("order.list.reporting");
67 ilm 422
        group.addItem("sales.list.report");
174 ilm 423
        group.addItem("sales.list.salesman.report");
67 ilm 424
            group.addItem("sales.product.graph");
425
            group.addItem("sales.product.margin.graph");
90 ilm 426
            group.addItem("sales.product.family.graph");
67 ilm 427
        group.addItem("sales.list.graph");
142 ilm 428
        group.addItem("sales.report.ecocontribution");
144 ilm 429
        group.addItem("sales.report.taxesupp");
430
 
67 ilm 431
        return group;
432
    }
433
 
90 ilm 434
    public Group createStatsDocumentsGroup() {
73 ilm 435
        final Group group = new Group(MainFrame.DECLARATION_MENU);
80 ilm 436
        // group.addItem("accounting.vat.report");
67 ilm 437
        group.addItem("accounting.costs.report");
438
        group.addItem("accounting.balance.report");
94 ilm 439
        // group.addItem("accounting.2050Report");
67 ilm 440
        group.addItem("employe.social.report");
441
        return group;
442
    }
443
 
90 ilm 444
    public Group createAccountingMenuGroup() {
73 ilm 445
        final Group group = new Group(MainFrame.STATE_MENU);
67 ilm 446
        group.addItem("accounting.balance");
447
        group.addItem("accounting.client.balance");
448
        group.addItem("accounting.ledger");
83 ilm 449
        Group analytic = new Group("accounting.analytical");
450
        analytic.addItem("accounting.analytical.ledger");
451
        analytic.addItem("accounting.analytical.entries.ledger");
93 ilm 452
        analytic.addItem("accounting.analytical.ledger.global");
94 ilm 453
        analytic.addItem("accounting.analytical.dpt");
83 ilm 454
        group.add(analytic);
67 ilm 455
        group.addItem("accounting.general.ledger");
456
        group.addItem("accounting.entries.ledger");
457
        group.addItem("accounting.entries.list");
93 ilm 458
 
459
        final Group gIO = new Group("menu.accounting.io", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
460
        gIO.addItem("accounting.import");
461
        gIO.addItem("accounting.export");
462
        group.add(gIO);
463
 
67 ilm 464
        final Group gClosing = new Group("menu.accounting.closing", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
465
        gClosing.addItem("accounting.validating");
466
        gClosing.addItem("accounting.closing");
467
        group.add(gClosing);
468
        return group;
469
    }
470
 
144 ilm 471
    public Group createListMenuGroup() {
73 ilm 472
        final Group group = new Group(MainFrame.LIST_MENU);
67 ilm 473
 
474
        final Boolean bModeVenteComptoir = DefaultNXProps.getInstance().getBooleanValue("ArticleVenteComptoir", true);
142 ilm 475
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 476
 
477
        Group gCustomer = new Group("menu.list.customer", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
478
        gCustomer.addItem("customer.list");
93 ilm 479
 
480
        SQLPreferences prefs = SQLPreferences.getMemCached(configuration.getRootSociete());
481
        if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_DPT, false)) {
482
            gCustomer.addItem("customer.department.list");
483
        }
484
 
67 ilm 485
        gCustomer.addItem("contact.list");
486
 
487
        if (rights.haveRight(NXRights.ACCES_HISTORIQUE.getCode())) {
488
            gCustomer.addItem("customer.history");
489
        }
490
 
491
 
492
            gCustomer.addItem("customer.quote.list");
493
 
494
 
495
            gCustomer.addItem("customer.order.list");
144 ilm 496
            gCustomer.addItem("customer.order.invoice.list");
151 ilm 497
            gCustomer.addItem("customer.order.list.details");
67 ilm 498
            gCustomer.addItem("customer.delivery.list");
142 ilm 499
            if (configuration.getRootSociete().contains("RELIQUAT_BR")) {
500
                gCustomer.addItem("customer.delivery.reliquat.list");
501
            }
67 ilm 502
        group.add(gCustomer);
503
 
504
        boolean useListDesVentesAction = bModeVenteComptoir;
505
        if (useListDesVentesAction) {
506
            gCustomer.addItem("sales.list");
507
 
508
        } else {
509
 
510
            gCustomer.addItem("customer.invoice.list");
511
        }
512
 
513
        gCustomer.addItem("customer.credit.list");
149 ilm 514
        gCustomer.addItem("customer.invoice.details.list");
67 ilm 515
 
516
        final Group gSupplier = new Group("menu.list.supplier", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
517
            gSupplier.addItem("supplier.list");
518
            gSupplier.addItem("supplier.contact.list");
519
                gSupplier.addItem("supplier.history");
520
            if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
144 ilm 521
                    gSupplier.addItem("supplier.order.preview");
522
                    gSupplier.addItem("supplier.order.ask");
67 ilm 523
                    gSupplier.addItem("supplier.order.list");
524
                gSupplier.addItem("supplier.receipt.list");
94 ilm 525
                if (configuration.getRootSociete().contains("RELIQUAT_BR")) {
526
                    gSupplier.addItem("supplier.receipt.reliquat.list");
527
                }
67 ilm 528
                gSupplier.addItem("supplier.purchase.list");
80 ilm 529
                gSupplier.addItem("supplier.invoice.purchase.list");
67 ilm 530
                    gSupplier.addItem("supplier.credit.list");
531
            }
532
            group.add(gSupplier);
533
 
534
            final Group gProduct = new Group("menu.list.product", LayoutHints.DEFAULT_NOLABEL_SEPARATED_GROUP_HINTS);
535
            gProduct.addItem("product.list");
144 ilm 536
            // gProduct.addItem("product.customer.list");
83 ilm 537
            // gProduct.addItem("product.supplychain.list");
156 ilm 538
            if (prefs.getBoolean(GestionArticleGlobalPreferencePanel.STOCK_MULTI_DEPOT, false)) {
539
                gProduct.addItem("stock.depot.list");
540
                gProduct.addItem("stock.item.list");
541
            }
67 ilm 542
            gProduct.addItem("stock.io.list");
156 ilm 543
            gProduct.addItem("stock.io.state");
142 ilm 544
            gProduct.addItem("customer.order.waiting");
545
            gProduct.addItem("supplier.order.waiting");
67 ilm 546
            group.add(gProduct);
547
 
548
        return group;
549
    }
550
 
144 ilm 551
    public Group createTestMenuGroup() {
67 ilm 552
        final Group group = new Group("menu.test");
93 ilm 553
        group.addItem("test.lettrage.fact");
554
        group.addItem("test.lettrage.compt");
555
        group.addItem("test.lettrage.achat");
94 ilm 556
        // group.addItem("test.export.ecrp");
93 ilm 557
 
67 ilm 558
        return group;
559
    }
560
 
561
    /**
562
     * Actions
94 ilm 563
     */
144 ilm 564
    public void registerFilesMenuActions(final MenuAndActions mManager) {
142 ilm 565
        mManager.putAction(new SauvegardeBaseAction(), "backup");
566
        mManager.putAction(new AbstractAction() {
156 ilm 567
 
568
            private ModuleFrame frame = null;
569
 
67 ilm 570
            @Override
571
            public void actionPerformed(ActionEvent e) {
156 ilm 572
                if (this.frame == null) {
573
                    this.frame = new ModuleFrame(getConfiguration().getModuleManager());
574
                }
575
                this.frame.setLocationRelativeTo(null);
576
                FrameUtil.show(this.frame);
67 ilm 577
            }
142 ilm 578
        }, "modules");
156 ilm 579
        mManager.putAction(new PreferencesAction(getConfiguration().getModuleManager()), "preferences");
580
        mManager.putAction(new AbstractAction() {
581
            @Override
582
            public void actionPerformed(ActionEvent e) {
583
                MainFrame.getInstance().quit();
584
            }
585
        }, "quit");
67 ilm 586
    }
587
 
144 ilm 588
    public void registerCreationMenuActions(final MenuAndActions mManager) {
67 ilm 589
        final Boolean bModeVenteComptoir = DefaultNXProps.getInstance().getBooleanValue("ArticleVenteComptoir", true);
142 ilm 590
        final UserRights rights = UserRightsManager.getCurrentUserRights();
156 ilm 591
        final ComptaPropsConfiguration conf = this.getConfiguration();
67 ilm 592
 
593
        if (rights.haveRight(ComptaUserRight.MENU)) {
156 ilm 594
            mManager.putAction(new NouvelleSaisieKmAction(conf), "accounting.entry.create");
149 ilm 595
            mManager.putAction(new SaisieJournalAction(), "accounting.entry.ledger.create");
67 ilm 596
        }
597
 
73 ilm 598
 
156 ilm 599
        mManager.putAction(new NouveauDevisAction(conf), "customer.quote.create");
67 ilm 600
 
156 ilm 601
        mManager.putAction(new NouveauBonLivraisonAction(conf), "customer.delivery.create");
602
        mManager.putAction(new NouvelleCommandeClientAction(conf), "customer.order.create");
67 ilm 603
        if (bModeVenteComptoir && rights.haveRight("VENTE_COMPTOIR")) {
156 ilm 604
            mManager.putAction(new NouveauSaisieVenteComptoirAction(conf), "pos.sale.create");
67 ilm 605
        }
156 ilm 606
        mManager.putAction(new NouveauSaisieVenteFactureAction(conf), "customer.invoice.create");
67 ilm 607
 
156 ilm 608
        mManager.putAction(new NouveauAvoirClientAction(conf), "customer.credit.create");
174 ilm 609
        mManager.putAction(new TransfertStockAction(conf), "product.stock.transfert");
67 ilm 610
 
611
        if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
156 ilm 612
            mManager.putAction(new NouvelleDemandePrixAction(conf), "supplier.order.ask.create");
613
            mManager.putAction(new NouvelleCommandeAction(conf), "supplier.order.create");
614
            mManager.putAction(new NouveauBonReceptionAction(conf), "supplier.receipt.create");
615
            mManager.putAction(new NouveauSaisieAchatAction(conf), "supplier.purchase.create");
616
            mManager.putAction(new NouvelleFactureFournisseurAction(conf), "supplier.invoice.purchase.create");
617
            mManager.putAction(new NouvelAvoirFournisseurAction(conf), "supplier.credit.create");
618
            mManager.putAction(new NouvelleSaisieMouvementStockAction(conf), "stock.io.create");
67 ilm 619
        }
620
 
621
    }
622
 
144 ilm 623
    public void registerListMenuActions(final MenuAndActions mManager) {
156 ilm 624
        final ComptaPropsConfiguration conf = this.configuration;
67 ilm 625
        final Boolean bModeVenteComptoir = DefaultNXProps.getInstance().getBooleanValue("ArticleVenteComptoir", true);
144 ilm 626
 
156 ilm 627
        // FIXME conf.getCurrentUserRights();
142 ilm 628
        final UserRights rights = UserRightsManager.getCurrentUserRights();
67 ilm 629
 
156 ilm 630
        mManager.putAction(new ListeDesClientsAction(conf), "customer.list");
631
        SQLPreferences prefs = SQLPreferences.getMemCached(conf.getRootSociete());
93 ilm 632
        if (prefs.getBoolean(GestionClientPreferencePanel.DISPLAY_CLIENT_DPT, false)) {
156 ilm 633
            mManager.putAction(new ListeDesDepartementsClientsAction(conf), "customer.department.list");
93 ilm 634
        }
156 ilm 635
        mManager.putAction(new ListeDesContactsAction(conf), "contact.list");
67 ilm 636
 
637
        if (rights.haveRight(NXRights.ACCES_HISTORIQUE.getCode())) {
142 ilm 638
            mManager.putAction(new NouvelHistoriqueListeClientAction(), "customer.history");
67 ilm 639
        }
640
 
641
 
642
 
156 ilm 643
                mManager.putAction(new ListeDesDevisAction(conf), "customer.quote.list");
67 ilm 644
 
156 ilm 645
 
646
 
142 ilm 647
            mManager.putAction(new ListeDesCommandesClientAction(), "customer.order.list");
156 ilm 648
            mManager.putAction(new ListeDesFacturationCommandesClientAction(conf), "customer.order.invoice.list");
649
            mManager.putAction(new ListeDesCommandesClientItemsAction(conf), "customer.order.list.details");
650
            mManager.putAction(new ListeDesBonsDeLivraisonAction(conf), "customer.delivery.list");
651
            if (conf.getRootSociete().contains("RELIQUAT_BL")) {
652
                mManager.putAction(new ListeDesReliquatsBonsLivraisonsAction(), "customer.delivery.reliquat.list");
142 ilm 653
            }
67 ilm 654
 
655
        boolean useListDesVentesAction = bModeVenteComptoir;
656
        if (useListDesVentesAction) {
142 ilm 657
            mManager.putAction(new ListeDesVentesAction(), "sales.list");
67 ilm 658
 
659
        } else {
660
 
142 ilm 661
            mManager.putAction(new ListeSaisieVenteFactureAction(), "customer.invoice.list");
67 ilm 662
        }
663
 
156 ilm 664
        mManager.putAction(new ListeDesAvoirsClientsAction(conf), "customer.credit.list");
665
        mManager.putAction(new ListeDesFactureItemsAction(conf), "customer.invoice.details.list");
67 ilm 666
 
142 ilm 667
            mManager.putAction(new ListeDesFournisseursAction(), "supplier.list");
668
            mManager.putAction(new ListeDesContactsFournisseursAction(), "supplier.contact.list");
669
                mManager.putAction(new NouvelHistoriqueListeFournAction(), "supplier.history");
67 ilm 670
            if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
142 ilm 671
                    mManager.putAction(new ListeDesCommandesAction(), "supplier.order.list");
156 ilm 672
                    mManager.putAction(new ListeDesDemandesPrixAction(conf), "supplier.order.ask");
673
                    mManager.putAction(new ListeDesDemandesAchatsAction(conf), "supplier.order.preview");
142 ilm 674
                mManager.putAction(new ListeDesReliquatsBonsReceptionsAction(), "supplier.receipt.reliquat.list");
156 ilm 675
                mManager.putAction(new ListeDesBonsReceptionsAction(), "supplier.receipt.list");
676
                mManager.putAction(new ListeSaisieAchatAction(), "supplier.purchase.list");
677
                mManager.putAction(new ListeDesFacturesFournisseurAction(), "supplier.invoice.purchase.list");
678
                    mManager.putAction(new ListeDesAvoirsFournisseurAction(), "supplier.credit.list");
67 ilm 679
            }
680
 
156 ilm 681
            mManager.putAction(new ListeDesArticlesAction(), "product.list");
682
            mManager.putAction(new ListeHistoCodeClientArticleAction(), "product.customer.list");
683
            mManager.putAction(new ListeDesArticlesFournisseurAction(), "product.supplychain.list");
684
            mManager.putAction(new ListeDesDepotsStocksAction(), "stock.depot.list");
685
            mManager.putAction(new ListeDesStocksAction(), "stock.item.list");
686
            mManager.putAction(new ListeDesMouvementsStockAction(conf), "stock.io.list");
687
            mManager.putAction(new ListeDesEtatsStocksAction(conf), "stock.io.state");
688
            mManager.putAction(new ListeDesElementsACommanderClientAction(conf), "customer.order.waiting");
689
            mManager.putAction(new ListeDesElementsACommanderAction(conf), "supplier.order.waiting");
67 ilm 690
 
691
 
142 ilm 692
 
67 ilm 693
    }
694
 
90 ilm 695
    public void registerAccountingMenuActions(final MenuAndActions mManager) {
156 ilm 696
        mManager.putAction(new EtatBalanceAction(), "accounting.balance");
697
        mManager.putAction(new BalanceAgeeAction(), "accounting.client.balance");
698
        mManager.putAction(new ImpressionJournauxAnalytiqueAction(), "accounting.analytical.ledger");
699
        mManager.putAction(new EtatJournauxAction(), "accounting.ledger");
700
        mManager.putAction(new EtatGrandLivreAction(), "accounting.general.ledger");
701
        mManager.putAction(new ListeDesEcrituresAction(), "accounting.entries.ledger");
702
        mManager.putAction(new ListeDesEcrituresAnalytiquesAction(), "accounting.analytical.entries.ledger");
703
        mManager.putAction(new ListeDesPostesAnalytiquesAction(), "accounting.analytical.dpt");
704
        mManager.putAction(new ImpressionRepartitionAnalytiqueAction(), "accounting.analytical.ledger.global");
705
        mManager.putAction(new ListeEcritureParClasseAction(), "accounting.entries.list");
706
        mManager.putAction(new NouvelleValidationAction(), "accounting.validating");
707
        mManager.putAction(new NouveauClotureAction(), "accounting.closing");
708
        mManager.putAction(new ImportEcritureAction(), "accounting.import");
709
        mManager.putAction(new ExportRelationExpertAction(), "accounting.export");
67 ilm 710
    }
711
 
90 ilm 712
    public void registerStatsDocumentsActions(final MenuAndActions mManager) {
156 ilm 713
        // mManager.putAction("accounting.vat.report", new DeclarationTVAAction());
714
        mManager.putAction(new EtatChargeAction(), "accounting.costs.report");
715
        mManager.putAction(new CompteResultatBilanAction(), "accounting.balance.report");
716
        mManager.putAction(new N4DSAction(), "employe.social.report");
717
        // mManager.putAction("accounting.2050Report", new CompteResultatBilan2050Action());
67 ilm 718
    }
719
 
90 ilm 720
    public void registerStatsMenuActions(final MenuAndActions mManager) {
174 ilm 721
        final ComptaPropsConfiguration conf = getConfiguration();
67 ilm 722
 
156 ilm 723
        mManager.putAction(new EvolutionCAAction(), "sales.graph");
724
        mManager.putAction(new EvolutionCACumulAction(), "sales.graph.cumulate");
67 ilm 725
 
156 ilm 726
        mManager.putAction(new EvolutionCmdAction(), "sales.graph.cmd");
727
        mManager.putAction(new EvolutionCmdCumulAction(), "sales.graph.cmd.cumulate");
90 ilm 728
 
174 ilm 729
        mManager.putAction(new ReportingCommercialAction(conf.getRootSociete()), "sales.list.salesman.report");
730
 
156 ilm 731
            mManager.putAction(new EvolutionMargeAction(), "sales.margin.graph");
732
        mManager.putAction(new GenReportingVenteAction(false), "sales.list.reporting");
733
        mManager.putAction(new GenReportingVenteAction(true), "order.list.reporting");
734
        // mManager.putAction("sales.list.reporting", new GenReportingVenteAction());
735
        mManager.putAction(new GenListeVenteAction(), "sales.list.report");
736
        mManager.putAction(new GenEtatStockAction(), "sales.list.stock.report");
67 ilm 737
 
156 ilm 738
            mManager.putAction(new VenteArticleGraphAction(), "sales.product.graph");
739
            mManager.putAction(new VenteArticleMargeGraphAction(), "sales.product.margin.graph");
740
            mManager.putAction(new VenteArticleFamilleGraphAction(), "sales.product.family.graph");
741
        mManager.putAction(new EtatVenteAction(), "sales.list.graph");
67 ilm 742
 
156 ilm 743
        mManager.putAction(new AbstractAction("Reporting Eco Contribution") {
142 ilm 744
 
745
            @Override
746
            public void actionPerformed(ActionEvent e) {
747
 
748
                PanelFrame frame = new PanelFrame(new ReportingEcoContributionPanel(), "Reporting  Eco Contribution");
749
                frame.setVisible(true);
750
            }
156 ilm 751
        }, "sales.report.ecocontribution");
142 ilm 752
 
156 ilm 753
        mManager.putAction(new AbstractAction("Reporting Taxes complémentaires") {
144 ilm 754
 
755
            @Override
756
            public void actionPerformed(ActionEvent e) {
757
 
758
                PanelFrame frame = new PanelFrame(new ReportingTaxeComplementairePanel(), "Reporting Taxes complémentaires");
759
                frame.setVisible(true);
760
            }
156 ilm 761
        }, "sales.report.taxesupp");
144 ilm 762
 
67 ilm 763
    }
764
 
90 ilm 765
    public void registerPaymentMenuActions(final MenuAndActions mManager) {
142 ilm 766
        final UserRights rights = UserRightsManager.getCurrentUserRights();
156 ilm 767
        final ComptaPropsConfiguration conf = getConfiguration();
67 ilm 768
 
769
        if (rights.haveRight(ComptaUserRight.MENU) || rights.haveRight(ComptaUserRight.POINTAGE_LETTRAGE)) {
142 ilm 770
            mManager.putAction(new NouveauPointageAction(), "payment.checking.create");
771
            mManager.putAction(new NouveauLettrageAction(), "payment.reconciliation.create");
67 ilm 772
        }
773
 
774
        if (rights.haveRight(NXRights.GESTION_ENCAISSEMENT.getCode())) {
142 ilm 775
            mManager.putAction(new ListesFacturesClientsImpayeesAction(), "customer.invoice.unpaid.list");
174 ilm 776
            mManager.putAction(new ImportReglementSageAction(conf.getDirectory().getElement(EncaisserMontantSQLElement.class)), "customer.invoice.payment.xml.sage.import");
142 ilm 777
            mManager.putAction(new ListeDebiteursAction(), "customer.dept.list");
156 ilm 778
            mManager.putAction(new AbstractAction("Relevé client") {
779
                @Override
780
                public void actionPerformed(ActionEvent arg0) {
781
 
782
                    PanelFrame frame = new PanelFrame(new ReportingClientPanel(), "Reporting client");
783
                    frame.setVisible(true);
784
 
785
                }
786
            }, "customer.payment.report");
142 ilm 787
            mManager.putAction(new ListeDesEncaissementsAction(), "customer.payment.list");
788
            mManager.putAction(new ListeDesRelancesAction(), "customer.payment.followup.list");
789
            mManager.putAction(new ListeDesChequesAEncaisserAction(), "customer.payment.check.pending.list");
156 ilm 790
            mManager.putAction(new ListeDesDepostChequesAction(), "customer.payment.check.deposit.list");
791
            mManager.putAction(new NouveauListeDesChequesAEncaisserAction(conf), "customer.payment.check.pending.create");
792
            mManager.putAction(new ListeSDDMessageAction(conf.getDirectory()), "customer.payment.sddMessage.list");
142 ilm 793
            mManager.putAction(new ListeDesChequesAvoirAction(), "customer.credit.check.list");
156 ilm 794
            mManager.putAction(new NouveauDecaissementChequeAvoirAction(conf), "customer.credit.check.create");
67 ilm 795
        }
796
        if (rights.haveRight(NXRights.LOCK_MENU_ACHAT.getCode())) {
142 ilm 797
            mManager.putAction(new ListesFacturesFournImpayeesAction(), "supplier.invoice.unpaid.list");
798
            mManager.putAction(new ListeDesTraitesFournisseursAction(), "supplier.bill.list");
799
            mManager.putAction(new ListeDesChequesFournisseursAction(), "supplier.payment.check.list");
156 ilm 800
            mManager.putAction(new NouveauListeDesChequesADecaisserAction(conf), "supplier.payment.check.pending.list");
67 ilm 801
        }
802
 
803
    }
804
 
144 ilm 805
    public void registerPayrollMenuActions(final MenuAndActions mManager) {
156 ilm 806
        final ComptaPropsConfiguration conf = getConfiguration();
142 ilm 807
        mManager.putAction(new ImpressionLivrePayeAction(), "payroll.list.report.print");
808
        mManager.putAction(new ListeDesProfilsPayeAction(), "payroll.profile.list");
809
        mManager.putAction(new NouvelHistoriqueFichePayeAction(), "payroll.history");
810
        mManager.putAction(new EditionFichePayeAction(), "payroll.create");
156 ilm 811
        mManager.putAction(new NouvelAcompteAction(conf), "payroll.deposit.create");
142 ilm 812
        mManager.putAction(new ListeDesSalariesAction(), "employee.list");
813
        mManager.putAction(new ListeDesContratsPrevoyanceAction(), "employee.contrat.prev.list");
814
        mManager.putAction(new ListeDesCaissesCotisationsAction(), "payroll.caisse");
815
        mManager.putAction(new ListeDesAyantsDroitsAction(), "employee.contrat.prev.ayantdroit.list");
67 ilm 816
 
142 ilm 817
        mManager.putAction(new ListeDesRubriquesDePayeAction(), "payroll.section");
818
        mManager.putAction(new ListeDesVariablesPayes(), "payroll.variable");
819
        mManager.putAction(new ListeDesInfosSalariePayeAction(), "payroll.infos.history");
820
        mManager.putAction(new ClotureMensuellePayeAction(), "payroll.closing");
821
 
67 ilm 822
    }
823
 
90 ilm 824
    public void registerOrganizationMenuActions(final MenuAndActions mManager) {
142 ilm 825
        final UserRights rights = UserRightsManager.getCurrentUserRights();
144 ilm 826
 
67 ilm 827
        if (rights.haveRight(ComptaUserRight.MENU)) {
83 ilm 828
            mManager.putAction(new GestionPlanComptableEAction(), "accounting.chart");
142 ilm 829
            mManager.putAction(new ListeDesComptesAction(), "accounting.list");
830
 
83 ilm 831
            mManager.putAction(new ListeDesJournauxAction(), "accounting.journal");
832
            mManager.putAction(new ListeDesDevisesAction(), "accounting.currency");
156 ilm 833
            mManager.putAction(new ListeDesCategorieComptableAction(), "accounting.category.list");
93 ilm 834
            mManager.putAction(new ListeDesTauxDeChangeAction(), "accounting.currency.rates");
80 ilm 835
            mManager.putAction(new AbstractAction("Check DB") {
836
                @Override
837
                public void actionPerformed(ActionEvent e) {
144 ilm 838
                    final DBRoot rootSociete = configuration.getRootSociete();
80 ilm 839
                    final SQLSelect sel = CorrectMouvement.createUnbalancedSelect(rootSociete);
840
                    final List<?> ids = rootSociete.getDBSystemRoot().getDataSource().executeCol(sel.asString());
142 ilm 841
                    JOptionPane.showMessageDialog((Component) e.getSource(), "Il y a " + ids.size() + " mouvement(s) non équilibré(s).", "Résultat",
842
                            ids.size() == 0 ? JOptionPane.INFORMATION_MESSAGE : JOptionPane.WARNING_MESSAGE);
80 ilm 843
                }
844
            }, "accounting.checkDB");
67 ilm 845
        }
142 ilm 846
        mManager.putAction(new ListeEcoContributionAction(), "product.ecotax");
67 ilm 847
 
848
        if (rights.haveRight(LockAdminUserRight.LOCK_MENU_ADMIN)) {
142 ilm 849
            mManager.putAction(new ListeDesUsersCommonAction(), "user.list");
850
            mManager.putAction(new GestionDroitsAction(), "user.right.list");
851
            mManager.putAction(new TaskAdminAction(), "user.task.right");
67 ilm 852
        }
174 ilm 853
        mManager.putAction(new ListeDesModelesEmailAction(), "email.template.list");
142 ilm 854
        mManager.putAction(new ListeDesContactsAdministratif(), "office.contact.list");
855
        mManager.putAction(new ListeDesCommerciauxAction(), "salesman.list");
856
        mManager.putAction(new ListeDesCaissesTicketAction(), "pos.list");
67 ilm 857
 
858
 
142 ilm 859
            mManager.putAction(new ListeDesSocietesCommonsAction(), "enterprise.list");
67 ilm 860
 
142 ilm 861
        mManager.putAction(new ListeBanqueAction(), "divison.bank.list");
156 ilm 862
            mManager.putAction(new NouvelleSocieteAction(this.getConfiguration()), "enterprise.create");
67 ilm 863
    }
864
 
144 ilm 865
    public void registerHelpMenuActions(final MenuAndActions mManager) {
142 ilm 866
        mManager.putAction(AboutAction.getInstance(), "information");
867
        mManager.putAction(new AstuceAction(), "tips");
67 ilm 868
    }
869
 
144 ilm 870
    public void registerHelpTestActions(final MenuAndActions mManager) {
93 ilm 871
 
156 ilm 872
        mManager.putAction(new NouveauClotureSansAnouveauxAction(), "accounting.closing.sansanouveaux");
873
        // mManager.putAction("test.export.ecrp", new ExportPointageAction());
94 ilm 874
 
67 ilm 875
    }
876
}