Line 1... |
Line 1... |
1 |
/*
|
1 |
/*
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
3 |
*
|
3 |
*
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
4 |
* Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
|
5 |
*
|
5 |
*
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
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
|
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
|
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.
|
9 |
* language governing permissions and limitations under the License.
|
Line 64... |
Line 64... |
64 |
|
64 |
|
65 |
final SQLElement e = getSQLElement();
|
65 |
final SQLElement e = getSQLElement();
|
66 |
|
66 |
|
67 |
final List<SQLTableElement> list = new Vector<SQLTableElement>();
|
67 |
final List<SQLTableElement> list = new Vector<SQLTableElement>();
|
68 |
|
68 |
|
69 |
final SQLTableElement tableElementNom = new SQLTableElement(e.getTable().getField("NOM"));
|
69 |
final SQLTableElement tableElementNom = new SQLTableElement(e.getTable().getField("NOM")) {
|
- |
|
70 |
@Override
|
- |
|
71 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
- |
|
72 |
if (e.getTable().contains("ID_CATEGORIE_HEURE")) {
|
- |
|
73 |
return false;
|
- |
|
74 |
} else {
|
- |
|
75 |
return super.isCellEditable(vals, rowIndex, columnIndex);
|
- |
|
76 |
}
|
- |
|
77 |
}
|
- |
|
78 |
};
|
70 |
list.add(tableElementNom);
|
79 |
list.add(tableElementNom);
|
71 |
if (e.getTable().contains("ID_TYPE_CMD")) {
|
80 |
if (e.getTable().contains("ID_TYPE_CMD")) {
|
72 |
final SQLTableElement cat = new SQLTableElement(e.getTable().getField("ID_TYPE_CMD"));
|
81 |
final SQLTableElement cat = new SQLTableElement(e.getTable().getField("ID_TYPE_CMD"));
|
73 |
list.add(cat);
|
82 |
list.add(cat);
|
74 |
}
|
83 |
}
|
Line 80... |
Line 89... |
80 |
final SQLTableElement fam = new SQLTableElement(e.getTable().getField("ID_FAMILLE_ARTICLE"));
|
89 |
final SQLTableElement fam = new SQLTableElement(e.getTable().getField("ID_FAMILLE_ARTICLE"));
|
81 |
list.add(fam);
|
90 |
list.add(fam);
|
82 |
|
91 |
|
83 |
final SQLField fieldHA = e.getTable().getField("PA_HT");
|
92 |
final SQLField fieldHA = e.getTable().getField("PA_HT");
|
84 |
final DeviseNumericCellEditor editorPAHT = new DeviseNumericCellEditor(fieldHA);
|
93 |
final DeviseNumericCellEditor editorPAHT = new DeviseNumericCellEditor(fieldHA);
|
85 |
final SQLTableElement pa = new SQLTableElement(fieldHA, BigDecimal.class, editorPAHT);
|
94 |
final SQLTableElement pa = new SQLTableElement(fieldHA, BigDecimal.class, editorPAHT) {
|
- |
|
95 |
@Override
|
- |
|
96 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
- |
|
97 |
if (e.getTable().contains("ID_CATEGORIE_HEURE")) {
|
- |
|
98 |
return false;
|
- |
|
99 |
} else {
|
- |
|
100 |
return super.isCellEditable(vals, rowIndex, columnIndex);
|
- |
|
101 |
}
|
- |
|
102 |
}
|
- |
|
103 |
};
|
86 |
DeviseTableCellRenderer renderer = new DeviseTableCellRenderer();
|
104 |
DeviseTableCellRenderer renderer = new DeviseTableCellRenderer();
|
87 |
renderer.setHideZeroValue(true);
|
105 |
renderer.setHideZeroValue(true);
|
88 |
pa.setRenderer(renderer);
|
106 |
pa.setRenderer(renderer);
|
89 |
if (e.getTable().contains("ID_CATEGORIE_HEURE")) {
|
- |
|
90 |
pa.setEditable(false);
|
- |
|
91 |
}
|
- |
|
92 |
list.add(pa);
|
107 |
list.add(pa);
|
93 |
|
108 |
|
94 |
final SQLField fieldPV = e.getTable().getField("PV_HT");
|
109 |
final SQLField fieldPV = e.getTable().getField("PV_HT");
|
95 |
final DeviseNumericCellEditor editorPVHT = new DeviseNumericCellEditor(fieldPV);
|
110 |
final DeviseNumericCellEditor editorPVHT = new DeviseNumericCellEditor(fieldPV);
|
96 |
final SQLTableElement pv = new SQLTableElement(fieldPV, BigDecimal.class, editorPVHT);
|
111 |
final SQLTableElement pv = new SQLTableElement(fieldPV, BigDecimal.class, editorPVHT);
|
Line 100... |
Line 115... |
100 |
SQLTableElement qteU = new SQLTableElement(e.getTable().getField("QTE"), BigDecimal.class) {
|
115 |
SQLTableElement qteU = new SQLTableElement(e.getTable().getField("QTE"), BigDecimal.class) {
|
101 |
|
116 |
|
102 |
protected Object getDefaultNullValue() {
|
117 |
protected Object getDefaultNullValue() {
|
103 |
return BigDecimal.ZERO;
|
118 |
return BigDecimal.ZERO;
|
104 |
}
|
119 |
}
|
- |
|
120 |
|
- |
|
121 |
@Override
|
- |
|
122 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
- |
|
123 |
if (e.getTable().contains("ID_CATEGORIE_HEURE")) {
|
- |
|
124 |
return vals.getObject("ID_CATEGORIE_HEURE") == null || vals.isForeignEmpty("ID_CATEGORIE_HEURE");
|
- |
|
125 |
} else {
|
- |
|
126 |
return super.isCellEditable(vals, rowIndex, columnIndex);
|
- |
|
127 |
}
|
- |
|
128 |
}
|
105 |
};
|
129 |
};
|
106 |
qteU.setRenderer(renderer);
|
130 |
qteU.setRenderer(renderer);
|
107 |
list.add(qteU);
|
131 |
list.add(qteU);
|
108 |
|
132 |
|
109 |
if (e.getTable().contains("ANT")) {
|
133 |
if (e.getTable().contains("ANT")) {
|