Line 14... |
Line 14... |
14 |
package org.openconcerto.erp.core.sales.product.ui;
|
14 |
package org.openconcerto.erp.core.sales.product.ui;
|
15 |
|
15 |
|
16 |
import org.openconcerto.erp.config.ComptaPropsConfiguration;
|
16 |
import org.openconcerto.erp.config.ComptaPropsConfiguration;
|
17 |
import org.openconcerto.erp.core.common.ui.AbstractVenteArticleItemTable;
|
17 |
import org.openconcerto.erp.core.common.ui.AbstractVenteArticleItemTable;
|
18 |
import org.openconcerto.erp.core.common.ui.TotalPanel;
|
18 |
import org.openconcerto.erp.core.common.ui.TotalPanel;
|
- |
|
19 |
import org.openconcerto.erp.core.supplychain.stock.element.DepotStockSQLElement;
|
19 |
import org.openconcerto.erp.preferences.DefaultNXProps;
|
20 |
import org.openconcerto.erp.preferences.DefaultNXProps;
|
20 |
import org.openconcerto.sql.Configuration;
|
21 |
import org.openconcerto.sql.Configuration;
|
- |
|
22 |
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
|
21 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
23 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
22 |
import org.openconcerto.ui.VerticalLayout;
|
24 |
import org.openconcerto.ui.VerticalLayout;
|
23 |
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
|
25 |
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
|
24 |
import org.openconcerto.ui.preferences.DefaultProps;
|
26 |
import org.openconcerto.ui.preferences.DefaultProps;
|
25 |
|
27 |
|
Line 28... |
Line 30... |
28 |
import java.awt.event.ItemEvent;
|
30 |
import java.awt.event.ItemEvent;
|
29 |
import java.awt.event.ItemListener;
|
31 |
import java.awt.event.ItemListener;
|
30 |
|
32 |
|
31 |
import javax.swing.BorderFactory;
|
33 |
import javax.swing.BorderFactory;
|
32 |
import javax.swing.JCheckBox;
|
34 |
import javax.swing.JCheckBox;
|
- |
|
35 |
import javax.swing.JLabel;
|
33 |
import javax.swing.JPanel;
|
36 |
import javax.swing.JPanel;
|
34 |
|
37 |
|
35 |
public class GestionArticlePreferencePanel extends DefaultPreferencePanel {
|
38 |
public class GestionArticlePreferencePanel extends DefaultPreferencePanel {
|
36 |
|
39 |
|
37 |
private final JCheckBox checkModeVente, checkLongueur, checkLargeur, checkPoids;
|
40 |
private final JCheckBox checkModeVente, checkLongueur, checkLargeur, checkPoids;
|
38 |
private final JCheckBox checkService, checkVenteComptoir, checkShowPoids, checkShowStyle, checkSFE;
|
41 |
private final JCheckBox checkService, checkVenteComptoir, checkShowPoids, checkShowStyle, checkSFE;
|
39 |
private final JCheckBox checkMarge;
|
42 |
private final JCheckBox checkMarge;
|
40 |
private JCheckBox checkSite;
|
43 |
private JCheckBox checkSite;
|
- |
|
44 |
private SQLRequestComboBox boxDepot = new SQLRequestComboBox();
|
41 |
|
45 |
|
42 |
public GestionArticlePreferencePanel() {
|
46 |
public GestionArticlePreferencePanel() {
|
43 |
super();
|
47 |
super();
|
44 |
setLayout(new GridBagLayout());
|
48 |
setLayout(new GridBagLayout());
|
45 |
final GridBagConstraints c = new DefaultGridBagConstraints();
|
49 |
final GridBagConstraints c = new DefaultGridBagConstraints();
|
Line 55... |
Line 59... |
55 |
this.checkModeVente = new JCheckBox("Activer le mode de vente spécifique");
|
59 |
this.checkModeVente = new JCheckBox("Activer le mode de vente spécifique");
|
56 |
this.checkVenteComptoir = new JCheckBox("Activer le mode vente comptoir");
|
60 |
this.checkVenteComptoir = new JCheckBox("Activer le mode vente comptoir");
|
57 |
this.checkShowPoids = new JCheckBox("Voir le Poids");
|
61 |
this.checkShowPoids = new JCheckBox("Voir le Poids");
|
58 |
this.checkMarge = new JCheckBox("Afficher le taux de marque au lieu du taux de marge");
|
62 |
this.checkMarge = new JCheckBox("Afficher le taux de marque au lieu du taux de marge");
|
59 |
|
63 |
|
- |
|
64 |
final ComptaPropsConfiguration comptaPropsConfiguration = (ComptaPropsConfiguration) Configuration.getInstance();
|
- |
|
65 |
final DepotStockSQLElement elementDepot = comptaPropsConfiguration.getDirectory().getElement(DepotStockSQLElement.class);
|
- |
|
66 |
this.boxDepot.uiInit(elementDepot.createComboRequest());
|
60 |
|
67 |
|
- |
|
68 |
|
- |
|
69 |
this.add(new JLabel("Dépôt de stock par défaut"), c);
|
- |
|
70 |
c.gridx++;
|
- |
|
71 |
this.add(this.boxDepot, c);
|
- |
|
72 |
c.gridx = 0;
|
- |
|
73 |
c.gridy++;
|
- |
|
74 |
|
- |
|
75 |
c.gridwidth = 2;
|
61 |
this.add(this.checkMarge, c);
|
76 |
this.add(this.checkMarge, c);
|
62 |
c.gridy++;
|
77 |
c.gridy++;
|
63 |
this.add(this.checkService, c);
|
78 |
this.add(this.checkService, c);
|
64 |
c.gridy++;
|
79 |
c.gridy++;
|
65 |
this.add(this.checkVenteComptoir, c);
|
80 |
this.add(this.checkVenteComptoir, c);
|
Line 105... |
Line 120... |
105 |
if (this.checkSite != null) {
|
120 |
if (this.checkSite != null) {
|
106 |
props.setProperty("ShowSiteFacture", String.valueOf(this.checkSite.isSelected()));
|
121 |
props.setProperty("ShowSiteFacture", String.valueOf(this.checkSite.isSelected()));
|
107 |
}
|
122 |
}
|
108 |
props.setProperty("ArticleVenteComptoir", String.valueOf(this.checkVenteComptoir.isSelected()));
|
123 |
props.setProperty("ArticleVenteComptoir", String.valueOf(this.checkVenteComptoir.isSelected()));
|
109 |
props.setProperty(TotalPanel.MARGE_MARQUE, String.valueOf(this.checkMarge.isSelected()));
|
124 |
props.setProperty(TotalPanel.MARGE_MARQUE, String.valueOf(this.checkMarge.isSelected()));
|
- |
|
125 |
int selId = DepotStockSQLElement.DEFAULT_ID;
|
- |
|
126 |
if (!this.boxDepot.isEmpty() && !this.boxDepot.getSelectedRow().isUndefined()) {
|
- |
|
127 |
selId = this.boxDepot.getSelectedId();
|
- |
|
128 |
}
|
- |
|
129 |
props.setProperty("DepotStockDefault", String.valueOf(selId));
|
110 |
props.store();
|
130 |
props.store();
|
111 |
}
|
131 |
}
|
112 |
|
132 |
|
113 |
@Override
|
133 |
@Override
|
114 |
public void restoreToDefaults() {
|
134 |
public void restoreToDefaults() {
|
Line 130... |
Line 150... |
130 |
return "Gestion des articles";
|
150 |
return "Gestion des articles";
|
131 |
}
|
151 |
}
|
132 |
|
152 |
|
133 |
private void setValues() {
|
153 |
private void setValues() {
|
134 |
final DefaultProps props = DefaultNXProps.getInstance();
|
154 |
final DefaultProps props = DefaultNXProps.getInstance();
|
- |
|
155 |
|
- |
|
156 |
// depot
|
- |
|
157 |
final int depot = props.getIntProperty("DepotStockDefault");
|
- |
|
158 |
this.boxDepot.setValue(depot);
|
- |
|
159 |
|
135 |
// service
|
160 |
// service
|
136 |
final String service = props.getStringProperty("ArticleService");
|
161 |
final String service = props.getStringProperty("ArticleService");
|
137 |
final Boolean bService = Boolean.valueOf(service);
|
162 |
final Boolean bService = Boolean.valueOf(service);
|
138 |
this.checkService.setSelected(bService == null || bService.booleanValue());
|
163 |
this.checkService.setSelected(bService == null || bService.booleanValue());
|
139 |
|
164 |
|
Line 165... |
Line 190... |
165 |
this.checkShowPoids.setSelected(props.getBooleanValue("ArticleShowPoids", false));
|
190 |
this.checkShowPoids.setSelected(props.getBooleanValue("ArticleShowPoids", false));
|
166 |
|
191 |
|
167 |
// Show Style
|
192 |
// Show Style
|
168 |
this.checkShowStyle.setSelected(props.getBooleanValue("ArticleShowStyle", false));
|
193 |
this.checkShowStyle.setSelected(props.getBooleanValue("ArticleShowStyle", false));
|
169 |
|
194 |
|
170 |
|
- |
|
171 |
// Devise
|
195 |
// Devise
|
172 |
this.checkMarge.setSelected(props.getBooleanValue(TotalPanel.MARGE_MARQUE, false));
|
196 |
this.checkMarge.setSelected(props.getBooleanValue(TotalPanel.MARGE_MARQUE, false));
|
173 |
|
197 |
|
174 |
// Mode vente
|
198 |
// Mode vente
|
175 |
final String modeVente = props.getStringProperty("ArticleModeVenteAvance");
|
199 |
final String modeVente = props.getStringProperty("ArticleModeVenteAvance");
|