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