OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
83 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
 /*
15
 * Créé le 6 mars 2012
16
 */
17
package org.openconcerto.erp.preferences;
18
 
19
import org.openconcerto.erp.config.ComptaPropsConfiguration;
142 ilm 20
import org.openconcerto.erp.core.common.ui.AbstractArticleItemTable;
83 ilm 21
import org.openconcerto.sql.Configuration;
22
import org.openconcerto.sql.preferences.SQLPreferences;
23
import org.openconcerto.ui.preferences.JavaPrefPreferencePanel;
24
import org.openconcerto.ui.preferences.PrefView;
25
import org.openconcerto.utils.PrefType;
26
 
27
import javax.swing.ButtonGroup;
28
import javax.swing.JCheckBox;
29
 
30
public class GestionCommercialeGlobalPreferencePanel extends JavaPrefPreferencePanel {
31
    public static String TRANSFERT_REF = "TransfertRef";
174 ilm 32
    public static String COMMANDE_FOURNISSEUR_EN_COURS = "CommandeFournisseurEncours";
83 ilm 33
    public static String TRANSFERT_MULTI_REF = "TransfertMultiRef";
34
    public static String TRANSFERT_NO_REF = "TransfertNoRef";
149 ilm 35
    public static String ACOMPTE_DEVIS = "AcompteDevis";
93 ilm 36
    public static String ORDER_PACKAGING_MANAGEMENT = "OrderPackagingManagement";
94 ilm 37
    public static String ADDRESS_SPEC = "AddressSpec";
174 ilm 38
    public static String CATEGORIE_COMPTABLE_SPEC = "CategorieComptableSpec";
94 ilm 39
    public static String GESTION_TIMBRE_FISCAL = "GestionTimbreFiscal";
40
    public static String TAUX_TIMBRE_FISCAL = "TauxTimbreFiscal";
142 ilm 41
    public static String BARCODE_INSERTION = "BarcodeInsertion";
144 ilm 42
    public static String CREATE_ECR_CHQ = "CreateEcritureCheque";
43
    public static String CHIFFRAGE_COMMANDE_CLIENT = "ChiffrageCmdClient";
149 ilm 44
    public static String IMPUT_ECART = "ImputEcart";
156 ilm 45
    public static String FRAIS_DOCUMENT = "GestionFraisDocuments";
83 ilm 46
 
47
    public GestionCommercialeGlobalPreferencePanel() {
48
        super("Gestion des pièces commerciales", null);
49
        setPrefs(new SQLPreferences(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete()));
50
    }
51
 
52
    @Override
53
    protected void addViews() {
54
        PrefView<Boolean> viewTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commeriales en tant que référence", TRANSFERT_REF);
55
        viewTransfert.setDefaultValue(Boolean.TRUE);
56
        this.addView(viewTransfert);
57
 
58
        PrefView<Boolean> viewMultiTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commerciales dans le corps", TRANSFERT_MULTI_REF);
59
        viewMultiTransfert.setDefaultValue(Boolean.FALSE);
60
        this.addView(viewMultiTransfert);
61
 
62
        PrefView<Boolean> viewNo = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas transférer les numéros des pièces commerciales", TRANSFERT_NO_REF);
63
        viewNo.setDefaultValue(Boolean.FALSE);
64
        this.addView(viewNo);
65
 
93 ilm 66
        PrefView<Boolean> orderPackaging = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer la préparation des commandes clients", ORDER_PACKAGING_MANAGEMENT);
67
        orderPackaging.setDefaultValue(Boolean.TRUE);
68
        this.addView(orderPackaging);
69
 
144 ilm 70
        PrefView<Boolean> orderQuoting = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer le chiffrage détaillés des commandes clients", CHIFFRAGE_COMMANDE_CLIENT);
71
        orderQuoting.setDefaultValue(Boolean.FALSE);
72
        this.addView(orderQuoting);
73
 
174 ilm 74
        PrefView<Boolean> cmdEnCours = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Activer la gestion des commandes fournisseurs en cours", COMMANDE_FOURNISSEUR_EN_COURS);
75
        cmdEnCours.setDefaultValue(Boolean.FALSE);
76
        this.addView(cmdEnCours);
77
 
149 ilm 78
        PrefView<Boolean> viewAcompteDevis = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer les acomptes sur devis", ACOMPTE_DEVIS);
79
        viewAcompteDevis.setDefaultValue(Boolean.FALSE);
80
        this.addView(viewAcompteDevis);
81
 
94 ilm 82
        PrefView<Boolean> addressSpec = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les sélecteurs d'adresse spécifique", ADDRESS_SPEC);
83
        addressSpec.setDefaultValue(Boolean.TRUE);
84
        this.addView(addressSpec);
174 ilm 85
 
86
        PrefView<Boolean> catComptableSpec = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les sélecteurs de catégorie comptable spécifique", CATEGORIE_COMPTABLE_SPEC);
87
        catComptableSpec.setDefaultValue(Boolean.FALSE);
88
        this.addView(catComptableSpec);
94 ilm 89
 
90
        PrefView<Boolean> gestTimbreFisc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Activer la gestion du timbre fiscal", GESTION_TIMBRE_FISCAL);
91
        gestTimbreFisc.setDefaultValue(Boolean.FALSE);
92
        this.addView(gestTimbreFisc);
93
 
94
        PrefView<Double> tauxTimbreFisc = new PrefView<Double>(PrefType.DOUBLE_TYPE, "Taux du timbre fiscal", TAUX_TIMBRE_FISCAL);
95
        tauxTimbreFisc.setDefaultValue(Double.valueOf(1));
96
        this.addView(tauxTimbreFisc);
97
 
142 ilm 98
        PrefView<Boolean> ecoColumns = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les colonnes éco-contributions", AbstractArticleItemTable.SHOW_ECO_CONTRIBUTION_COLUMNS);
99
        ecoColumns.setDefaultValue(Boolean.FALSE);
100
        this.addView(ecoColumns);
101
 
156 ilm 102
        PrefView<Boolean> fraisDoc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer des frais sur la création des documents clients", FRAIS_DOCUMENT);
103
        fraisDoc.setDefaultValue(Boolean.FALSE);
104
        this.addView(fraisDoc);
105
 
142 ilm 106
        PrefView<Boolean> ecoTotal = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher le total de l'éco-contribution", AbstractArticleItemTable.SHOW_TOTAL_ECO_CONTRIBUTION);
107
        ecoTotal.setDefaultValue(Boolean.FALSE);
108
        this.addView(ecoTotal);
109
 
110
        PrefView<Boolean> barcodeInsert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Insérer des lignes dans le corps avec la douchette", BARCODE_INSERTION);
111
        barcodeInsert.setDefaultValue(Boolean.FALSE);
112
        this.addView(barcodeInsert);
113
 
144 ilm 114
        PrefView<Boolean> createEcrChq = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Créer les écritures comptables à la réception des chèques clients", CREATE_ECR_CHQ);
115
        createEcrChq.setDefaultValue(Boolean.TRUE);
116
        this.addView(createEcrChq);
117
 
149 ilm 118
        PrefView<Boolean> createEcrImput = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Imputer les écarts de calcul dans le compte 758", IMPUT_ECART);
119
        createEcrImput.setDefaultValue(Boolean.TRUE);
120
        this.addView(createEcrImput);
121
 
83 ilm 122
        ButtonGroup group = new ButtonGroup();
123
        group.add((JCheckBox) viewMultiTransfert.getVW().getComp());
124
        group.add((JCheckBox) viewTransfert.getVW().getComp());
125
        group.add((JCheckBox) viewNo.getVW().getComp());
126
 
127
    }
128
}