MPPOrderBOMLine:
* fixed indentation * organized imports * removed unused code
This commit is contained in:
parent
e0605a3553
commit
cce7e13ae8
|
@ -15,25 +15,16 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.eevolution.model;
|
package org.eevolution.model;
|
||||||
|
|
||||||
import java.util.*;
|
import java.math.BigDecimal;
|
||||||
import java.sql.*;
|
import java.sql.ResultSet;
|
||||||
import java.math.*;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.compiere.util.*;
|
import org.compiere.model.MProduct;
|
||||||
import org.compiere.model.*;
|
import org.compiere.util.Env;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Line Model.
|
* PP Order BOM Line Model.
|
||||||
* <code>
|
*
|
||||||
* MOrderLine ol = new MOrderLine(m_order);
|
|
||||||
ol.setM_Product_ID(wbl.getM_Product_ID());
|
|
||||||
ol.setQtyOrdered(wbl.getQuantity());
|
|
||||||
ol.setPrice();
|
|
||||||
ol.setPriceActual(wbl.getPrice());
|
|
||||||
ol.setTax();
|
|
||||||
ol.save();
|
|
||||||
|
|
||||||
* </code>
|
|
||||||
* @author Victor Perez www.e-evolution.com
|
* @author Victor Perez www.e-evolution.com
|
||||||
* @version $Id: MOrderLine.java,v 1.22 2004/03/22 07:15:03 vpj-cd Exp $
|
* @version $Id: MOrderLine.java,v 1.22 2004/03/22 07:15:03 vpj-cd Exp $
|
||||||
*/
|
*/
|
||||||
|
@ -70,34 +61,14 @@ public class MPPOrderBOMLine extends X_PP_Order_BOMLine
|
||||||
} // MOrderLine
|
} // MOrderLine
|
||||||
|
|
||||||
private MPPOrder m_parent = null;
|
private MPPOrder m_parent = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Defaults from Order.
|
|
||||||
* Does not set Parent !!
|
|
||||||
* @param order order
|
|
||||||
*/
|
|
||||||
public void setMPPOrderBOM (MPPOrderBOM bom)
|
|
||||||
{
|
|
||||||
//setClientOrg(bom);
|
|
||||||
//setC_BPartner_ID(order.getC_BPartner_ID());
|
|
||||||
//setC_BPartner_Location_ID(order.getC_BPartner_Location_ID());
|
|
||||||
//setM_Warehouse_ID(order.getM_Warehouse_ID());
|
|
||||||
//setDateOrdered(order.getDateOrdered());
|
|
||||||
//setDatePromised(order.getDatePromised());
|
|
||||||
//m_M_PriceList_ID = order.getM_PriceList_ID();
|
|
||||||
//m_IsSOTrx = order.isSOTrx();
|
|
||||||
//setC_Currency_ID(order.getC_Currency_ID());
|
|
||||||
} // setOrder
|
|
||||||
|
|
||||||
|
|
||||||
private MProduct m_product = null;
|
private MProduct m_product = null;
|
||||||
private int m_M_Locator_ID = 0;
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* after Save
|
* after Save
|
||||||
* @param newRecord new
|
* @param newRecord new
|
||||||
* @return save
|
* @return save
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||||
|
|
||||||
if (!newRecord)
|
if (!newRecord)
|
||||||
|
@ -151,11 +122,11 @@ public class MPPOrderBOMLine extends X_PP_Order_BOMLine
|
||||||
{
|
{
|
||||||
BigDecimal qty = PP_Order_BOMLine.getQtyBatch().multiply(QtyOrdered);
|
BigDecimal qty = PP_Order_BOMLine.getQtyBatch().multiply(QtyOrdered);
|
||||||
System.out.println("product:"+product.getName() +" Qty:"+qty + " QtyOrdered:"+ QtyOrdered + " PP_Order_BOMLine.getQtyBatch():" + PP_Order_BOMLine.getQtyBatch());
|
System.out.println("product:"+product.getName() +" Qty:"+qty + " QtyOrdered:"+ QtyOrdered + " PP_Order_BOMLine.getQtyBatch():" + PP_Order_BOMLine.getQtyBatch());
|
||||||
if(PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Packing))
|
if(PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Packing))
|
||||||
PP_Order_BOMLine.setQtyRequiered(qty.divide(new BigDecimal(100),8,qty.ROUND_UP));
|
PP_Order_BOMLine.setQtyRequiered(qty.divide(new BigDecimal(100),8,BigDecimal.ROUND_UP));
|
||||||
else if (PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Component) || PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Phantom))
|
else if (PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Component) || PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Phantom))
|
||||||
PP_Order_BOMLine.setQtyRequiered(qty.divide(new BigDecimal(100),8,qty.ROUND_UP));
|
PP_Order_BOMLine.setQtyRequiered(qty.divide(new BigDecimal(100),8,BigDecimal.ROUND_UP));
|
||||||
else if (PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Tools))
|
else if (PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Tools))
|
||||||
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM());
|
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM());
|
||||||
|
|
||||||
//System.out.println("PP_Order_BOMLinegetQtyRequiered" + PP_Order_BOMLine.getQtyRequiered());
|
//System.out.println("PP_Order_BOMLinegetQtyRequiered" + PP_Order_BOMLine.getQtyRequiered());
|
||||||
|
@ -163,11 +134,11 @@ public class MPPOrderBOMLine extends X_PP_Order_BOMLine
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//System.out.println("product: "+product.getName() + " QtyOrdered:"+ QtyOrdered + " PP_Order_BOMLine.getQtyBOM():" + PP_Order_BOMLine.getQtyBOM());
|
//System.out.println("product: "+product.getName() + " QtyOrdered:"+ QtyOrdered + " PP_Order_BOMLine.getQtyBOM():" + PP_Order_BOMLine.getQtyBOM());
|
||||||
if (PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Component) || PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Phantom))
|
if (PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Component) || PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Phantom))
|
||||||
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM().multiply(QtyOrdered));
|
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM().multiply(QtyOrdered));
|
||||||
else if (PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Packing))
|
else if (PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Packing))
|
||||||
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM().multiply(QtyOrdered));
|
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM().multiply(QtyOrdered));
|
||||||
else if (PP_Order_BOMLine.getComponentType().equals(PP_Order_BOMLine.COMPONENTTYPE_Tools))
|
else if (PP_Order_BOMLine.getComponentType().equals(COMPONENTTYPE_Tools))
|
||||||
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM());
|
PP_Order_BOMLine.setQtyRequiered(PP_Order_BOMLine.getQtyBOM());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,38 +159,6 @@ public class MPPOrderBOMLine extends X_PP_Order_BOMLine
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String Representation
|
|
||||||
* @return info
|
|
||||||
*/
|
|
||||||
public String toString ()
|
|
||||||
{
|
|
||||||
StringBuffer sb = new StringBuffer ("PPProductBOMLine[")
|
|
||||||
.append(get_ID())
|
|
||||||
.append ("]");
|
|
||||||
return sb.toString ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set UOM.
|
|
||||||
* make access public
|
|
||||||
* @param C_UOM_ID uom
|
|
||||||
*/
|
|
||||||
public void setC_UOM_ID (int C_UOM_ID)
|
|
||||||
{
|
|
||||||
super.setC_UOM_ID (C_UOM_ID);
|
|
||||||
} // setC_UOM_ID
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Product
|
* Get Product
|
||||||
* @return product or null
|
* @return product or null
|
||||||
|
@ -231,17 +170,6 @@ public class MPPOrderBOMLine extends X_PP_Order_BOMLine
|
||||||
return m_product;
|
return m_product;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save Temp M_Locator_ID
|
|
||||||
* @param M_Locator_ID id
|
|
||||||
*/
|
|
||||||
public void setTempM_Locator_ID (int M_Locator_ID)
|
|
||||||
{
|
|
||||||
m_M_Locator_ID = M_Locator_ID;
|
|
||||||
} // setTempM_Locator_ID
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Parent
|
* Get Parent
|
||||||
* @return parent
|
* @return parent
|
||||||
|
|
Loading…
Reference in New Issue