Fixed double cast for BigDecimal

This commit is contained in:
vpj-cd 2008-09-05 18:50:33 +00:00
parent 8e77e6b8b7
commit cbbb6c101e
3 changed files with 14 additions and 13 deletions

View File

@ -141,9 +141,9 @@ public abstract class VCreateFrom extends CDialog
private GridBagLayout parameterBankLayout = new GridBagLayout();
//
private JLabel tenderTypeLabel = new JLabel();
protected VLookup tenderTypeField ; //= new VLookup();
protected VLookup tenderTypeField;
private JLabel documentTypeLabel = new JLabel();
protected VLookup documentTypeField ; //= new VLookup();
protected VLookup documentTypeField;
private JLabel docDateLabel = new JLabel();
protected VDate docDateField = new VDate();
// Bug [1759431]
@ -219,14 +219,15 @@ public abstract class VCreateFrom extends CDialog
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
parameterBankPanel.add(docDateField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
parameterBankPanel.add(documentTypeLabel, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
if(documentTypeField!= null)
parameterBankPanel.add(documentTypeField, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
parameterBankPanel.add(tenderTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
if(tenderTypeField!=null)
parameterBankPanel.add(tenderTypeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
@ -527,7 +528,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));
@ -575,7 +576,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

View File

@ -484,7 +484,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
if (((Boolean)model.getValueAt(i, 0)).booleanValue())
{
// variable values
BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, 1); // 1-Qty
BigDecimal QtyEntered= (BigDecimal)model.getValueAt(i, 1);// 1-Qty
KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2); // 2-UOM
int C_UOM_ID = pp.getKey();
@ -616,7 +616,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
dataTable.setModel(model);
//
dataTable.setColumnClass(0, Boolean.class, false); // 0-Selection
dataTable.setColumnClass(1, BigDecimal.class, false); // 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

View File

@ -108,8 +108,8 @@ public class VCreateFromRMA extends VCreateFrom
dataTable.setColumnClass(1, String.class, true); // 1-Line
dataTable.setColumnClass(2, String.class, true); // 2-Product
dataTable.setColumnClass(3, String.class, true); // 3-ASI
dataTable.setColumnClass(4, Double.class, true); // 4-Qty
dataTable.setColumnClass(5, Double.class, true); // 5-Delivered Qty
dataTable.setColumnClass(4, BigDecimal.class, true); // 4-Qty
dataTable.setColumnClass(5, BigDecimal.class, true); // 5-Delivered Qty
// Table UI
dataTable.autoSize();
@ -165,8 +165,8 @@ public class VCreateFromRMA extends VCreateFrom
BigDecimal qtyEntered = rs.getBigDecimal(4);
BigDecimal movementQty = rs.getBigDecimal(5);
line.add(qtyEntered.doubleValue()); //4-Qty
line.add(movementQty.doubleValue()); //5-Movement Qty
line.add(qtyEntered); //4-Qty
line.add(movementQty); //5-Movement Qty
data.add(line);
@ -211,7 +211,7 @@ public class VCreateFromRMA extends VCreateFrom
{
if (((Boolean)model.getValueAt(i, 0)).booleanValue())
{
Double d = (Double)model.getValueAt(i, 5); // 5-Movement Qty
BigDecimal d = (BigDecimal)model.getValueAt(i, 5); // 5-Movement Qty
KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 1); // 1-Line
int inOutLineId = pp.getKey();
@ -219,7 +219,7 @@ public class VCreateFromRMA extends VCreateFrom
MRMALine rmaLine = new MRMALine(Env.getCtx(), 0, null);
rmaLine.setM_RMA_ID(m_rma_id);
rmaLine.setM_InOutLine_ID(inOutLineId);
rmaLine.setQty(new BigDecimal(d));
rmaLine.setQty(d);
rmaLine.setAD_Org_ID(rma.getAD_Org_ID());
if (!rmaLine.save())
{