18 |
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 |
package org.openconcerto.erp.core.sales.credit.element;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
|
|
17 |
import org.openconcerto.erp.core.common.ui.DeviseField;
|
|
|
18 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
19 |
import org.openconcerto.sql.element.UISQLComponent;
|
|
|
20 |
import org.openconcerto.sql.sqlobject.ElementComboBox;
|
|
|
21 |
|
|
|
22 |
import java.util.ArrayList;
|
|
|
23 |
import java.util.List;
|
|
|
24 |
|
19 |
ilm |
25 |
import javax.swing.JTextField;
|
|
|
26 |
|
18 |
ilm |
27 |
public class AvoirClientElementSQLElement extends ComptaSQLConfElement {
|
|
|
28 |
|
|
|
29 |
private static final String RIGHT = "right";
|
|
|
30 |
private static final String LEFT = "left";
|
|
|
31 |
|
|
|
32 |
public AvoirClientElementSQLElement() {
|
|
|
33 |
super("AVOIR_CLIENT_ELEMENT", "un element d'avoir", "éléments d'avoir");
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
protected List<String> getListFields() {
|
|
|
37 |
final List<String> list = new ArrayList<String>(7);
|
142 |
ilm |
38 |
list.add("ID_AVOIR_CLIENT");
|
18 |
ilm |
39 |
list.add("ID_STYLE");
|
142 |
ilm |
40 |
list.add("NIVEAU");
|
18 |
ilm |
41 |
list.add("CODE");
|
|
|
42 |
list.add("NOM");
|
|
|
43 |
list.add("PA_HT");
|
|
|
44 |
list.add("PV_HT");
|
142 |
ilm |
45 |
list.add("T_PA_HT");
|
|
|
46 |
list.add("T_PV_HT");
|
|
|
47 |
list.add("T_PV_TTC");
|
18 |
ilm |
48 |
list.add("ID_TAXE");
|
|
|
49 |
list.add("POIDS");
|
|
|
50 |
return list;
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
protected List<String> getComboFields() {
|
|
|
54 |
final List<String> list = new ArrayList<String>(4);
|
|
|
55 |
list.add("CODE");
|
|
|
56 |
list.add("NOM");
|
|
|
57 |
list.add("PA_HT");
|
|
|
58 |
list.add("PV_HT");
|
|
|
59 |
return list;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public SQLComponent createComponent() {
|
|
|
63 |
return new UISQLComponent(this) {
|
|
|
64 |
public void addViews() {
|
|
|
65 |
this.addRequiredSQLObject(new JTextField(), "NOM", LEFT);
|
|
|
66 |
this.addRequiredSQLObject(new JTextField(), "CODE", RIGHT);
|
|
|
67 |
|
|
|
68 |
this.addSQLObject(new ElementComboBox(), "ID_STYLE", LEFT);
|
|
|
69 |
|
|
|
70 |
this.addRequiredSQLObject(new DeviseField(), "PA_HT", LEFT);
|
|
|
71 |
this.addSQLObject(new DeviseField(), "PV_HT", RIGHT);
|
|
|
72 |
|
|
|
73 |
this.addSQLObject(new JTextField(), "POIDS", LEFT);
|
|
|
74 |
this.addSQLObject(new ElementComboBox(), "ID_TAXE", RIGHT);
|
|
|
75 |
}
|
|
|
76 |
};
|
|
|
77 |
}
|
57 |
ilm |
78 |
|
|
|
79 |
@Override
|
|
|
80 |
protected String createCode() {
|
156 |
ilm |
81 |
return this.createCodeOfPackage() + ".item";
|
57 |
ilm |
82 |
}
|
18 |
ilm |
83 |
}
|