OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Rev 174 | 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";
32
    public static String TRANSFERT_MULTI_REF = "TransfertMultiRef";
33
    public static String TRANSFERT_NO_REF = "TransfertNoRef";
149 ilm 34
    public static String ACOMPTE_DEVIS = "AcompteDevis";
93 ilm 35
    public static String ORDER_PACKAGING_MANAGEMENT = "OrderPackagingManagement";
94 ilm 36
    public static String ADDRESS_SPEC = "AddressSpec";
37
    public static String GESTION_TIMBRE_FISCAL = "GestionTimbreFiscal";
38
    public static String TAUX_TIMBRE_FISCAL = "TauxTimbreFiscal";
142 ilm 39
    public static String BARCODE_INSERTION = "BarcodeInsertion";
144 ilm 40
    public static String CREATE_ECR_CHQ = "CreateEcritureCheque";
41
    public static String CHIFFRAGE_COMMANDE_CLIENT = "ChiffrageCmdClient";
149 ilm 42
    public static String IMPUT_ECART = "ImputEcart";
156 ilm 43
    public static String FRAIS_DOCUMENT = "GestionFraisDocuments";
83 ilm 44
 
45
    public GestionCommercialeGlobalPreferencePanel() {
46
        super("Gestion des pièces commerciales", null);
47
        setPrefs(new SQLPreferences(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete()));
48
    }
49
 
50
    @Override
51
    protected void addViews() {
52
        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);
53
        viewTransfert.setDefaultValue(Boolean.TRUE);
54
        this.addView(viewTransfert);
55
 
56
        PrefView<Boolean> viewMultiTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commerciales dans le corps", TRANSFERT_MULTI_REF);
57
        viewMultiTransfert.setDefaultValue(Boolean.FALSE);
58
        this.addView(viewMultiTransfert);
59
 
60
        PrefView<Boolean> viewNo = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas transférer les numéros des pièces commerciales", TRANSFERT_NO_REF);
61
        viewNo.setDefaultValue(Boolean.FALSE);
62
        this.addView(viewNo);
63
 
93 ilm 64
        PrefView<Boolean> orderPackaging = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer la préparation des commandes clients", ORDER_PACKAGING_MANAGEMENT);
65
        orderPackaging.setDefaultValue(Boolean.TRUE);
66
        this.addView(orderPackaging);
67
 
144 ilm 68
        PrefView<Boolean> orderQuoting = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer le chiffrage détaillés des commandes clients", CHIFFRAGE_COMMANDE_CLIENT);
69
        orderQuoting.setDefaultValue(Boolean.FALSE);
70
        this.addView(orderQuoting);
71
 
149 ilm 72
        PrefView<Boolean> viewAcompteDevis = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer les acomptes sur devis", ACOMPTE_DEVIS);
73
        viewAcompteDevis.setDefaultValue(Boolean.FALSE);
74
        this.addView(viewAcompteDevis);
75
 
94 ilm 76
        PrefView<Boolean> addressSpec = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les sélecteurs d'adresse spécifique", ADDRESS_SPEC);
77
        addressSpec.setDefaultValue(Boolean.TRUE);
78
        this.addView(addressSpec);
79
 
80
        PrefView<Boolean> gestTimbreFisc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Activer la gestion du timbre fiscal", GESTION_TIMBRE_FISCAL);
81
        gestTimbreFisc.setDefaultValue(Boolean.FALSE);
82
        this.addView(gestTimbreFisc);
83
 
84
        PrefView<Double> tauxTimbreFisc = new PrefView<Double>(PrefType.DOUBLE_TYPE, "Taux du timbre fiscal", TAUX_TIMBRE_FISCAL);
85
        tauxTimbreFisc.setDefaultValue(Double.valueOf(1));
86
        this.addView(tauxTimbreFisc);
87
 
142 ilm 88
        PrefView<Boolean> ecoColumns = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les colonnes éco-contributions", AbstractArticleItemTable.SHOW_ECO_CONTRIBUTION_COLUMNS);
89
        ecoColumns.setDefaultValue(Boolean.FALSE);
90
        this.addView(ecoColumns);
91
 
156 ilm 92
        PrefView<Boolean> fraisDoc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer des frais sur la création des documents clients", FRAIS_DOCUMENT);
93
        fraisDoc.setDefaultValue(Boolean.FALSE);
94
        this.addView(fraisDoc);
95
 
142 ilm 96
        PrefView<Boolean> ecoTotal = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher le total de l'éco-contribution", AbstractArticleItemTable.SHOW_TOTAL_ECO_CONTRIBUTION);
97
        ecoTotal.setDefaultValue(Boolean.FALSE);
98
        this.addView(ecoTotal);
99
 
100
        PrefView<Boolean> barcodeInsert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Insérer des lignes dans le corps avec la douchette", BARCODE_INSERTION);
101
        barcodeInsert.setDefaultValue(Boolean.FALSE);
102
        this.addView(barcodeInsert);
103
 
144 ilm 104
        PrefView<Boolean> createEcrChq = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Créer les écritures comptables à la réception des chèques clients", CREATE_ECR_CHQ);
105
        createEcrChq.setDefaultValue(Boolean.TRUE);
106
        this.addView(createEcrChq);
107
 
149 ilm 108
        PrefView<Boolean> createEcrImput = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Imputer les écarts de calcul dans le compte 758", IMPUT_ECART);
109
        createEcrImput.setDefaultValue(Boolean.TRUE);
110
        this.addView(createEcrImput);
111
 
83 ilm 112
        ButtonGroup group = new ButtonGroup();
113
        group.add((JCheckBox) viewMultiTransfert.getVW().getComp());
114
        group.add((JCheckBox) viewTransfert.getVW().getComp());
115
        group.add((JCheckBox) viewNo.getVW().getComp());
116
 
117
    }
118
}