OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 93 | Rev 142 | 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;
20
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.preferences.SQLPreferences;
22
import org.openconcerto.ui.preferences.JavaPrefPreferencePanel;
23
import org.openconcerto.ui.preferences.PrefView;
24
import org.openconcerto.utils.PrefType;
25
 
26
import javax.swing.ButtonGroup;
27
import javax.swing.JCheckBox;
28
 
29
public class GestionCommercialeGlobalPreferencePanel extends JavaPrefPreferencePanel {
30
    public static String TRANSFERT_REF = "TransfertRef";
31
    public static String TRANSFERT_MULTI_REF = "TransfertMultiRef";
32
    public static String TRANSFERT_NO_REF = "TransfertNoRef";
93 ilm 33
    public static String ORDER_PACKAGING_MANAGEMENT = "OrderPackagingManagement";
94 ilm 34
    public static String ADDRESS_SPEC = "AddressSpec";
35
    public static String GESTION_TIMBRE_FISCAL = "GestionTimbreFiscal";
36
    public static String TAUX_TIMBRE_FISCAL = "TauxTimbreFiscal";
83 ilm 37
 
38
    public GestionCommercialeGlobalPreferencePanel() {
39
        super("Gestion des pièces commerciales", null);
40
        setPrefs(new SQLPreferences(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete()));
41
    }
42
 
43
    @Override
44
    protected void addViews() {
45
        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);
46
        viewTransfert.setDefaultValue(Boolean.TRUE);
47
        this.addView(viewTransfert);
48
 
49
        PrefView<Boolean> viewMultiTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commerciales dans le corps", TRANSFERT_MULTI_REF);
50
        viewMultiTransfert.setDefaultValue(Boolean.FALSE);
51
        this.addView(viewMultiTransfert);
52
 
53
        PrefView<Boolean> viewNo = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas transférer les numéros des pièces commerciales", TRANSFERT_NO_REF);
54
        viewNo.setDefaultValue(Boolean.FALSE);
55
        this.addView(viewNo);
56
 
93 ilm 57
        PrefView<Boolean> orderPackaging = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer la préparation des commandes clients", ORDER_PACKAGING_MANAGEMENT);
58
        orderPackaging.setDefaultValue(Boolean.TRUE);
59
        this.addView(orderPackaging);
60
 
94 ilm 61
        PrefView<Boolean> addressSpec = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Afficher les sélecteurs d'adresse spécifique", ADDRESS_SPEC);
62
        addressSpec.setDefaultValue(Boolean.TRUE);
63
        this.addView(addressSpec);
64
 
65
        PrefView<Boolean> gestTimbreFisc = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Activer la gestion du timbre fiscal", GESTION_TIMBRE_FISCAL);
66
        gestTimbreFisc.setDefaultValue(Boolean.FALSE);
67
        this.addView(gestTimbreFisc);
68
 
69
        PrefView<Double> tauxTimbreFisc = new PrefView<Double>(PrefType.DOUBLE_TYPE, "Taux du timbre fiscal", TAUX_TIMBRE_FISCAL);
70
        tauxTimbreFisc.setDefaultValue(Double.valueOf(1));
71
        this.addView(tauxTimbreFisc);
72
 
83 ilm 73
        ButtonGroup group = new ButtonGroup();
74
        group.add((JCheckBox) viewMultiTransfert.getVW().getComp());
75
        group.add((JCheckBox) viewTransfert.getVW().getComp());
76
        group.add((JCheckBox) viewNo.getVW().getComp());
77
 
78
    }
79
}