OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 83 | Rev 94 | 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";
83 ilm 34
 
35
    public GestionCommercialeGlobalPreferencePanel() {
36
        super("Gestion des pièces commerciales", null);
37
        setPrefs(new SQLPreferences(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete()));
38
    }
39
 
40
    @Override
41
    protected void addViews() {
42
        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);
43
        viewTransfert.setDefaultValue(Boolean.TRUE);
44
        this.addView(viewTransfert);
45
 
46
        PrefView<Boolean> viewMultiTransfert = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Transférer les numéros des pièces commerciales dans le corps", TRANSFERT_MULTI_REF);
47
        viewMultiTransfert.setDefaultValue(Boolean.FALSE);
48
        this.addView(viewMultiTransfert);
49
 
50
        PrefView<Boolean> viewNo = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas transférer les numéros des pièces commerciales", TRANSFERT_NO_REF);
51
        viewNo.setDefaultValue(Boolean.FALSE);
52
        this.addView(viewNo);
53
 
93 ilm 54
        PrefView<Boolean> orderPackaging = new PrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Gérer la préparation des commandes clients", ORDER_PACKAGING_MANAGEMENT);
55
        orderPackaging.setDefaultValue(Boolean.TRUE);
56
        this.addView(orderPackaging);
57
 
83 ilm 58
        ButtonGroup group = new ButtonGroup();
59
        group.add((JCheckBox) viewMultiTransfert.getVW().getComp());
60
        group.add((JCheckBox) viewTransfert.getVW().getComp());
61
        group.add((JCheckBox) viewNo.getVW().getComp());
62
 
63
    }
64
}