144 |
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.order.element;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
|
|
17 |
import org.openconcerto.erp.core.common.ui.DeviseTableCellRenderer;
|
|
|
18 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
19 |
import org.openconcerto.sql.element.UISQLComponent;
|
|
|
20 |
import org.openconcerto.sql.view.list.SQLTableModelSource;
|
|
|
21 |
import org.openconcerto.utils.ListMap;
|
|
|
22 |
|
|
|
23 |
import java.util.ArrayList;
|
|
|
24 |
import java.util.List;
|
|
|
25 |
|
|
|
26 |
public class ChiffrageCommandeClientSQLElement extends ComptaSQLConfElement {
|
|
|
27 |
|
|
|
28 |
public ChiffrageCommandeClientSQLElement() {
|
|
|
29 |
super("CHIFFRAGE_COMMANDE_CLIENT", "un chiffrage de commande client", "chffrages commandes clients");
|
|
|
30 |
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
/*
|
|
|
34 |
* (non-Javadoc)
|
|
|
35 |
*
|
|
|
36 |
* @see org.openconcerto.devis.BaseSQLElement#getComboFields()
|
|
|
37 |
*/
|
|
|
38 |
protected List<String> getComboFields() {
|
|
|
39 |
final List<String> l = new ArrayList<String>();
|
|
|
40 |
l.add("ID_COMMANDE_CLIENT");
|
|
|
41 |
l.add("NOM");
|
|
|
42 |
return l;
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
@Override
|
|
|
46 |
protected String getParentFFName() {
|
|
|
47 |
return "ID_COMMANDE_CLIENT";
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
@Override
|
|
|
51 |
protected void _initTableSource(SQLTableModelSource res) {
|
|
|
52 |
super._initTableSource(res);
|
|
|
53 |
res.getColumn(getTable().getField("PA_HT")).setRenderer(new DeviseTableCellRenderer());
|
|
|
54 |
res.getColumn(getTable().getField("MARGE")).setRenderer(new DeviseTableCellRenderer());
|
|
|
55 |
res.getColumn(getTable().getField("T_PA_HT")).setRenderer(new DeviseTableCellRenderer());
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
/*
|
|
|
59 |
* (non-Javadoc)
|
|
|
60 |
*
|
|
|
61 |
* @see org.openconcerto.devis.BaseSQLElement#getListFields()
|
|
|
62 |
*/
|
|
|
63 |
protected List<String> getListFields() {
|
|
|
64 |
final List<String> l = new ArrayList<String>();
|
|
|
65 |
l.add("ID_COMMANDE_CLIENT");
|
|
|
66 |
l.add("NOM");
|
|
|
67 |
l.add("ID_FAMILLE_ARTICLE");
|
|
|
68 |
l.add("PA_HT");
|
|
|
69 |
l.add("QTE");
|
|
|
70 |
l.add("ID_UNITE_VENTE");
|
|
|
71 |
l.add("T_PA_HT");
|
|
|
72 |
l.add("MARGE");
|
|
|
73 |
return l;
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
@Override
|
|
|
77 |
public ListMap<String, String> getShowAs() {
|
|
|
78 |
// TODO Auto-generated method stub
|
|
|
79 |
ListMap<String, String> l = new ListMap<String, String>();
|
|
|
80 |
l.putCollection(null, "ID_COMMANDE_CLIENT", "NOM", "ID_FAMILLE_ARTICLE", "PA_HT", "QTE", "T_PA_HT");
|
|
|
81 |
return l;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
/*
|
|
|
85 |
* (non-Javadoc)
|
|
|
86 |
*
|
|
|
87 |
* @see org.openconcerto.devis.SQLElement#getComponent()
|
|
|
88 |
*/
|
|
|
89 |
public SQLComponent createComponent() {
|
|
|
90 |
return new UISQLComponent(this) {
|
|
|
91 |
public void addViews() {
|
|
|
92 |
this.addView("NOM");
|
|
|
93 |
this.addView("ID_FAMILLE_ARTICLE");
|
|
|
94 |
this.addView("PA_HT");
|
|
|
95 |
this.addView("PV_HT");
|
|
|
96 |
this.addView("QTE");
|
|
|
97 |
this.addView("ID_UNITE_VENTE");
|
|
|
98 |
this.addView("T_PA_HT");
|
|
|
99 |
this.addView("T_PV_HT");
|
|
|
100 |
}
|
|
|
101 |
};
|
|
|
102 |
}
|
|
|
103 |
|
|
|
104 |
@Override
|
|
|
105 |
protected String createCode() {
|
|
|
106 |
return createCodeFromPackage() + ".chiffrage";
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
}
|