OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 94 | Rev 144 | 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";
93 ilm 34
    public static String ORDER_PACKAGING_MANAGEMENT = "OrderPackagingManagement";
94 ilm 35
    public static String ADDRESS_SPEC = "AddressSpec";
36
    public static String GESTION_TIMBRE_FISCAL = "GestionTimbreFiscal";
37
    public static String TAUX_TIMBRE_FISCAL = "TauxTimbreFiscal";
142 ilm 38
    public static String BARCODE_INSERTION = "BarcodeInsertion";
83 ilm 39
 
40
    public GestionCommercialeGlobalPreferencePanel() {
41
        super("Gestion des pièces commerciales", null);
42
        setPrefs(new SQLPreferences(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete()));
43
    }
44
 
45
    @Override
46
    protected void addViews() {
47
        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);
48
        viewTransfert.setDefaultValue(Boolean.TRUE);
49
        this.addView(viewTransfert);
50
 
51
        PrefView<Boolean> viewMultiTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commerciales dans le corps", TRANSFERT_MULTI_REF);
52
        viewMultiTransfert.setDefaultValue(Boolean.FALSE);
53
        this.addView(viewMultiTransfert);
54
 
55
        PrefView<Boolean> viewNo = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas transférer les numéros des pièces commerciales", TRANSFERT_NO_REF);
56
        viewNo.setDefaultValue(Boolean.FALSE);
57
        this.addView(viewNo);
58
 
93 ilm 59
        PrefView<Boolean> orderPackaging = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer la préparation des commandes clients", ORDER_PACKAGING_MANAGEMENT);
60
        orderPackaging.setDefaultValue(Boolean.TRUE);
61
        this.addView(orderPackaging);
62
 
94 ilm 63
        PrefView<Boolean> addressSpec = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les sélecteurs d'adresse spécifique", ADDRESS_SPEC);
64
        addressSpec.setDefaultValue(Boolean.TRUE);
65
        this.addView(addressSpec);
66
 
67
        PrefView<Boolean> gestTimbreFisc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Activer la gestion du timbre fiscal", GESTION_TIMBRE_FISCAL);
68
        gestTimbreFisc.setDefaultValue(Boolean.FALSE);
69
        this.addView(gestTimbreFisc);
70
 
71
        PrefView<Double> tauxTimbreFisc = new PrefView<Double>(PrefType.DOUBLE_TYPE, "Taux du timbre fiscal", TAUX_TIMBRE_FISCAL);
72
        tauxTimbreFisc.setDefaultValue(Double.valueOf(1));
73
        this.addView(tauxTimbreFisc);
74
 
142 ilm 75
        PrefView<Boolean> ecoColumns = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les colonnes éco-contributions", AbstractArticleItemTable.SHOW_ECO_CONTRIBUTION_COLUMNS);
76
        ecoColumns.setDefaultValue(Boolean.FALSE);
77
        this.addView(ecoColumns);
78
 
79
        PrefView<Boolean> ecoTotal = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher le total de l'éco-contribution", AbstractArticleItemTable.SHOW_TOTAL_ECO_CONTRIBUTION);
80
        ecoTotal.setDefaultValue(Boolean.FALSE);
81
        this.addView(ecoTotal);
82
 
83
        PrefView<Boolean> barcodeInsert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Insérer des lignes dans le corps avec la douchette", BARCODE_INSERTION);
84
        barcodeInsert.setDefaultValue(Boolean.FALSE);
85
        this.addView(barcodeInsert);
86
 
83 ilm 87
        ButtonGroup group = new ButtonGroup();
88
        group.add((JCheckBox) viewMultiTransfert.getVW().getComp());
89
        group.add((JCheckBox) viewTransfert.getVW().getComp());
90
        group.add((JCheckBox) viewNo.getVW().getComp());
91
 
92
    }
93
}