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 25... |
Line 25... |
25 |
import org.openconcerto.erp.core.sales.product.model.ProductHelper.TypePrice;
|
25 |
import org.openconcerto.erp.core.sales.product.model.ProductHelper.TypePrice;
|
26 |
import org.openconcerto.erp.core.sales.product.ui.ArticleRowValuesRenderer;
|
26 |
import org.openconcerto.erp.core.sales.product.ui.ArticleRowValuesRenderer;
|
27 |
import org.openconcerto.erp.core.sales.product.ui.CurrencyWithSymbolRenderer;
|
27 |
import org.openconcerto.erp.core.sales.product.ui.CurrencyWithSymbolRenderer;
|
28 |
import org.openconcerto.erp.core.sales.product.ui.QteMultipleRowValuesRenderer;
|
28 |
import org.openconcerto.erp.core.sales.product.ui.QteMultipleRowValuesRenderer;
|
29 |
import org.openconcerto.erp.core.sales.product.ui.QteUnitRowValuesRenderer;
|
29 |
import org.openconcerto.erp.core.sales.product.ui.QteUnitRowValuesRenderer;
|
- |
|
30 |
import org.openconcerto.erp.core.sales.product.ui.QteUnitairePieceRowValuesRenderer;
|
30 |
import org.openconcerto.erp.core.supplychain.stock.element.DepotStockSQLElement;
|
31 |
import org.openconcerto.erp.core.supplychain.stock.element.DepotStockSQLElement;
|
31 |
import org.openconcerto.erp.core.supplychain.stock.element.StockSQLElement;
|
32 |
import org.openconcerto.erp.core.supplychain.stock.element.StockSQLElement;
|
32 |
import org.openconcerto.erp.importer.ArrayTableModel;
|
33 |
import org.openconcerto.erp.importer.ArrayTableModel;
|
33 |
import org.openconcerto.erp.importer.DataImporter;
|
34 |
import org.openconcerto.erp.importer.DataImporter;
|
34 |
import org.openconcerto.erp.preferences.DefaultNXProps;
|
35 |
import org.openconcerto.erp.preferences.DefaultNXProps;
|
Line 41... |
Line 42... |
41 |
import org.openconcerto.sql.model.SQLField;
|
42 |
import org.openconcerto.sql.model.SQLField;
|
42 |
import org.openconcerto.sql.model.SQLRow;
|
43 |
import org.openconcerto.sql.model.SQLRow;
|
43 |
import org.openconcerto.sql.model.SQLRowAccessor;
|
44 |
import org.openconcerto.sql.model.SQLRowAccessor;
|
44 |
import org.openconcerto.sql.model.SQLRowListRSH;
|
45 |
import org.openconcerto.sql.model.SQLRowListRSH;
|
45 |
import org.openconcerto.sql.model.SQLRowValues;
|
46 |
import org.openconcerto.sql.model.SQLRowValues;
|
- |
|
47 |
import org.openconcerto.sql.model.SQLRowValuesListFetcher;
|
46 |
import org.openconcerto.sql.model.SQLSelect;
|
48 |
import org.openconcerto.sql.model.SQLSelect;
|
47 |
import org.openconcerto.sql.model.SQLTable;
|
49 |
import org.openconcerto.sql.model.SQLTable;
|
48 |
import org.openconcerto.sql.model.UndefinedRowValuesCache;
|
50 |
import org.openconcerto.sql.model.UndefinedRowValuesCache;
|
49 |
import org.openconcerto.sql.model.Where;
|
51 |
import org.openconcerto.sql.model.Where;
|
50 |
import org.openconcerto.sql.model.graph.Path;
|
52 |
import org.openconcerto.sql.model.graph.Path;
|
Line 63... |
Line 65... |
63 |
import org.openconcerto.sql.view.list.SQLTextComboTableCellEditor;
|
65 |
import org.openconcerto.sql.view.list.SQLTextComboTableCellEditor;
|
64 |
import org.openconcerto.sql.view.list.ValidStateChecker;
|
66 |
import org.openconcerto.sql.view.list.ValidStateChecker;
|
65 |
import org.openconcerto.ui.preferences.DefaultProps;
|
67 |
import org.openconcerto.ui.preferences.DefaultProps;
|
66 |
import org.openconcerto.utils.CompareUtils;
|
68 |
import org.openconcerto.utils.CompareUtils;
|
67 |
import org.openconcerto.utils.DecimalUtils;
|
69 |
import org.openconcerto.utils.DecimalUtils;
|
- |
|
70 |
import org.openconcerto.utils.ExceptionHandler;
|
68 |
import org.openconcerto.utils.StringUtils;
|
71 |
import org.openconcerto.utils.StringUtils;
|
69 |
import org.openconcerto.utils.Tuple3;
|
72 |
import org.openconcerto.utils.Tuple3;
|
70 |
import org.openconcerto.utils.cc.ITransformer;
|
73 |
import org.openconcerto.utils.cc.ITransformer;
|
71 |
import org.openconcerto.utils.i18n.TranslationManager;
|
74 |
import org.openconcerto.utils.i18n.TranslationManager;
|
72 |
|
75 |
|
Line 86... |
Line 89... |
86 |
import java.awt.event.MouseEvent;
|
89 |
import java.awt.event.MouseEvent;
|
87 |
import java.io.File;
|
90 |
import java.io.File;
|
88 |
import java.io.IOException;
|
91 |
import java.io.IOException;
|
89 |
import java.math.BigDecimal;
|
92 |
import java.math.BigDecimal;
|
90 |
import java.math.RoundingMode;
|
93 |
import java.math.RoundingMode;
|
- |
|
94 |
import java.sql.SQLException;
|
91 |
import java.util.ArrayList;
|
95 |
import java.util.ArrayList;
|
- |
|
96 |
import java.util.Calendar;
|
92 |
import java.util.Collection;
|
97 |
import java.util.Collection;
|
93 |
import java.util.Date;
|
98 |
import java.util.Date;
|
94 |
import java.util.HashMap;
|
99 |
import java.util.HashMap;
|
95 |
import java.util.List;
|
100 |
import java.util.List;
|
96 |
import java.util.Map;
|
101 |
import java.util.Map;
|
Line 261... |
Line 266... |
261 |
return visibilityMap;
|
266 |
return visibilityMap;
|
262 |
}
|
267 |
}
|
263 |
|
268 |
|
264 |
private SQLTable tableArticleTarif = Configuration.getInstance().getBase().getTable("ARTICLE_TARIF");
|
269 |
private SQLTable tableArticleTarif = Configuration.getInstance().getBase().getTable("ARTICLE_TARIF");
|
265 |
private SQLTable tableArticle = Configuration.getInstance().getBase().getTable("ARTICLE");
|
270 |
private SQLTable tableArticle = Configuration.getInstance().getBase().getTable("ARTICLE");
|
- |
|
271 |
protected AutoCompletionManager codeCompletionManager;
|
266 |
|
272 |
|
267 |
protected void init() {
|
273 |
protected void init() {
|
268 |
|
274 |
|
269 |
SQLPreferences prefs = SQLPreferences.getMemCached(getSQLElement().getTable().getDBRoot());
|
275 |
SQLPreferences prefs = SQLPreferences.getMemCached(getSQLElement().getTable().getDBRoot());
|
270 |
final boolean selectArticle = prefs.getBoolean(GestionArticleGlobalPreferencePanel.USE_CREATED_ARTICLE, false);
|
276 |
final boolean selectArticle = prefs.getBoolean(GestionArticleGlobalPreferencePanel.USE_CREATED_ARTICLE, false);
|
271 |
final boolean activeCalculM2 = prefs.getBoolean(GestionArticleGlobalPreferencePanel.ACTIVE_CALCUL_M2, false);
|
277 |
final boolean activeCalculM2 = prefs.getBoolean(GestionArticleGlobalPreferencePanel.ACTIVE_CALCUL_M2, false);
|
272 |
final boolean filterFamilleArticle = prefs.getBoolean(GestionArticleGlobalPreferencePanel.FILTER_BY_FAMILY, false);
|
278 |
final boolean filterFamilleArticle = prefs.getBoolean(GestionArticleGlobalPreferencePanel.FILTER_BY_FAMILY, false);
|
273 |
final boolean createAuto = prefs.getBoolean(GestionArticleGlobalPreferencePanel.CREATE_ARTICLE_AUTO, true);
|
279 |
final boolean createAuto = prefs.getBoolean(GestionArticleGlobalPreferencePanel.CREATE_ARTICLE_AUTO, true);
|
274 |
final boolean showEco = prefs.getBoolean(AbstractVenteArticleItemTable.SHOW_ECO_CONTRIBUTION_COLUMNS, false);
|
280 |
final boolean showEco = prefs.getBoolean(AbstractVenteArticleItemTable.SHOW_ECO_CONTRIBUTION_COLUMNS, false);
|
275 |
final boolean showDevise = prefs.getBoolean(AbstractVenteArticleItemTable.ARTICLE_SHOW_DEVISE, false);
|
281 |
final boolean showDevise = prefs.getBoolean(AbstractVenteArticleItemTable.ARTICLE_SHOW_DEVISE, false);
|
- |
|
282 |
final boolean withDeclinaison = prefs.getBoolean(GestionArticleGlobalPreferencePanel.ACTIVER_DECLINAISON, false);
|
276 |
|
283 |
|
277 |
final UserRights rights = UserRightsManager.getCurrentUserRights();
|
284 |
final UserRights rights = UserRightsManager.getCurrentUserRights();
|
278 |
final boolean editVTPrice = rights.haveRight(EDIT_PRIX_VENTE_CODE);
|
285 |
final boolean editVTPrice = rights.haveRight(EDIT_PRIX_VENTE_CODE);
|
279 |
final boolean showHAPrice = rights.haveRight(SHOW_PRIX_ACHAT_CODE);
|
286 |
final boolean showHAPrice = rights.haveRight(SHOW_PRIX_ACHAT_CODE);
|
280 |
final boolean lockVTMinPrice = rights.haveRight(LOCK_PRIX_MIN_VENTE_CODE);
|
287 |
final boolean lockVTMinPrice = rights.haveRight(LOCK_PRIX_MIN_VENTE_CODE);
|
Line 307... |
Line 314... |
307 |
|
314 |
|
308 |
// Article
|
315 |
// Article
|
309 |
SQLTableElement tableElementArticle = new SQLTableElement(e.getTable().getField("ID_ARTICLE"), true, true, true);
|
316 |
SQLTableElement tableElementArticle = new SQLTableElement(e.getTable().getField("ID_ARTICLE"), true, true, true);
|
310 |
list.add(tableElementArticle);
|
317 |
list.add(tableElementArticle);
|
311 |
|
318 |
|
- |
|
319 |
Set<String> fieldsName = e.getTable().getFieldsName();
|
312 |
if (e.getTable().getFieldsName().contains("ID_ECO_CONTRIBUTION")) {
|
320 |
if (fieldsName.contains("ID_ECO_CONTRIBUTION")) {
|
313 |
this.tableElementEcoID = new SQLTableElement(e.getTable().getField("ID_ECO_CONTRIBUTION"));
|
321 |
this.tableElementEcoID = new SQLTableElement(e.getTable().getField("ID_ECO_CONTRIBUTION"));
|
314 |
list.add(this.tableElementEcoID);
|
322 |
list.add(this.tableElementEcoID);
|
315 |
}
|
323 |
}
|
316 |
|
324 |
|
317 |
// Code article
|
325 |
// Code article
|
318 |
final SQLTableElement tableElementCode = new SQLTableElement(e.getTable().getField("CODE"), String.class,
|
326 |
final SQLTableElement tableElementCode = new SQLTableElement(e.getTable().getField("CODE"), String.class,
|
319 |
new ITextArticleWithCompletionCellEditor(e.getTable().getTable("ARTICLE"), e.getTable().getTable("ARTICLE_FOURNISSEUR")));
|
327 |
new ITextArticleWithCompletionCellEditor(e.getTable().getTable("ARTICLE"), e.getTable().getTable("ARTICLE_FOURNISSEUR"), withDeclinaison));
|
320 |
list.add(tableElementCode);
|
328 |
list.add(tableElementCode);
|
321 |
|
329 |
|
322 |
// Désignation de l'article
|
330 |
// Désignation de l'article
|
323 |
final SQLTableElement tableElementNom = new SQLTableElement(e.getTable().getField("NOM"));
|
331 |
final SQLTableElement tableElementNom = new SQLTableElement(e.getTable().getField("NOM"));
|
324 |
list.add(tableElementNom);
|
332 |
list.add(tableElementNom);
|
325 |
|
333 |
|
- |
|
334 |
List<String> fieldDecl = new ArrayList<>();
|
- |
|
335 |
|
- |
|
336 |
if (withDeclinaison) {
|
- |
|
337 |
|
- |
|
338 |
for (String string : fieldsName) {
|
- |
|
339 |
if (string.startsWith("ID_ARTICLE_DECLINAISON")) {
|
- |
|
340 |
final SQLTableElement tableElementDeclinaison = new SQLTableElement(e.getTable().getField(string));
|
- |
|
341 |
tableElementDeclinaison.setEditable(false);
|
- |
|
342 |
fieldDecl.add(string);
|
- |
|
343 |
list.add(tableElementDeclinaison);
|
- |
|
344 |
}
|
- |
|
345 |
}
|
- |
|
346 |
}
|
- |
|
347 |
|
326 |
if (e.getTable().getFieldsName().contains("COLORIS")) {
|
348 |
if (fieldsName.contains("COLORIS")) {
|
327 |
final SQLTableElement tableElementColoris = new SQLTableElement(e.getTable().getField("COLORIS"));
|
349 |
final SQLTableElement tableElementColoris = new SQLTableElement(e.getTable().getField("COLORIS"));
|
328 |
list.add(tableElementColoris);
|
350 |
list.add(tableElementColoris);
|
329 |
}
|
351 |
}
|
330 |
|
352 |
|
331 |
if (e.getTable().getFieldsName().contains("DESCRIPTIF")) {
|
353 |
if (fieldsName.contains("DESCRIPTIF")) {
|
332 |
final SQLTableElement tableElementDesc = new SQLTableElement(e.getTable().getField("DESCRIPTIF"));
|
354 |
final SQLTableElement tableElementDesc = new SQLTableElement(e.getTable().getField("DESCRIPTIF"));
|
333 |
list.add(tableElementDesc);
|
355 |
list.add(tableElementDesc);
|
334 |
}
|
356 |
}
|
335 |
|
357 |
|
336 |
if (e.getTable().getFieldsName().contains("DELAI")) {
|
358 |
if (fieldsName.contains("DELAI")) {
|
337 |
final SQLTableElement tableElementDelai = new SQLTableElement(e.getTable().getField("DELAI"));
|
359 |
final SQLTableElement tableElementDelai = new SQLTableElement(e.getTable().getField("DELAI"));
|
338 |
list.add(tableElementDelai);
|
360 |
list.add(tableElementDelai);
|
339 |
}
|
361 |
}
|
340 |
|
362 |
|
341 |
if (showDevise) {
|
363 |
if (showDevise) {
|
Line 344... |
Line 366... |
344 |
list.add(tableElementCodeDouane);
|
366 |
list.add(tableElementCodeDouane);
|
345 |
final SQLTableElement tableElementPays = new SQLTableElement(e.getTable().getField("ID_PAYS"));
|
367 |
final SQLTableElement tableElementPays = new SQLTableElement(e.getTable().getField("ID_PAYS"));
|
346 |
list.add(tableElementPays);
|
368 |
list.add(tableElementPays);
|
347 |
}
|
369 |
}
|
348 |
|
370 |
|
- |
|
371 |
SQLTableElement qteU = new SQLTableElement(e.getTable().getField("QTE_UNITAIRE"), BigDecimal.class) {
|
- |
|
372 |
@Override
|
- |
|
373 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
- |
|
374 |
|
- |
|
375 |
SQLRowAccessor row = vals.getForeign("ID_UNITE_VENTE");
|
- |
|
376 |
if (row != null && !row.isUndefined() && row.getBoolean("A_LA_PIECE")) {
|
- |
|
377 |
return false;
|
- |
|
378 |
} else if (activeCalculM2 && row != null && !row.isUndefined() && row.getID() == UniteVenteArticleSQLElement.M2) {
|
- |
|
379 |
return false;
|
- |
|
380 |
} else {
|
- |
|
381 |
return super.isCellEditable(vals, rowIndex, columnIndex);
|
- |
|
382 |
}
|
- |
|
383 |
}
|
- |
|
384 |
|
- |
|
385 |
@Override
|
- |
|
386 |
public TableCellRenderer getTableCellRenderer() {
|
- |
|
387 |
return new QteUnitairePieceRowValuesRenderer();
|
- |
|
388 |
}
|
- |
|
389 |
|
- |
|
390 |
protected Object getDefaultNullValue() {
|
- |
|
391 |
return BigDecimal.ZERO;
|
- |
|
392 |
}
|
- |
|
393 |
};
|
- |
|
394 |
list.add(qteU);
|
- |
|
395 |
|
- |
|
396 |
SQLTableElement uniteVente = new SQLTableElement(e.getTable().getField("ID_UNITE_VENTE"));
|
- |
|
397 |
list.add(uniteVente);
|
- |
|
398 |
|
- |
|
399 |
// Quantité
|
- |
|
400 |
this.qte = new SQLTableElement(e.getTable().getField("QTE"), Integer.class, new QteCellEditor()) {
|
- |
|
401 |
protected Object getDefaultNullValue() {
|
- |
|
402 |
return Integer.valueOf(0);
|
- |
|
403 |
}
|
- |
|
404 |
|
- |
|
405 |
public TableCellRenderer getTableCellRenderer() {
|
- |
|
406 |
if (getSQLElement().getTable().getFieldsName().contains("QTE_ACHAT")) {
|
- |
|
407 |
return new QteMultipleRowValuesRenderer();
|
- |
|
408 |
} else {
|
- |
|
409 |
return super.getTableCellRenderer();
|
- |
|
410 |
}
|
- |
|
411 |
}
|
- |
|
412 |
};
|
- |
|
413 |
this.qte.setPreferredSize(20);
|
- |
|
414 |
list.add(this.qte);
|
- |
|
415 |
|
349 |
// Valeur des métriques
|
416 |
// Valeur des métriques
|
350 |
final SQLTableElement tableElement_ValeurMetrique2 = new SQLTableElement(e.getTable().getField("VALEUR_METRIQUE_2"), Float.class) {
|
417 |
final SQLTableElement tableElement_ValeurMetrique2 = new SQLTableElement(e.getTable().getField("VALEUR_METRIQUE_2"), Float.class) {
|
351 |
@Override
|
418 |
@Override
|
352 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
419 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
353 |
Number modeNumber = (Number) vals.getObject("ID_MODE_VENTE_ARTICLE");
|
420 |
Number modeNumber = (Number) vals.getObject("ID_MODE_VENTE_ARTICLE");
|
Line 407... |
Line 474... |
407 |
};
|
474 |
};
|
408 |
list.add(tableElement_ValeurMetrique1);
|
475 |
list.add(tableElement_ValeurMetrique1);
|
409 |
|
476 |
|
410 |
// Prébilan
|
477 |
// Prébilan
|
411 |
|
478 |
|
412 |
if (e.getTable().getFieldsName().contains("PREBILAN")) {
|
479 |
if (fieldsName.contains("PREBILAN")) {
|
413 |
prebilan = new SQLTableElement(e.getTable().getField("PREBILAN"), BigDecimal.class) {
|
480 |
prebilan = new SQLTableElement(e.getTable().getField("PREBILAN"), BigDecimal.class) {
|
414 |
protected Object getDefaultNullValue() {
|
481 |
protected Object getDefaultNullValue() {
|
415 |
return BigDecimal.ZERO;
|
482 |
return BigDecimal.ZERO;
|
416 |
}
|
483 |
}
|
417 |
|
484 |
|
Line 475... |
Line 542... |
475 |
}
|
542 |
}
|
476 |
};
|
543 |
};
|
477 |
tableElement_PrixMetrique1_VenteHT.setRenderer(new CurrencyWithSymbolRenderer());
|
544 |
tableElement_PrixMetrique1_VenteHT.setRenderer(new CurrencyWithSymbolRenderer());
|
478 |
list.add(tableElement_PrixMetrique1_VenteHT);
|
545 |
list.add(tableElement_PrixMetrique1_VenteHT);
|
479 |
|
546 |
|
480 |
if (e.getTable().getFieldsName().contains("ECO_CONTRIBUTION")) {
|
547 |
if (fieldsName.contains("ECO_CONTRIBUTION")) {
|
481 |
this.tableElementEco = new SQLTableElement(e.getTable().getField("ECO_CONTRIBUTION"));
|
548 |
this.tableElementEco = new SQLTableElement(e.getTable().getField("ECO_CONTRIBUTION"));
|
482 |
list.add(this.tableElementEco);
|
549 |
list.add(this.tableElementEco);
|
483 |
}
|
550 |
}
|
484 |
|
551 |
|
485 |
SQLTableElement eltLongueur = new SQLTableElement(e.getTable().getField("LONGUEUR")) {
|
552 |
SQLTableElement eltLongueur = new SQLTableElement(e.getTable().getField("LONGUEUR")) {
|
Line 503... |
Line 570... |
503 |
list.add(eltLargeur);
|
570 |
list.add(eltLargeur);
|
504 |
|
571 |
|
505 |
SQLTableElement eltHauteur = new SQLTableElement(e.getTable().getField("HAUTEUR"));
|
572 |
SQLTableElement eltHauteur = new SQLTableElement(e.getTable().getField("HAUTEUR"));
|
506 |
list.add(eltHauteur);
|
573 |
list.add(eltHauteur);
|
507 |
|
574 |
|
508 |
SQLTableElement qteU = new SQLTableElement(e.getTable().getField("QTE_UNITAIRE"), BigDecimal.class) {
|
- |
|
509 |
@Override
|
- |
|
510 |
public boolean isCellEditable(SQLRowValues vals, int rowIndex, int columnIndex) {
|
- |
|
511 |
|
- |
|
512 |
SQLRowAccessor row = vals.getForeign("ID_UNITE_VENTE");
|
- |
|
513 |
if (row != null && !row.isUndefined() && row.getBoolean("A_LA_PIECE")) {
|
- |
|
514 |
return false;
|
- |
|
515 |
} else if (activeCalculM2 && row != null && !row.isUndefined() && row.getID() == UniteVenteArticleSQLElement.M2) {
|
- |
|
516 |
return false;
|
- |
|
517 |
} else {
|
- |
|
518 |
return super.isCellEditable(vals, rowIndex, columnIndex);
|
- |
|
519 |
}
|
- |
|
520 |
}
|
- |
|
521 |
|
- |
|
522 |
@Override
|
- |
|
523 |
public TableCellRenderer getTableCellRenderer() {
|
- |
|
524 |
return new QteUnitRowValuesRenderer();
|
- |
|
525 |
}
|
- |
|
526 |
|
- |
|
527 |
protected Object getDefaultNullValue() {
|
- |
|
528 |
return BigDecimal.ZERO;
|
- |
|
529 |
}
|
- |
|
530 |
};
|
- |
|
531 |
list.add(qteU);
|
- |
|
532 |
|
- |
|
533 |
SQLTableElement uniteVente = new SQLTableElement(e.getTable().getField("ID_UNITE_VENTE"));
|
- |
|
534 |
list.add(uniteVente);
|
- |
|
535 |
|
- |
|
536 |
// Quantité
|
- |
|
537 |
this.qte = new SQLTableElement(e.getTable().getField("QTE"), Integer.class, new QteCellEditor()) {
|
- |
|
538 |
protected Object getDefaultNullValue() {
|
- |
|
539 |
return Integer.valueOf(0);
|
- |
|
540 |
}
|
- |
|
541 |
|
- |
|
542 |
public TableCellRenderer getTableCellRenderer() {
|
- |
|
543 |
if (getSQLElement().getTable().getFieldsName().contains("QTE_ACHAT")) {
|
- |
|
544 |
return new QteMultipleRowValuesRenderer();
|
- |
|
545 |
} else {
|
- |
|
546 |
return super.getTableCellRenderer();
|
- |
|
547 |
}
|
- |
|
548 |
}
|
- |
|
549 |
};
|
- |
|
550 |
this.qte.setPreferredSize(20);
|
- |
|
551 |
list.add(this.qte);
|
- |
|
552 |
|
- |
|
553 |
if (e.getTable().contains("RETOUR_STOCK")) {
|
575 |
if (e.getTable().contains("RETOUR_STOCK")) {
|
554 |
list.add(new SQLTableElement(e.getTable().getField("RETOUR_STOCK")));
|
576 |
list.add(new SQLTableElement(e.getTable().getField("RETOUR_STOCK")));
|
555 |
}
|
577 |
}
|
556 |
|
578 |
|
557 |
// Mode de vente
|
579 |
// Mode de vente
|
Line 729... |
Line 751... |
729 |
totalRenderer.setHideZeroValue(true);
|
751 |
totalRenderer.setHideZeroValue(true);
|
730 |
this.totalHT.setRenderer(totalRenderer);
|
752 |
this.totalHT.setRenderer(totalRenderer);
|
731 |
this.totalHT.setEditable(false);
|
753 |
this.totalHT.setEditable(false);
|
732 |
this.totalHA = new SQLTableElement(e.getTable().getField("T_PA_HT"), BigDecimal.class);
|
754 |
this.totalHA = new SQLTableElement(e.getTable().getField("T_PA_HT"), BigDecimal.class);
|
733 |
|
755 |
|
734 |
if (e.getTable().getFieldsName().contains("MONTANT_FACTURABLE")) {
|
756 |
if (fieldsName.contains("MONTANT_FACTURABLE")) {
|
735 |
// SQLTableElement tableElementAcompte = new
|
757 |
// SQLTableElement tableElementAcompte = new
|
736 |
// SQLTableElement(e.getTable().getField("POURCENT_ACOMPTE"));
|
758 |
// SQLTableElement(e.getTable().getField("POURCENT_ACOMPTE"));
|
737 |
// list.add(tableElementAcompte);
|
759 |
// list.add(tableElementAcompte);
|
738 |
|
760 |
|
739 |
this.tableElementFacturable = new SQLTableElement(e.getTable().getField("POURCENT_FACTURABLE"), Acompte.class, new AcompteCellEditor("POURCENT_FACTURABLE", "MONTANT_FACTURABLE")) {
|
761 |
this.tableElementFacturable = new SQLTableElement(e.getTable().getField("POURCENT_FACTURABLE"), Acompte.class, new AcompteCellEditor("POURCENT_FACTURABLE", "MONTANT_FACTURABLE")) {
|
Line 768... |
Line 790... |
768 |
list.add(tableElementFacturable);
|
790 |
list.add(tableElementFacturable);
|
769 |
}
|
791 |
}
|
770 |
|
792 |
|
771 |
final SQLField fieldRemise = e.getTable().getField("POURCENT_REMISE");
|
793 |
final SQLField fieldRemise = e.getTable().getField("POURCENT_REMISE");
|
772 |
|
794 |
|
773 |
if (e.getTable().getFieldsName().contains("MONTANT_REMISE")) {
|
795 |
if (fieldsName.contains("MONTANT_REMISE")) {
|
774 |
tableElementRemise = new SQLTableElement(e.getTable().getField("POURCENT_REMISE"), Acompte.class, new AcompteCellEditor("POURCENT_REMISE", "MONTANT_REMISE")) {
|
796 |
tableElementRemise = new SQLTableElement(e.getTable().getField("POURCENT_REMISE"), Acompte.class, new AcompteCellEditor("POURCENT_REMISE", "MONTANT_REMISE")) {
|
775 |
@Override
|
797 |
@Override
|
776 |
public void setValueFrom(SQLRowValues row, Object value) {
|
798 |
public void setValueFrom(SQLRowValues row, Object value) {
|
777 |
|
799 |
|
778 |
if (value != null) {
|
800 |
if (value != null) {
|
Line 805... |
Line 827... |
805 |
}
|
827 |
}
|
806 |
};
|
828 |
};
|
807 |
}
|
829 |
}
|
808 |
list.add(tableElementRemise);
|
830 |
list.add(tableElementRemise);
|
809 |
SQLTableElement tableElementRG = null;
|
831 |
SQLTableElement tableElementRG = null;
|
810 |
if (e.getTable().getFieldsName().contains("POURCENT_RG")) {
|
832 |
if (fieldsName.contains("POURCENT_RG")) {
|
811 |
tableElementRG = new SQLTableElement(e.getTable().getField("POURCENT_RG"));
|
833 |
tableElementRG = new SQLTableElement(e.getTable().getField("POURCENT_RG"));
|
812 |
list.add(tableElementRG);
|
834 |
list.add(tableElementRG);
|
813 |
}
|
835 |
}
|
814 |
|
836 |
|
815 |
// Total HT
|
837 |
// Total HT
|
Line 831... |
Line 853... |
831 |
this.tableElementTotalDevise.setRenderer(currencyRenderer);
|
853 |
this.tableElementTotalDevise.setRenderer(currencyRenderer);
|
832 |
list.add(this.tableElementTotalDevise);
|
854 |
list.add(this.tableElementTotalDevise);
|
833 |
}
|
855 |
}
|
834 |
|
856 |
|
835 |
// Marge HT
|
857 |
// Marge HT
|
836 |
if (e.getTable().getFieldsName().contains("MARGE_HT")) {
|
858 |
if (fieldsName.contains("MARGE_HT")) {
|
837 |
|
859 |
|
838 |
final SQLTableElement marge = new SQLTableElement(e.getTable().getField("MARGE_HT"), BigDecimal.class) {
|
860 |
final SQLTableElement marge = new SQLTableElement(e.getTable().getField("MARGE_HT"), BigDecimal.class) {
|
839 |
protected Object getDefaultNullValue() {
|
861 |
protected Object getDefaultNullValue() {
|
840 |
return BigDecimal.ZERO;
|
862 |
return BigDecimal.ZERO;
|
841 |
}
|
863 |
}
|
Line 870... |
Line 892... |
870 |
|
892 |
|
871 |
});
|
893 |
});
|
872 |
|
894 |
|
873 |
}
|
895 |
}
|
874 |
|
896 |
|
875 |
if (e.getTable().getFieldsName().contains("MARGE_PREBILAN_HT")) {
|
897 |
if (fieldsName.contains("MARGE_PREBILAN_HT")) {
|
876 |
|
898 |
|
877 |
final SQLTableElement marge = new SQLTableElement(e.getTable().getField("MARGE_PREBILAN_HT"), BigDecimal.class) {
|
899 |
final SQLTableElement marge = new SQLTableElement(e.getTable().getField("MARGE_PREBILAN_HT"), BigDecimal.class) {
|
878 |
protected Object getDefaultNullValue() {
|
900 |
protected Object getDefaultNullValue() {
|
879 |
return BigDecimal.ZERO;
|
901 |
return BigDecimal.ZERO;
|
880 |
}
|
902 |
}
|
Line 902... |
Line 924... |
902 |
|
924 |
|
903 |
});
|
925 |
});
|
904 |
|
926 |
|
905 |
}
|
927 |
}
|
906 |
|
928 |
|
907 |
if (e.getTable().getFieldsName().contains("T_ECO_CONTRIBUTION")) {
|
929 |
if (fieldsName.contains("T_ECO_CONTRIBUTION")) {
|
908 |
this.tableElementEcoTotal = new SQLTableElement(e.getTable().getField("T_ECO_CONTRIBUTION"));
|
930 |
this.tableElementEcoTotal = new SQLTableElement(e.getTable().getField("T_ECO_CONTRIBUTION"));
|
909 |
list.add(this.tableElementEcoTotal);
|
931 |
list.add(this.tableElementEcoTotal);
|
910 |
}
|
932 |
}
|
911 |
|
933 |
|
912 |
// Total HT
|
934 |
// Total HT
|
Line 955... |
Line 977... |
955 |
|
977 |
|
956 |
this.table = new RowValuesTable(model, getConfigurationFile());
|
978 |
this.table = new RowValuesTable(model, getConfigurationFile());
|
957 |
ToolTipManager.sharedInstance().unregisterComponent(this.table);
|
979 |
ToolTipManager.sharedInstance().unregisterComponent(this.table);
|
958 |
ToolTipManager.sharedInstance().unregisterComponent(this.table.getTableHeader());
|
980 |
ToolTipManager.sharedInstance().unregisterComponent(this.table.getTableHeader());
|
959 |
if (getSQLElement().getTable().getName().equals("COMMANDE_CLIENT_ELEMENT")) {
|
981 |
if (getSQLElement().getTable().getName().equals("COMMANDE_CLIENT_ELEMENT")) {
|
- |
|
982 |
this.table.getClearCloneTableElement().add("ID_MISSION");
|
- |
|
983 |
this.table.getClearCloneTableElement().add("ID_DEVIS_ELEMENT");
|
960 |
this.table.getClearCloneTableElement().add("QTE_LIVREE");
|
984 |
this.table.getClearCloneTableElement().add("QTE_LIVREE");
|
961 |
this.table.getClearCloneTableElement().add("LIVRE");
|
985 |
this.table.getClearCloneTableElement().add("LIVRE");
|
962 |
this.table.getClearCloneTableElement().add("LIVRE_FORCED");
|
986 |
this.table.getClearCloneTableElement().add("LIVRE_FORCED");
|
963 |
}
|
987 |
}
|
964 |
|
988 |
|
Line 1005... |
Line 1029... |
1005 |
}
|
1029 |
}
|
1006 |
|
1030 |
|
1007 |
// Autocompletion
|
1031 |
// Autocompletion
|
1008 |
final SQLTable sqlTableArticle = ((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete().getTable("ARTICLE");
|
1032 |
final SQLTable sqlTableArticle = ((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete().getTable("ARTICLE");
|
1009 |
List<String> completionField = new ArrayList<String>();
|
1033 |
List<String> completionField = new ArrayList<String>();
|
1010 |
if (e.getTable().getFieldsName().contains("ID_ECO_CONTRIBUTION")) {
|
1034 |
if (fieldsName.contains("ID_ECO_CONTRIBUTION")) {
|
1011 |
completionField.add("ID_ECO_CONTRIBUTION");
|
1035 |
completionField.add("ID_ECO_CONTRIBUTION");
|
1012 |
}
|
1036 |
}
|
1013 |
|
1037 |
|
1014 |
if (showDevise) {
|
1038 |
if (showDevise) {
|
1015 |
completionField.add("CODE_DOUANIER");
|
1039 |
completionField.add("CODE_DOUANIER");
|
1016 |
completionField.add("ID_PAYS");
|
1040 |
completionField.add("ID_PAYS");
|
1017 |
}
|
1041 |
}
|
1018 |
completionField.add("POURCENT_REMISE");
|
1042 |
completionField.add("POURCENT_REMISE");
|
1019 |
completionField.add("ID_UNITE_VENTE");
|
1043 |
completionField.add("ID_UNITE_VENTE");
|
1020 |
completionField.add("QTE_UNITAIRE");
|
1044 |
completionField.add("QTE_UNITAIRE");
|
- |
|
1045 |
completionField.add("QTE");
|
1021 |
completionField.add("PA_HT");
|
1046 |
completionField.add("PA_HT");
|
1022 |
completionField.add("PV_HT");
|
1047 |
completionField.add("PV_HT");
|
1023 |
completionField.add("ID_TAXE");
|
1048 |
completionField.add("ID_TAXE");
|
1024 |
completionField.add("POIDS");
|
1049 |
completionField.add("POIDS");
|
1025 |
completionField.add("PRIX_METRIQUE_HA_1");
|
1050 |
completionField.add("PRIX_METRIQUE_HA_1");
|
Line 1035... |
Line 1060... |
1035 |
completionField.add("SERVICE");
|
1060 |
completionField.add("SERVICE");
|
1036 |
completionField.add("ID_FAMILLE_ARTICLE");
|
1061 |
completionField.add("ID_FAMILLE_ARTICLE");
|
1037 |
completionField.add("LONGUEUR");
|
1062 |
completionField.add("LONGUEUR");
|
1038 |
completionField.add("LARGEUR");
|
1063 |
completionField.add("LARGEUR");
|
1039 |
completionField.add("HAUTEUR");
|
1064 |
completionField.add("HAUTEUR");
|
- |
|
1065 |
completionField.addAll(fieldDecl);
|
1040 |
if (getSQLElement().getTable().getFieldsName().contains("DESCRIPTIF")) {
|
1066 |
if (getSQLElement().getTable().getFieldsName().contains("DESCRIPTIF")) {
|
1041 |
completionField.add("DESCRIPTIF");
|
1067 |
completionField.add("DESCRIPTIF");
|
1042 |
}
|
1068 |
}
|
1043 |
if (showDevise) {
|
1069 |
if (showDevise) {
|
1044 |
completionField.add("ID_DEVISE");
|
1070 |
completionField.add("ID_DEVISE");
|
Line 1053... |
Line 1079... |
1053 |
}
|
1079 |
}
|
1054 |
if (getSQLElement().getTable().getFieldsName().contains("TARE") && sqlTableArticle.getTable().getFieldsName().contains("TARE")) {
|
1080 |
if (getSQLElement().getTable().getFieldsName().contains("TARE") && sqlTableArticle.getTable().getFieldsName().contains("TARE")) {
|
1055 |
completionField.add("TARE");
|
1081 |
completionField.add("TARE");
|
1056 |
}
|
1082 |
}
|
1057 |
|
1083 |
|
1058 |
final AutoCompletionManager m = new AutoCompletionManager(tableElementCode, sqlTableArticle.getField("CODE"), this.table, this.table.getRowValuesTableModel()) {
|
1084 |
this.codeCompletionManager = new ItemAutoCompletionManager(this, tableElementCode, sqlTableArticle.getField("CODE"), this.table, this.table.getRowValuesTableModel());
|
1059 |
|
1085 |
|
1060 |
@Override
|
- |
|
1061 |
protected Object getValueFrom(SQLRow row, String field, SQLRowAccessor rowDest) {
|
- |
|
1062 |
Object res = tarifCompletion(row, field, rowDest, true);
|
- |
|
1063 |
if (res == null) {
|
- |
|
1064 |
res = super.getValueFrom(row, field, rowDest);
|
- |
|
1065 |
}
|
- |
|
1066 |
if (field.equals("POURCENT_REMISE")) {
|
- |
|
1067 |
return getRemiseClient(row);
|
- |
|
1068 |
}
|
- |
|
1069 |
return res;
|
- |
|
1070 |
}
|
- |
|
1071 |
|
- |
|
1072 |
};
|
- |
|
1073 |
m.fill("NOM", "NOM");
|
1086 |
this.codeCompletionManager.fill("NOM", "NOM");
|
1074 |
m.fill("ID", "ID_ARTICLE");
|
1087 |
this.codeCompletionManager.fill("ID", "ID_ARTICLE");
|
1075 |
for (String string : completionField) {
|
1088 |
for (String string : completionField) {
|
1076 |
m.fill(string, string);
|
1089 |
this.codeCompletionManager.fill(string, string);
|
1077 |
}
|
1090 |
}
|
1078 |
|
1091 |
|
1079 |
ITransformer<SQLSelect, SQLSelect> selTrans = new ITransformer<SQLSelect, SQLSelect>() {
|
1092 |
ITransformer<SQLSelect, SQLSelect> selTrans = new ITransformer<SQLSelect, SQLSelect>() {
|
1080 |
@Override
|
1093 |
@Override
|
1081 |
public SQLSelect transformChecked(SQLSelect input) {
|
1094 |
public SQLSelect transformChecked(SQLSelect input) {
|
Line 1096... |
Line 1109... |
1096 |
input.asString();
|
1109 |
input.asString();
|
1097 |
return input;
|
1110 |
return input;
|
1098 |
}
|
1111 |
}
|
1099 |
};
|
1112 |
};
|
1100 |
|
1113 |
|
1101 |
m.setSelectTransformer(selTrans);
|
1114 |
this.codeCompletionManager.setSelectTransformer(selTrans);
|
1102 |
|
1115 |
|
1103 |
this.table.setDropTarget(new DropTarget() {
|
1116 |
this.table.setDropTarget(new DropTarget() {
|
1104 |
@Override
|
1117 |
@Override
|
1105 |
public synchronized void drop(DropTargetDropEvent dtde) {
|
1118 |
public synchronized void drop(DropTargetDropEvent dtde) {
|
1106 |
dropInTable(dtde, m);
|
1119 |
dropInTable(dtde, AbstractVenteArticleItemTable.this.codeCompletionManager);
|
1107 |
// super.drop(dtde);
|
1120 |
// super.drop(dtde);
|
1108 |
}
|
1121 |
}
|
1109 |
});
|
1122 |
});
|
1110 |
|
1123 |
|
1111 |
if (prefs.getBoolean(GestionArticleGlobalPreferencePanel.CAN_EXPAND_NOMENCLATURE_VT, true)) {
|
1124 |
if (prefs.getBoolean(GestionArticleGlobalPreferencePanel.CAN_EXPAND_NOMENCLATURE_VT, true)) {
|
Line 1132... |
Line 1145... |
1132 |
JPopupMenu popup = new JPopupMenu();
|
1145 |
JPopupMenu popup = new JPopupMenu();
|
1133 |
popup.add(new AbstractAction(TranslationManager.getInstance().getTranslationForItem("product.bom.expand")) {
|
1146 |
popup.add(new AbstractAction(TranslationManager.getInstance().getTranslationForItem("product.bom.expand")) {
|
1134 |
|
1147 |
|
1135 |
@Override
|
1148 |
@Override
|
1136 |
public void actionPerformed(ActionEvent arg0) {
|
1149 |
public void actionPerformed(ActionEvent arg0) {
|
1137 |
expandNomenclature(rowindex, m, EXPAND_TYPE.EXPAND);
|
1150 |
expandNomenclature(rowindex, codeCompletionManager, EXPAND_TYPE.EXPAND);
|
1138 |
}
|
1151 |
}
|
1139 |
});
|
1152 |
});
|
1140 |
popup.add(new AbstractAction(TranslationManager.getInstance().getTranslationForItem("product.bom.expose")) {
|
1153 |
popup.add(new AbstractAction(TranslationManager.getInstance().getTranslationForItem("product.bom.expose")) {
|
1141 |
|
1154 |
|
1142 |
@Override
|
1155 |
@Override
|
1143 |
public void actionPerformed(ActionEvent arg0) {
|
1156 |
public void actionPerformed(ActionEvent arg0) {
|
1144 |
expandNomenclature(rowindex, m, EXPAND_TYPE.VIEW_ONLY);
|
1157 |
expandNomenclature(rowindex, codeCompletionManager, EXPAND_TYPE.VIEW_ONLY);
|
1145 |
}
|
1158 |
}
|
1146 |
});
|
1159 |
});
|
1147 |
|
1160 |
|
1148 |
for (AbstractAction action : getAdditionnalMouseAction(rowindex)) {
|
1161 |
for (AbstractAction action : getAdditionnalMouseAction(rowindex)) {
|
1149 |
popup.add(action);
|
1162 |
popup.add(action);
|
Line 1152... |
Line 1165... |
1152 |
popup.show(e.getComponent(), e.getX(), e.getY());
|
1165 |
popup.show(e.getComponent(), e.getX(), e.getY());
|
1153 |
}
|
1166 |
}
|
1154 |
}
|
1167 |
}
|
1155 |
});
|
1168 |
});
|
1156 |
}
|
1169 |
}
|
1157 |
final AutoCompletionManager m2 = new AutoCompletionManager(tableElementNom, sqlTableArticle.getField("NOM"), this.table, this.table.getRowValuesTableModel()) {
|
1170 |
final AutoCompletionManager m2 = new ItemAutoCompletionManager(this, tableElementNom, sqlTableArticle.getField("NOM"), this.table, this.table.getRowValuesTableModel());
|
1158 |
@Override
|
- |
|
1159 |
protected Object getValueFrom(SQLRow row, String field, SQLRowAccessor rowDest) {
|
- |
|
1160 |
Object res = tarifCompletion(row, field, rowDest, true);
|
- |
|
1161 |
if (res == null) {
|
- |
|
1162 |
res = super.getValueFrom(row, field, rowDest);
|
- |
|
1163 |
}
|
- |
|
1164 |
if (field.equals("POURCENT_REMISE")) {
|
- |
|
1165 |
return getRemiseClient(row);
|
- |
|
1166 |
}
|
- |
|
1167 |
return res;
|
- |
|
1168 |
}
|
- |
|
1169 |
|
- |
|
1170 |
};
|
- |
|
1171 |
m2.fill("CODE", "CODE");
|
1171 |
m2.fill("CODE", "CODE");
|
1172 |
m2.fill("ID", "ID_ARTICLE");
|
1172 |
m2.fill("ID", "ID_ARTICLE");
|
1173 |
for (String string : completionField) {
|
1173 |
for (String string : completionField) {
|
1174 |
m2.fill(string, string);
|
1174 |
m2.fill(string, string);
|
1175 |
}
|
1175 |
}
|
1176 |
|
1176 |
|
1177 |
m2.setSelectTransformer(selTrans);
|
1177 |
m2.setSelectTransformer(selTrans);
|
1178 |
|
1178 |
|
1179 |
final AutoCompletionManager m3 = new AutoCompletionManager(tableElementArticle, sqlTableArticle.getField("NOM"), this.table, this.table.getRowValuesTableModel(),
|
1179 |
final AutoCompletionManager m3 = new ItemAutoCompletionManager(this, tableElementArticle, sqlTableArticle.getField("NOM"), this.table, this.table.getRowValuesTableModel(),
|
1180 |
ITextWithCompletion.MODE_CONTAINS, true, true, new ValidStateChecker()) {
|
1180 |
ITextWithCompletion.MODE_CONTAINS, true, true, new ValidStateChecker());
|
1181 |
@Override
|
- |
|
1182 |
protected Object getValueFrom(SQLRow row, String field, SQLRowAccessor rowDest) {
|
- |
|
1183 |
Object res = tarifCompletion(row, field, rowDest, true);
|
- |
|
1184 |
if (res == null) {
|
- |
|
1185 |
res = super.getValueFrom(row, field, rowDest);
|
- |
|
1186 |
}
|
- |
|
1187 |
if (field.equals("POURCENT_REMISE")) {
|
- |
|
1188 |
return getRemiseClient(row);
|
- |
|
1189 |
}
|
- |
|
1190 |
return res;
|
- |
|
1191 |
}
|
- |
|
1192 |
|
- |
|
1193 |
};
|
- |
|
1194 |
m3.fill("CODE", "CODE");
|
1181 |
m3.fill("CODE", "CODE");
|
1195 |
m3.fill("NOM", "NOM");
|
1182 |
m3.fill("NOM", "NOM");
|
1196 |
for (String string : completionField) {
|
1183 |
for (String string : completionField) {
|
1197 |
m3.fill(string, string);
|
1184 |
m3.fill(string, string);
|
1198 |
}
|
1185 |
}
|
Line 1206... |
Line 1193... |
1206 |
@Override
|
1193 |
@Override
|
1207 |
public Object computeValueFrom(SQLRowValues row, SQLTableElement source) {
|
1194 |
public Object computeValueFrom(SQLRowValues row, SQLTableElement source) {
|
1208 |
try {
|
1195 |
try {
|
1209 |
if (filterFamilleArticle) {
|
1196 |
if (filterFamilleArticle) {
|
1210 |
if (row.isForeignEmpty("ID_FAMILLE_ARTICLE")) {
|
1197 |
if (row.isForeignEmpty("ID_FAMILLE_ARTICLE")) {
|
1211 |
m.setWhere(null);
|
1198 |
codeCompletionManager.setWhere(null);
|
1212 |
m2.setWhere(null);
|
1199 |
m2.setWhere(null);
|
1213 |
} else {
|
1200 |
} else {
|
1214 |
m.setWhere(new Where(sqlTableArticle.getField("ID_FAMILLE_ARTICLE"), "=", row.getForeignID("ID_FAMILLE_ARTICLE")));
|
1201 |
codeCompletionManager.setWhere(new Where(sqlTableArticle.getField("ID_FAMILLE_ARTICLE"), "=", row.getForeignID("ID_FAMILLE_ARTICLE")));
|
1215 |
m2.setWhere(new Where(sqlTableArticle.getField("ID_FAMILLE_ARTICLE"), "=", row.getForeignID("ID_FAMILLE_ARTICLE")));
|
1202 |
m2.setWhere(new Where(sqlTableArticle.getField("ID_FAMILLE_ARTICLE"), "=", row.getForeignID("ID_FAMILLE_ARTICLE")));
|
1216 |
}
|
1203 |
}
|
1217 |
}
|
1204 |
}
|
1218 |
SQLRowAccessor foreign = row.getForeign("ID_ARTICLE");
|
1205 |
SQLRowAccessor foreign = row.getForeign("ID_ARTICLE");
|
1219 |
if (foreign != null && !foreign.isUndefined() && foreign.getObject("CODE") != null && foreign.getString("CODE").equals(row.getString("CODE"))) {
|
1206 |
if (foreign != null && !foreign.isUndefined() && foreign.getObject("CODE") != null && foreign.getString("CODE").equals(row.getString("CODE"))) {
|
Line 1682... |
Line 1669... |
1682 |
if (l2.size() > 0) {
|
1669 |
if (l2.size() > 0) {
|
1683 |
System.err.println("ARTICLE " + l2.get(0).getString("NOM"));
|
1670 |
System.err.println("ARTICLE " + l2.get(0).getString("NOM"));
|
1684 |
Tuple3<Double, String, String> art = Tuple3.create(1.0D, l2.get(0).getString("CODE"), l2.get(0).getString("NOM"));
|
1671 |
Tuple3<Double, String, String> art = Tuple3.create(1.0D, l2.get(0).getString("CODE"), l2.get(0).getString("NOM"));
|
1685 |
List<Tuple3<Double, String, String>> l = new ArrayList<Tuple3<Double, String, String>>();
|
1672 |
List<Tuple3<Double, String, String>> l = new ArrayList<Tuple3<Double, String, String>>();
|
1686 |
l.add(art);
|
1673 |
l.add(art);
|
1687 |
insertFromDrop(l, m);
|
1674 |
insertFromDrop(l, codeCompletionManager);
|
1688 |
} else {
|
1675 |
} else {
|
1689 |
System.err.println("ARTICLE NOT FOUND !");
|
1676 |
System.err.println("ARTICLE NOT FOUND !");
|
1690 |
}
|
1677 |
}
|
1691 |
}
|
1678 |
}
|
1692 |
|
1679 |
|
Line 1715... |
Line 1702... |
1715 |
}
|
1702 |
}
|
1716 |
|
1703 |
|
1717 |
JButton buttonStock = new JButton("Consulter le stock");
|
1704 |
JButton buttonStock = new JButton("Consulter le stock");
|
1718 |
buttonStock.addActionListener(new ActionListener() {
|
1705 |
buttonStock.addActionListener(new ActionListener() {
|
1719 |
public void actionPerformed(ActionEvent event) {
|
1706 |
public void actionPerformed(ActionEvent event) {
|
- |
|
1707 |
try {
|
1720 |
SQLRowValues rowValsSel = table.getSelectedRowValues();
|
1708 |
SQLRowValues rowValsSel = table.getSelectedRowValues();
|
1721 |
if (rowValsSel != null) {
|
1709 |
if (rowValsSel != null) {
|
1722 |
SQLRowAccessor foreignArt = rowValsSel.getForeign("ID_ARTICLE");
|
1710 |
SQLRowAccessor foreignArt = rowValsSel.getForeign("ID_ARTICLE");
|
1723 |
if (foreignArt != null && !foreignArt.isUndefined()) {
|
1711 |
if (foreignArt != null && !foreignArt.isUndefined()) {
|
1724 |
SQLRowAccessor rowValsStock = StockSQLElement.getStock(rowValsSel);
|
1712 |
SQLRowAccessor rowValsStock = StockSQLElement.getStock(rowValsSel);
|
Line 1727... |
Line 1715... |
1727 |
frame.selectionId(rowValsStock.getID());
|
1715 |
frame.selectionId(rowValsStock.getID());
|
1728 |
frame.setVisible(true);
|
1716 |
frame.setVisible(true);
|
1729 |
}
|
1717 |
}
|
1730 |
}
|
1718 |
}
|
1731 |
}
|
1719 |
}
|
1732 |
|
- |
|
- |
|
1720 |
} catch (Exception e) {
|
- |
|
1721 |
ExceptionHandler.handle("Erreur d'accès au stock", e);
|
- |
|
1722 |
}
|
1733 |
}
|
1723 |
}
|
1734 |
});
|
1724 |
});
|
1735 |
|
1725 |
|
1736 |
this.buttons.add(buttonStock);
|
1726 |
this.buttons.add(buttonStock);
|
1737 |
|
1727 |
|
Line 1756... |
Line 1746... |
1756 |
}
|
1746 |
}
|
1757 |
}
|
1747 |
}
|
1758 |
return pv;
|
1748 |
return pv;
|
1759 |
}
|
1749 |
}
|
1760 |
|
1750 |
|
1761 |
protected Acompte getRemiseClient(SQLRowAccessor article) {
|
1751 |
protected Acompte getRemiseClient(SQLRowAccessor article, Acompte acompteTarif) {
|
1762 |
Acompte remise = null;
|
1752 |
Acompte remise = null;
|
1763 |
if (this.cacheRemiseFamille != null) {
|
1753 |
if (this.cacheRemiseFamille != null) {
|
1764 |
if (getRowClient() != null && !getRowClient().isUndefined() && article != null && !article.isUndefined()) {
|
1754 |
if (getRowClient() != null && !getRowClient().isUndefined() && article != null && !article.isUndefined()) {
|
1765 |
if (article.getForeign("ID_FAMILLE_ARTICLE") != null && !article.isForeignEmpty("ID_FAMILLE_ARTICLE")) {
|
1755 |
if (article.getForeign("ID_FAMILLE_ARTICLE") != null && !article.isForeignEmpty("ID_FAMILLE_ARTICLE")) {
|
1766 |
Integer fID = article.getForeignID("ID_FAMILLE_ARTICLE");
|
1756 |
Integer fID = article.getForeignID("ID_FAMILLE_ARTICLE");
|
Line 1776... |
Line 1766... |
1776 |
if (remise == null) {
|
1766 |
if (remise == null) {
|
1777 |
SQLRow rowFamille2 = cacheTableFamille.getRowFromId(fIDPere);
|
1767 |
SQLRow rowFamille2 = cacheTableFamille.getRowFromId(fIDPere);
|
1778 |
if (rowFamille2 != null && rowFamille2.getObject("ID_FAMILLE_ARTICLE_PERE") != null && !rowFamille2.isForeignEmpty("ID_FAMILLE_ARTICLE_PERE")) {
|
1768 |
if (rowFamille2 != null && rowFamille2.getObject("ID_FAMILLE_ARTICLE_PERE") != null && !rowFamille2.isForeignEmpty("ID_FAMILLE_ARTICLE_PERE")) {
|
1779 |
Integer fIDPere2 = rowFamille2.getForeignID("ID_FAMILLE_ARTICLE_PERE");
|
1769 |
Integer fIDPere2 = rowFamille2.getForeignID("ID_FAMILLE_ARTICLE_PERE");
|
1780 |
remise = getRemiseFamille(fIDPere2);
|
1770 |
remise = getRemiseFamille(fIDPere2);
|
- |
|
1771 |
if (remise == null) {
|
- |
|
1772 |
SQLRow rowFamille3 = cacheTableFamille.getRowFromId(fIDPere2);
|
- |
|
1773 |
if (rowFamille3 != null && rowFamille3.getObject("ID_FAMILLE_ARTICLE_PERE") != null && !rowFamille3.isForeignEmpty("ID_FAMILLE_ARTICLE_PERE")) {
|
- |
|
1774 |
Integer fIDPere3 = rowFamille3.getForeignID("ID_FAMILLE_ARTICLE_PERE");
|
- |
|
1775 |
remise = getRemiseFamille(fIDPere3);
|
- |
|
1776 |
}
|
- |
|
1777 |
}
|
1781 |
}
|
1778 |
}
|
1782 |
}
|
1779 |
}
|
1783 |
}
|
1780 |
}
|
1784 |
|
1781 |
|
1785 |
}
|
1782 |
}
|
Line 1796... |
Line 1793... |
1796 |
}
|
1793 |
}
|
1797 |
}
|
1794 |
}
|
1798 |
}
|
1795 |
}
|
1799 |
}
|
1796 |
}
|
1800 |
if (remise == null) {
|
1797 |
if (remise == null) {
|
- |
|
1798 |
if (acompteTarif == null) {
|
1801 |
return new Acompte(BigDecimal.ZERO, BigDecimal.ZERO);
|
1799 |
return new Acompte(BigDecimal.ZERO, BigDecimal.ZERO);
|
1802 |
} else {
|
1800 |
} else {
|
- |
|
1801 |
return acompteTarif;
|
- |
|
1802 |
}
|
- |
|
1803 |
} else {
|
- |
|
1804 |
if (acompteTarif != null && acompteTarif.getPercent() != null && remise.getPercent().compareTo(acompteTarif.percent) > 0) {
|
1803 |
return remise;
|
1805 |
return remise;
|
- |
|
1806 |
} else {
|
- |
|
1807 |
return acompteTarif;
|
- |
|
1808 |
}
|
1804 |
}
|
1809 |
}
|
1805 |
}
|
1810 |
}
|
1806 |
|
1811 |
|
1807 |
private Acompte getRemiseFamille(int fID) {
|
1812 |
private Acompte getRemiseFamille(int fID) {
|
1808 |
Acompte remise = null;
|
1813 |
Acompte remise = null;
|
Line 1864... |
Line 1869... |
1864 |
return ha.multiply(percent.movePointLeft(2).add(BigDecimal.ONE)).setScale(ha.precision(), RoundingMode.HALF_UP);
|
1869 |
return ha.multiply(percent.movePointLeft(2).add(BigDecimal.ONE)).setScale(ha.precision(), RoundingMode.HALF_UP);
|
1865 |
}
|
1870 |
}
|
1866 |
}
|
1871 |
}
|
1867 |
|
1872 |
|
1868 |
if (getTarif() != null && !getTarif().isUndefined()) {
|
1873 |
if (getTarif() != null && !getTarif().isUndefined()) {
|
1869 |
Collection<? extends SQLRowAccessor> rows = row.getReferentRows(tableArticleTarif);
|
1874 |
SQLRowValues rowValsTarif = new SQLRowValues(this.tableArticleTarif);
|
- |
|
1875 |
rowValsTarif.putNulls(this.tableArticleTarif.getFieldsName());
|
- |
|
1876 |
Where where = new Where(this.tableArticleTarif.getField("ID_TARIF"), "=", getTarif().getID()).and(new Where(this.tableArticleTarif.getField("ID_ARTICLE"), "=", row.getID()));
|
- |
|
1877 |
if (this.tableArticleTarif.contains("OBSOLETE")) {
|
- |
|
1878 |
where = where.and(new Where(this.tableArticleTarif.getField("OBSOLETE"), "=", Boolean.FALSE));
|
- |
|
1879 |
}
|
- |
|
1880 |
List<SQLRowValues> fetchRows = SQLRowValuesListFetcher.create(rowValsTarif).fetch(where);
|
- |
|
1881 |
|
- |
|
1882 |
if (fetchRows.isEmpty() && row.getObject("ID_ARTICLE_VIRTUEL_PERE") != null && !row.isForeignEmpty("ID_ARTICLE_VIRTUEL_PERE")) {
|
- |
|
1883 |
Where where2 = new Where(this.tableArticleTarif.getField("ID_TARIF"), "=", getTarif().getID())
|
- |
|
1884 |
.and(new Where(this.tableArticleTarif.getField("ID_ARTICLE"), "=", row.getForeignID("ID_ARTICLE_VIRTUEL_PERE")));
|
- |
|
1885 |
if (this.tableArticleTarif.contains("OBSOLETE")) {
|
- |
|
1886 |
where2 = where2.and(new Where(this.tableArticleTarif.getField("OBSOLETE"), "=", Boolean.FALSE));
|
- |
|
1887 |
}
|
- |
|
1888 |
fetchRows = SQLRowValuesListFetcher.create(rowValsTarif).fetch(where2);
|
- |
|
1889 |
}
|
1870 |
|
1890 |
|
1871 |
// Récupération du tarif associé à la quantité
|
1891 |
// Récupération du tarif associé à la quantité
|
1872 |
int quantite = 0;
|
1892 |
int quantite = 0;
|
1873 |
BigDecimal b = rowDest.getBigDecimal("QTE_UNITAIRE");
|
1893 |
BigDecimal b = rowDest.getBigDecimal("QTE_UNITAIRE");
|
1874 |
int q = rowDest.getInt("QTE");
|
1894 |
int q = rowDest.getInt("QTE");
|
1875 |
BigDecimal qteTotal = b.multiply(new BigDecimal(q), DecimalUtils.HIGH_PRECISION);
|
1895 |
BigDecimal qteTotal = b.multiply(new BigDecimal(q), DecimalUtils.HIGH_PRECISION);
|
1876 |
SQLRowAccessor rowTarif = null;
|
1896 |
SQLRowAccessor rowTarif = null;
|
1877 |
|
1897 |
|
1878 |
for (SQLRowAccessor sqlRowAccessor : rows) {
|
1898 |
for (SQLRowValues sqlRowAccessor : fetchRows) {
|
1879 |
|
1899 |
|
1880 |
if (!sqlRowAccessor.getTable().contains("OBSOLETE") || !sqlRowAccessor.getBoolean("OBSOLETE")) {
|
1900 |
if (!sqlRowAccessor.getTable().contains("OBSOLETE") || !sqlRowAccessor.getBoolean("OBSOLETE")) {
|
1881 |
// FIXME BigDecimal??
|
1901 |
// FIXME BigDecimal??
|
1882 |
// BigDecimal bigDecimal = sqlRowAccessor.getBigDecimal("QTE");
|
1902 |
// BigDecimal bigDecimal = sqlRowAccessor.getBigDecimal("QTE");
|
1883 |
int qteTarif = sqlRowAccessor.getInt("QTE");
|
1903 |
int qteTarif = sqlRowAccessor.getInt("QTE");
|
Line 1944... |
Line 1964... |
1944 |
|
1964 |
|
1945 |
if (field.equalsIgnoreCase("ID_TAXE_VENTE") && this.rowCatComptable != null) {
|
1965 |
if (field.equalsIgnoreCase("ID_TAXE_VENTE") && this.rowCatComptable != null) {
|
1946 |
return this.rowCatComptable.getForeignID("ID_TAXE_VENTE");
|
1966 |
return this.rowCatComptable.getForeignID("ID_TAXE_VENTE");
|
1947 |
}
|
1967 |
}
|
1948 |
|
1968 |
|
- |
|
1969 |
if (field.equalsIgnoreCase("ID_TAXE") && this.rowCatComptable != null) {
|
- |
|
1970 |
if (!this.rowCatComptable.isForeignEmpty("ID_TAXE_VENTE")) {
|
- |
|
1971 |
return this.rowCatComptable.getForeignID("ID_TAXE_VENTE");
|
- |
|
1972 |
}
|
- |
|
1973 |
}
|
- |
|
1974 |
|
1949 |
if ((field.equalsIgnoreCase("POURCENT_REMISE"))) {
|
1975 |
if ((field.equalsIgnoreCase("POURCENT_REMISE"))) {
|
1950 |
return new Acompte(BigDecimal.ZERO, BigDecimal.ZERO);
|
1976 |
return new Acompte(BigDecimal.ZERO, BigDecimal.ZERO);
|
1951 |
}
|
1977 |
}
|
1952 |
|
1978 |
|
1953 |
if ((field.equalsIgnoreCase("PRIX_METRIQUE_VT_1"))) {
|
1979 |
if ((field.equalsIgnoreCase("PRIX_METRIQUE_VT_1"))) {
|
Line 2086... |
Line 2112... |
2086 |
result = sqlRowAccessor.getBigDecimal("PRIX");
|
2112 |
result = sqlRowAccessor.getBigDecimal("PRIX");
|
2087 |
}
|
2113 |
}
|
2088 |
}
|
2114 |
}
|
2089 |
}
|
2115 |
}
|
2090 |
}
|
2116 |
}
|
- |
|
2117 |
BigDecimal promoRemise = null;
|
- |
|
2118 |
BigDecimal promoTarif = null;
|
- |
|
2119 |
if (rowA != null && !rowA.isUndefined() && rowA.getTable().getDBRoot().contains("ARTICLE_TARIF_PROMOTION")) {
|
- |
|
2120 |
Collection<? extends SQLRowAccessor> col = rowA.getReferentRows(rowA.getTable().getTable("ARTICLE_TARIF_PROMOTION"));
|
- |
|
2121 |
BigDecimal quantite = BigDecimal.ZERO;
|
- |
|
2122 |
int q = row.getInt("QTE");
|
- |
|
2123 |
BigDecimal b = row.getBigDecimal("QTE_UNITAIRE");
|
- |
|
2124 |
BigDecimal qteTotal = b.multiply(new BigDecimal(q), DecimalUtils.HIGH_PRECISION);
|
2091 |
|
2125 |
|
- |
|
2126 |
Calendar c = Calendar.getInstance();
|
- |
|
2127 |
for (SQLRowAccessor sqlRowAccessor : col) {
|
- |
|
2128 |
final SQLRowAccessor foreignPromotion = sqlRowAccessor.getForeign("ID_TARIF_PROMOTION");
|
- |
|
2129 |
Calendar start = foreignPromotion.getDate("START");
|
- |
|
2130 |
Calendar end = foreignPromotion.getDate("END");
|
- |
|
2131 |
|
- |
|
2132 |
BigDecimal bigDecimal = new BigDecimal(sqlRowAccessor.getInt("QTE"));
|
- |
|
2133 |
|
- |
|
2134 |
if (CompareUtils.compare(bigDecimal, qteTotal) <= 0 && CompareUtils.compare(bigDecimal, quantite) > 0 && (start != null && c.after(start)) && (end != null && c.before(end))) {
|
- |
|
2135 |
quantite = bigDecimal;
|
- |
|
2136 |
if (sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1") != null) {
|
- |
|
2137 |
promoTarif = sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1");
|
- |
|
2138 |
promoRemise = null;
|
- |
|
2139 |
} else {
|
- |
|
2140 |
promoTarif = null;
|
- |
|
2141 |
promoRemise = sqlRowAccessor.getBigDecimal("POURCENT_REMISE");
|
- |
|
2142 |
}
|
- |
|
2143 |
}
|
- |
|
2144 |
}
|
- |
|
2145 |
}
|
- |
|
2146 |
|
2092 |
BigDecimal remise = null;
|
2147 |
BigDecimal remise = BigDecimal.ZERO;
|
2093 |
|
2148 |
|
2094 |
if (rowA != null && !rowA.isUndefined() && rowA.getTable().getDBRoot().contains("TARIF_QUANTITE")) {
|
2149 |
if (rowA != null && !rowA.isUndefined() && rowA.getTable().getDBRoot().contains("TARIF_QUANTITE")) {
|
2095 |
Collection<? extends SQLRowAccessor> col = rowA.getReferentRows(rowA.getTable().getTable("TARIF_QUANTITE"));
|
2150 |
Collection<? extends SQLRowAccessor> col = rowA.getReferentRows(rowA.getTable().getTable("TARIF_QUANTITE"));
|
2096 |
BigDecimal quantite = BigDecimal.ZERO;
|
2151 |
BigDecimal quantite = BigDecimal.ZERO;
|
2097 |
BigDecimal b = row.getBigDecimal("QTE_UNITAIRE");
|
2152 |
BigDecimal b = row.getBigDecimal("QTE_UNITAIRE");
|
Line 2103... |
Line 2158... |
2103 |
BigDecimal bigDecimal = sqlRowAccessor.getBigDecimal("QUANTITE");
|
2158 |
BigDecimal bigDecimal = sqlRowAccessor.getBigDecimal("QUANTITE");
|
2104 |
if (CompareUtils.compare(bigDecimal, qteTotal) <= 0 && CompareUtils.compare(bigDecimal, quantite) > 0) {
|
2159 |
if (CompareUtils.compare(bigDecimal, qteTotal) <= 0 && CompareUtils.compare(bigDecimal, quantite) > 0) {
|
2105 |
quantite = bigDecimal;
|
2160 |
quantite = bigDecimal;
|
2106 |
if (sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1") != null) {
|
2161 |
if (sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1") != null) {
|
2107 |
result = sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1");
|
2162 |
result = sqlRowAccessor.getBigDecimal("PRIX_METRIQUE_VT_1");
|
2108 |
remise = null;
|
2163 |
remise = BigDecimal.ZERO;
|
2109 |
} else {
|
2164 |
} else {
|
2110 |
result = null;
|
2165 |
result = null;
|
2111 |
remise = sqlRowAccessor.getBigDecimal("POURCENT_REMISE");
|
2166 |
remise = sqlRowAccessor.getBigDecimal("POURCENT_REMISE");
|
2112 |
}
|
2167 |
}
|
2113 |
}
|
2168 |
}
|
2114 |
}
|
2169 |
}
|
2115 |
if (!col.isEmpty() && result == null && remise == null) {
|
2170 |
if (!col.isEmpty() && result == null && (remise == null || remise.signum() == 0)) {
|
2116 |
result = rowA.getBigDecimal("PRIX_METRIQUE_VT_1");
|
2171 |
result = rowA.getBigDecimal("PRIX_METRIQUE_VT_1");
|
2117 |
}
|
2172 |
}
|
- |
|
2173 |
|
- |
|
2174 |
Acompte remiseClient = getRemiseClient(rowA, new Acompte(BigDecimal.ZERO, null));
|
- |
|
2175 |
if (remiseClient != null && remiseClient.getPercent() != null) {
|
- |
|
2176 |
if (remise == null || remise.compareTo(remiseClient.getPercent()) < 0) {
|
- |
|
2177 |
remise = remiseClient.getPercent();
|
- |
|
2178 |
}
|
2118 |
}
|
2179 |
}
|
- |
|
2180 |
}
|
- |
|
2181 |
|
- |
|
2182 |
// Application de la promotion si elle est inférieure au tarif
|
- |
|
2183 |
if (promoRemise != null) {
|
- |
|
2184 |
if (remise == null || remise.compareTo(promoRemise) < 0) {
|
- |
|
2185 |
remise = promoRemise;
|
- |
|
2186 |
}
|
- |
|
2187 |
}
|
- |
|
2188 |
|
- |
|
2189 |
if (promoTarif != null) {
|
- |
|
2190 |
if (result == null || result.compareTo(promoTarif) > 0) {
|
- |
|
2191 |
result = promoTarif;
|
- |
|
2192 |
}
|
- |
|
2193 |
}
|
- |
|
2194 |
|
2119 |
int index = getRowValuesTable().getRowValuesTableModel().row2index(row);
|
2195 |
int index = getRowValuesTable().getRowValuesTableModel().row2index(row);
|
2120 |
if (result == null && remise == null) {
|
2196 |
if (result == null && remise == null) {
|
- |
|
2197 |
if (fromCompletion) {
|
- |
|
2198 |
return null;
|
- |
|
2199 |
} else if (rowA != null) {
|
2121 |
// getRowValuesTable().getRowValuesTableModel().putValue(BigDecimal.ZERO, index,
|
2200 |
return rowA.getObject("PRIX_METRIQUE_VT_1");
|
2122 |
// "POURCENT_REMISE");
|
2201 |
} else {
|
2123 |
return (fromCompletion ? null : row.getObject("PRIX_METRIQUE_VT_1"));
|
2202 |
return row.getObject("PRIX_METRIQUE_VT_1");
|
- |
|
2203 |
}
|
2124 |
} else {
|
2204 |
} else {
|
2125 |
if (result != null) {
|
2205 |
if (result != null) {
|
2126 |
// getRowValuesTable().getRowValuesTableModel().putValue(BigDecimal.ZERO, index,
|
2206 |
getRowValuesTable().getRowValuesTableModel().putValue(remise, index, "POURCENT_REMISE");
|
2127 |
// "POURCENT_REMISE");
|
- |
|
2128 |
return result;
|
2207 |
return result;
|
2129 |
} else {
|
2208 |
} else {
|
2130 |
getRowValuesTable().getRowValuesTableModel().putValue(remise, index, "POURCENT_REMISE");
|
2209 |
getRowValuesTable().getRowValuesTableModel().putValue(remise, index, "POURCENT_REMISE");
|
- |
|
2210 |
final BigDecimal prixVT = row.getBigDecimal("PRIX_METRIQUE_VT_1");
|
- |
|
2211 |
if (rowA != null && !rowA.isUndefined()) {
|
- |
|
2212 |
// TODO si le prix est différent de celui la rowvalues, afficher une popup pour
|
- |
|
2213 |
// prévenir l'utilisateur
|
2131 |
return row.getBigDecimal("PRIX_METRIQUE_VT_1");
|
2214 |
return rowA.getObject("PRIX_METRIQUE_VT_1");
|
- |
|
2215 |
} else if (fromCompletion) {
|
- |
|
2216 |
return null;
|
- |
|
2217 |
} else {
|
- |
|
2218 |
return prixVT;
|
- |
|
2219 |
}
|
2132 |
}
|
2220 |
}
|
2133 |
}
|
2221 |
}
|
2134 |
|
2222 |
|
2135 |
}
|
2223 |
}
|
2136 |
|
2224 |
|
Line 2225... |
Line 2313... |
2225 |
// File f = (File)fileList.get(0);
|
2313 |
// File f = (File)fileList.get(0);
|
2226 |
// table.setValueAt(f.getAbsolutePath(), row, column);
|
2314 |
// table.setValueAt(f.getAbsolutePath(), row, column);
|
2227 |
// table.setValueAt(f.length(), row, column+1);
|
2315 |
// table.setValueAt(f.length(), row, column+1);
|
2228 |
}
|
2316 |
}
|
2229 |
|
2317 |
|
- |
|
2318 |
@Override
|
- |
|
2319 |
public AutoCompletionManager getCodeCompletionManager() {
|
- |
|
2320 |
return this.codeCompletionManager;
|
- |
|
2321 |
}
|
- |
|
2322 |
|
2230 |
protected void insertFromDrop(List<Tuple3<Double, String, String>> articles, AutoCompletionManager m) {
|
2323 |
protected void insertFromDrop(List<Tuple3<Double, String, String>> articles, AutoCompletionManager m) {
|
2231 |
|
2324 |
|
2232 |
List<String> code = new ArrayList<String>(articles.size());
|
2325 |
List<String> code = new ArrayList<String>(articles.size());
|
2233 |
for (int i = articles.size() - 1; i >= 0; i--) {
|
2326 |
for (int i = articles.size() - 1; i >= 0; i--) {
|
2234 |
|
2327 |
|
Line 2312... |
Line 2405... |
2312 |
// row2Insert.put("ID_STYLE", allStyleByName.get("Composant"));
|
2405 |
// row2Insert.put("ID_STYLE", allStyleByName.get("Composant"));
|
2313 |
getRowValuesTable().getRowValuesTableModel().addRowAt(0, row2Insert);
|
2406 |
getRowValuesTable().getRowValuesTableModel().addRowAt(0, row2Insert);
|
2314 |
}
|
2407 |
}
|
2315 |
}
|
2408 |
}
|
2316 |
}
|
2409 |
}
|
- |
|
2410 |
|
2317 |
}
|
2411 |
}
|