parent
7220170fed
commit
f8eefb43c5
|
|
@ -1,5 +1,6 @@
|
||||||
package andromedia.midsuit.process;
|
package andromedia.midsuit.process;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.adempiere.exceptions.AdempiereException;
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
|
|
@ -156,12 +157,16 @@ public class MID_TPBUpdateOrder extends SvrProcess{
|
||||||
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
|
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
|
||||||
ol.setQty(detailLine.getQty());
|
ol.setQty(detailLine.getQty());
|
||||||
|
|
||||||
if(detailLine.getM_Product().getC_UOM_ID() != detailLine.getC_UOM_ID())
|
if(detailLine.getM_Product().getC_UOM_ID() != detailLine.getC_UOM_ID()) {
|
||||||
ol.setQtyOrdered(MUOMConversion.convertProductFrom(Env.getCtx(), detailLine.getM_Product_ID(), detailLine.getC_UOM_ID(), detailLine.getQty()));
|
ol.setQtyOrdered(MUOMConversion.convertProductFrom(Env.getCtx(), detailLine.getM_Product_ID(), detailLine.getC_UOM_ID(), detailLine.getQty()));
|
||||||
|
ol.setPriceEntered(detailLine.getPriceActual());
|
||||||
ol.setPriceList(detailLine.getPriceList());
|
ol.setPriceActual(detailLine.getPriceActual().divide(ol.getQtyOrdered(),10,BigDecimal.ROUND_DOWN));
|
||||||
ol.setDiscount(detailLine.getDiscount());
|
ol.setPriceList(detailLine.getPriceActual().divide(ol.getQtyOrdered(),10,BigDecimal.ROUND_DOWN));
|
||||||
|
}else {
|
||||||
ol.setPrice(detailLine.getPriceActual());
|
ol.setPrice(detailLine.getPriceActual());
|
||||||
|
ol.setPriceList(detailLine.getPriceList());
|
||||||
|
}
|
||||||
|
ol.setDiscount(detailLine.getDiscount());
|
||||||
ol.setC_Tax_ID(reqLine.get_ValueAsInt("C_Tax_ID"));
|
ol.setC_Tax_ID(reqLine.get_ValueAsInt("C_Tax_ID"));
|
||||||
ol.set_ValueNoCheck("M_Requistion_ID", line.getM_Requisition_ID());
|
ol.set_ValueNoCheck("M_Requistion_ID", line.getM_Requisition_ID());
|
||||||
ol.set_ValueNoCheck("M_RequisitionLine_ID", detailLine.getM_RequisitionLine_ID());
|
ol.set_ValueNoCheck("M_RequisitionLine_ID", detailLine.getM_RequisitionLine_ID());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package andromedia.midsuit.process;
|
package andromedia.midsuit.process;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.adempiere.exceptions.AdempiereException;
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
|
|
@ -147,8 +148,15 @@ public class MID_TPBUpdateOrderLine extends SvrProcess{
|
||||||
ol.setM_Product_ID(detailLine.getM_Product_ID());
|
ol.setM_Product_ID(detailLine.getM_Product_ID());
|
||||||
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
|
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
|
||||||
ol.setQty(detailLine.getQty());
|
ol.setQty(detailLine.getQty());
|
||||||
if(detailLine.getM_Product().getC_UOM_ID() != detailLine.getC_UOM_ID())
|
if(detailLine.getM_Product().getC_UOM_ID() != detailLine.getC_UOM_ID()) {
|
||||||
ol.setQtyOrdered(MUOMConversion.convertProductFrom(Env.getCtx(), detailLine.getM_Product_ID(), detailLine.getC_UOM_ID(), detailLine.getQty()));
|
ol.setQtyOrdered(MUOMConversion.convertProductFrom(Env.getCtx(), detailLine.getM_Product_ID(), detailLine.getC_UOM_ID(), detailLine.getQty()));
|
||||||
|
ol.setPriceEntered(detailLine.getPriceActual());
|
||||||
|
ol.setPriceActual(detailLine.getPriceActual().divide(ol.getQtyOrdered(),3,BigDecimal.ROUND_DOWN));
|
||||||
|
ol.setPriceList(detailLine.getPriceActual().divide(ol.getQtyOrdered(),3,BigDecimal.ROUND_DOWN));
|
||||||
|
}else {
|
||||||
|
ol.setPrice(detailLine.getPriceActual());
|
||||||
|
ol.setPriceList(detailLine.getPriceList());
|
||||||
|
}
|
||||||
ol.setPriceList(detailLine.getPriceList());
|
ol.setPriceList(detailLine.getPriceList());
|
||||||
ol.setDiscount(detailLine.getDiscount());
|
ol.setDiscount(detailLine.getDiscount());
|
||||||
ol.setC_Tax_ID(reqLine.get_ValueAsInt("C_Tax_ID"));
|
ol.setC_Tax_ID(reqLine.get_ValueAsInt("C_Tax_ID"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue