From f4c3130ad93e6cfc7af435e976d9d464c3d427d8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Aug 2008 20:37:17 +0000 Subject: [PATCH] Integrate revision 5545 Enhancements from Paul (phib) FR [ 2005711 ] Make quantities editable in "Create lines from" --- client/src/org/compiere/grid/VCreateFrom.java | 13 +++++++------ .../src/org/compiere/grid/VCreateFromInvoice.java | 11 ++++++----- .../src/org/compiere/grid/VCreateFromShipment.java | 11 ++++++----- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/client/src/org/compiere/grid/VCreateFrom.java b/client/src/org/compiere/grid/VCreateFrom.java index ed13670744..9565d93f24 100644 --- a/client/src/org/compiere/grid/VCreateFrom.java +++ b/client/src/org/compiere/grid/VCreateFrom.java @@ -36,8 +36,8 @@ import org.compiere.util.*; * CreateFrom (Called from GridController.startProcess) * * @author Jorg Janke - * @version $Id: VCreateFrom.java,v 1.4 2006/10/11 09:52:23 comdivision Exp $ - * + * @version $Id: VCreateFrom.java,v 1.4 2006/10/11 09:52:23 comdivision Exp $ + * * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
  • FR [ 1794050 ] Usability: VCreateFrom OK button always enabled * @author Victor Perez, e-Evolucion @@ -355,6 +355,7 @@ public abstract class VCreateFrom extends CDialog } log.config("Type=" + type); info(); + dataTable.repaint(); } // tableChanged @@ -497,7 +498,7 @@ public abstract class VCreateFrom extends CDialog BigDecimal qtyOrdered = rs.getBigDecimal(1); BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal qtyEntered = qtyOrdered.multiply(multiplier); - line.add(new Double(qtyEntered.doubleValue())); // 1-Qty + line.add(qtyEntered); // 1-Qty KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim()); line.add(pp); // 2-UOM pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); @@ -545,7 +546,7 @@ public abstract class VCreateFrom extends CDialog dataTable.setModel(model); // dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection - dataTable.setColumnClass(1, Double.class, true); // 1-Qty + dataTable.setColumnClass(1, BigDecimal.class, true); // 1-Qty dataTable.setColumnClass(2, String.class, true); // 2-UOM dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo @@ -554,8 +555,8 @@ public abstract class VCreateFrom extends CDialog dataTable.setColumnClass(7, String.class, true); // 7-Invoice // Table UI dataTable.autoSize(); - } // loadOrder - + } // loadOrder + /** * Set form status line. * Please note, will enable/disable the OK button if the selectedRowCount > 0. diff --git a/client/src/org/compiere/grid/VCreateFromInvoice.java b/client/src/org/compiere/grid/VCreateFromInvoice.java index 0e07dfdbc3..921c9da7a2 100644 --- a/client/src/org/compiere/grid/VCreateFromInvoice.java +++ b/client/src/org/compiere/grid/VCreateFromInvoice.java @@ -313,7 +313,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis BigDecimal qtyMovement = rs.getBigDecimal(1); BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal qtyEntered = qtyMovement.multiply(multiplier); - line.add(new Double(qtyEntered.doubleValue())); // 1-Qty + line.add(qtyEntered); // 1-Qty KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim()); line.add(pp); // 2-UOM pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); @@ -396,7 +396,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis { Vector line = new Vector(7); line.add(new Boolean(false)); // 0-Selection - line.add(rs.getBigDecimal(3).doubleValue()); // 1-Qty + line.add(rs.getBigDecimal(3)); // 1-Qty KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7)); line.add(pp); // 2-UOM pp = new KeyNamePair(rs.getInt(4), rs.getString(5)); @@ -453,6 +453,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis */ protected boolean save() { + dataTable.stopEditor(true); log.config(""); TableModel model = dataTable.getModel(); int rows = model.getRowCount(); @@ -483,8 +484,8 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis if (((Boolean)model.getValueAt(i, 0)).booleanValue()) { // variable values - Double d = (Double)model.getValueAt(i, 1); // 1-Qty - BigDecimal QtyEntered = new BigDecimal(d.doubleValue()); + BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, 1); // 1-Qty + KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2); // 2-UOM int C_UOM_ID = pp.getKey(); // @@ -615,7 +616,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis dataTable.setModel(model); // dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection - dataTable.setColumnClass(1, Double.class, true); // 1-Qty + dataTable.setColumnClass(1, BigDecimal.class, false); // 1-Qty dataTable.setColumnClass(2, String.class, true); // 2-UOM dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo diff --git a/client/src/org/compiere/grid/VCreateFromShipment.java b/client/src/org/compiere/grid/VCreateFromShipment.java index f9c1477c0e..7e845803fb 100644 --- a/client/src/org/compiere/grid/VCreateFromShipment.java +++ b/client/src/org/compiere/grid/VCreateFromShipment.java @@ -77,7 +77,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi dataTable.setModel(model); // dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection - dataTable.setColumnClass(1, Double.class, true); // 1-Qty + dataTable.setColumnClass(1, BigDecimal.class, false); // 1-Qty dataTable.setColumnClass(2, String.class, true); // 2-UOM dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo @@ -358,7 +358,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi BigDecimal qtyInvoiced = rs.getBigDecimal(1); BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal qtyEntered = qtyInvoiced.multiply(multiplier); - line.add(new Double(qtyEntered.doubleValue())); // 1-Qty + line.add(qtyEntered); // 1-Qty KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim()); line.add(pp); // 2-UOM pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); @@ -440,7 +440,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi { Vector line = new Vector(7); line.add(new Boolean(false)); // 0-Selection - line.add(rs.getBigDecimal(3).doubleValue()); // 1-Qty + line.add(rs.getBigDecimal(3)); // 1-Qty KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7)); line.add(pp); // 2-UOM pp = new KeyNamePair(rs.getInt(4), rs.getString(5)); @@ -495,6 +495,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi * @return true if saved */ protected boolean save() { + + dataTable.stopEditor(true); log.config(""); TableModel model = dataTable.getModel(); int rows = model.getRowCount(); @@ -516,8 +518,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi for (int i = 0; i < rows; i++) { if (((Boolean) model.getValueAt(i, 0)).booleanValue()) { // variable values - Double d = (Double) model.getValueAt(i, 1); // 1-Qty - BigDecimal QtyEntered = new BigDecimal(d.doubleValue()); + BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, 1); // 1-Qty KeyNamePair pp = (KeyNamePair) model.getValueAt(i, 2); // 2-UOM int C_UOM_ID = pp.getKey(); pp = (KeyNamePair) model.getValueAt(i, 3); // 3-Product