Attached Files | diff_result.text [^] (630,040 bytes) 2015-02-19 12:15
M_EXPLODEBOMNOTSTOCK2.diff [^] (3,538 bytes) 2015-02-19 12:15 [Show Content] [Hide Content]--- M_EXPLODEBOMNOTSTOCK_OLD.xml 2014-08-29 09:09:21.000000000 +0200
+++ M_EXPLODEBOMNOTSTOCK.xml 2014-09-05 12:40:37.920324892 +0200
@@ -31,6 +31,12 @@
v_PriceList_Version_ID VARCHAR2(32);
v_Record_ID VARCHAR2(32);
v_C_Tax_ID VARCHAR2(32) ;
+ v_IsPackPrice VARCHAR2(32) ;
+ v_PriceList NUMBER:=0;
+ v_PriceActual NUMBER:=0;
+ v_PriceLimit NUMBER:=0;
+ v_LineNetAmt NUMBER:=0;
+
TYPE RECORD IS REF CURSOR;
Cur_Parameter RECORD;
Cur_MPriceListVersion RECORD;
@@ -94,7 +100,7 @@
-- Replace Lines
v_ResultStr:='Inserting lines';
For Cur_Bom_Line In
- (SELECT l.*,o.M_Warehouse_ID as ord_m_warehouse_id,o.C_BPartner_Location_ID as ord_C_BPartner_Location_ID,o.issotrx
+ (SELECT l.*,o.M_Warehouse_ID as ord_m_warehouse_id,o.C_BPartner_Location_ID as ord_C_BPartner_Location_ID,o.issotrx,l.m_product_id
FROM C_ORDERLINE l,c_order o
WHERE l.C_Orderline_ID=v_Record_ID
AND l.c_order_id=o.c_order_id
@@ -125,6 +131,17 @@
CUR_BOM_Line.ord_C_BPartner_Location_ID, null, CUR_BOM_Line.issotrx) ;
v_Line:=v_Line + 1;
+ if(select ispackprice from m_product where m_product_id=Cur_Bom_Line.m_product_id)<>'Y' then
+ v_PriceList = M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID);
+ v_PriceActual = M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID);
+ v_PriceLimit = M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID);
+ v_LineNetAmt = M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty;
+ else
+ v_PriceList = 0;
+ v_PriceActual = 0;
+ v_PriceLimit = 0;
+ v_LineNetAmt = 0;
+ end if;
INSERT
INTO C_ORDERLINE
(
@@ -151,9 +168,8 @@
CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID, CUR_BOM_Line.M_Warehouse_ID, CUR_BOM_Line.DirectShip,
CUR_BOM.C_UOM_ID, CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.QtyReserved*CUR_BOM.BOMQty, CUR_BOM_Line.QtyDelivered*CUR_BOM.BOMQty,
CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, CUR_BOM_Line.M_Shipper_ID, CUR_BOM_Line.C_Currency_ID,
- M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
- M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID), M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
- M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.Discount,
+ v_PriceList,
+ v_PriceActual,v_PriceLimit,v_LineNetAmt,CUR_BOM_Line.Discount,
CUR_BOM_Line.FreightAmt, CUR_BOM_Line.C_Charge_ID, CUR_BOM_Line.ChargeAmt, coalesce(v_C_Tax_ID,CUR_BOM_Line.c_tax_id),
CUR_BOM_Line.QuantityOrder, CUR_BOM_Line.M_Product_UOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
CUR_BOM_Line.c_project_id, CUR_BOM_Line.a_asset_id, CUR_BOM_Line.c_costcenter_id,
M_EXPLODEBOMNOTSTOCK.xml [^] (8,782 bytes) 2015-02-19 12:15 |