Integrate revision 5545

Enhancements from Paul (phib) FR [ 2005711 ] Make quantities editable in "Create lines from"
This commit is contained in:
Carlos Ruiz 2008-08-22 20:37:17 +00:00
parent 015f0f44f3
commit f4c3130ad9
3 changed files with 19 additions and 16 deletions

View File

@ -36,8 +36,8 @@ import org.compiere.util.*;
* CreateFrom (Called from GridController.startProcess) * CreateFrom (Called from GridController.startProcess)
* *
* @author Jorg Janke * @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 * @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>FR [ 1794050 ] Usability: VCreateFrom OK button always enabled * <li>FR [ 1794050 ] Usability: VCreateFrom OK button always enabled
* @author Victor Perez, e-Evolucion * @author Victor Perez, e-Evolucion
@ -355,6 +355,7 @@ public abstract class VCreateFrom extends CDialog
} }
log.config("Type=" + type); log.config("Type=" + type);
info(); info();
dataTable.repaint();
} // tableChanged } // tableChanged
@ -497,7 +498,7 @@ public abstract class VCreateFrom extends CDialog
BigDecimal qtyOrdered = rs.getBigDecimal(1); BigDecimal qtyOrdered = rs.getBigDecimal(1);
BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal multiplier = rs.getBigDecimal(2);
BigDecimal qtyEntered = qtyOrdered.multiply(multiplier); 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()); KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim());
line.add(pp); // 2-UOM line.add(pp); // 2-UOM
pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); pp = new KeyNamePair(rs.getInt(5), rs.getString(6));
@ -545,7 +546,7 @@ public abstract class VCreateFrom extends CDialog
dataTable.setModel(model); dataTable.setModel(model);
// //
dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection 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(2, String.class, true); // 2-UOM
dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(3, String.class, true); // 3-Product
dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo 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 dataTable.setColumnClass(7, String.class, true); // 7-Invoice
// Table UI // Table UI
dataTable.autoSize(); dataTable.autoSize();
} // loadOrder } // loadOrder
/** /**
* Set form status line. * Set form status line.
* Please note, will enable/disable the OK button if the selectedRowCount > 0. * Please note, will enable/disable the OK button if the selectedRowCount > 0.

View File

@ -313,7 +313,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
BigDecimal qtyMovement = rs.getBigDecimal(1); BigDecimal qtyMovement = rs.getBigDecimal(1);
BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal multiplier = rs.getBigDecimal(2);
BigDecimal qtyEntered = qtyMovement.multiply(multiplier); 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()); KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim());
line.add(pp); // 2-UOM line.add(pp); // 2-UOM
pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); pp = new KeyNamePair(rs.getInt(5), rs.getString(6));
@ -396,7 +396,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
{ {
Vector<Object> line = new Vector<Object>(7); Vector<Object> line = new Vector<Object>(7);
line.add(new Boolean(false)); // 0-Selection 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)); KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7));
line.add(pp); // 2-UOM line.add(pp); // 2-UOM
pp = new KeyNamePair(rs.getInt(4), rs.getString(5)); pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
@ -453,6 +453,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
*/ */
protected boolean save() protected boolean save()
{ {
dataTable.stopEditor(true);
log.config(""); log.config("");
TableModel model = dataTable.getModel(); TableModel model = dataTable.getModel();
int rows = model.getRowCount(); int rows = model.getRowCount();
@ -483,8 +484,8 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
if (((Boolean)model.getValueAt(i, 0)).booleanValue()) if (((Boolean)model.getValueAt(i, 0)).booleanValue())
{ {
// variable values // variable values
Double d = (Double)model.getValueAt(i, 1); // 1-Qty BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, 1); // 1-Qty
BigDecimal QtyEntered = new BigDecimal(d.doubleValue());
KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2); // 2-UOM KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2); // 2-UOM
int C_UOM_ID = pp.getKey(); int C_UOM_ID = pp.getKey();
// //
@ -615,7 +616,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
dataTable.setModel(model); dataTable.setModel(model);
// //
dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection 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(2, String.class, true); // 2-UOM
dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(3, String.class, true); // 3-Product
dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo

View File

@ -77,7 +77,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
dataTable.setModel(model); dataTable.setModel(model);
// //
dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection 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(2, String.class, true); // 2-UOM
dataTable.setColumnClass(3, String.class, true); // 3-Product dataTable.setColumnClass(3, String.class, true); // 3-Product
dataTable.setColumnClass(4, String.class, true); // 4-VendorProductNo 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 qtyInvoiced = rs.getBigDecimal(1);
BigDecimal multiplier = rs.getBigDecimal(2); BigDecimal multiplier = rs.getBigDecimal(2);
BigDecimal qtyEntered = qtyInvoiced.multiply(multiplier); 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()); KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim());
line.add(pp); // 2-UOM line.add(pp); // 2-UOM
pp = new KeyNamePair(rs.getInt(5), rs.getString(6)); pp = new KeyNamePair(rs.getInt(5), rs.getString(6));
@ -440,7 +440,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
{ {
Vector<Object> line = new Vector<Object>(7); Vector<Object> line = new Vector<Object>(7);
line.add(new Boolean(false)); // 0-Selection 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)); KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7));
line.add(pp); // 2-UOM line.add(pp); // 2-UOM
pp = new KeyNamePair(rs.getInt(4), rs.getString(5)); pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
@ -495,6 +495,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
* @return true if saved * @return true if saved
*/ */
protected boolean save() { protected boolean save() {
dataTable.stopEditor(true);
log.config(""); log.config("");
TableModel model = dataTable.getModel(); TableModel model = dataTable.getModel();
int rows = model.getRowCount(); int rows = model.getRowCount();
@ -516,8 +518,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
for (int i = 0; i < rows; i++) { for (int i = 0; i < rows; i++) {
if (((Boolean) model.getValueAt(i, 0)).booleanValue()) { if (((Boolean) model.getValueAt(i, 0)).booleanValue()) {
// variable values // variable values
Double d = (Double) model.getValueAt(i, 1); // 1-Qty BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, 1); // 1-Qty
BigDecimal QtyEntered = new BigDecimal(d.doubleValue());
KeyNamePair pp = (KeyNamePair) model.getValueAt(i, 2); // 2-UOM KeyNamePair pp = (KeyNamePair) model.getValueAt(i, 2); // 2-UOM
int C_UOM_ID = pp.getKey(); int C_UOM_ID = pp.getKey();
pp = (KeyNamePair) model.getValueAt(i, 3); // 3-Product pp = (KeyNamePair) model.getValueAt(i, 3); // 3-Product