details:   /erp/devel/pi/rev/d175cba664f5
changeset: 11384:d175cba664f5
user:      Adrián Romero <adrianromero <at> openbravo.com>
date:      Mon Mar 28 18:13:13 2011 +0200
summary:   Fixes issue 0016521: Wrong quantity in Suggested Purchase Order when 
running Purchasing Plan
It has been added the missing instruction so set the old needed quantity in all 
cases

diffstat:

 src-db/database/model/functions/MRP_PURCHASEPLAN.xml |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r b21894a52a3a -r d175cba664f5 
src-db/database/model/functions/MRP_PURCHASEPLAN.xml
--- a/src-db/database/model/functions/MRP_PURCHASEPLAN.xml      Mon Mar 28 
16:57:30 2011 +0200
+++ b/src-db/database/model/functions/MRP_PURCHASEPLAN.xml      Mon Mar 28 
18:13:13 2011 +0200
@@ -142,8 +142,6 @@
                                                                   ELSE 
CEIL(v_Qty_new/Cur_PlanProduct.CAPACITY)
                                                                   END)));
             Mrp_Run_Insertlines(p_Client_ID, p_Org_ID, p_User_ID, p_Run_ID, 
Cur_PlanProduct.M_Product_ID, v_qty_new, v_neededqty_new, NULL, 'PP', 'Y', 
NULL, NULL, NULL, NULL, NULL, v_Planneddate_new, v_plannedorderdate_new, 'N', 
'N', Cur_PlanProduct.Vendor_ID, v_Aux_new);
-            v_neededqty_old := v_neededqty_new;
-            v_qty_old := v_qty_new;
             v_stock := v_stock + v_qty_new;
           ELSE
             v_neededqty_new := v_neededqty_new + COALESCE(v_neededqty_old,0);
@@ -166,8 +164,9 @@
                 plannedorderdate = v_plannedorderdate_new
             WHERE MRP_RUN_PURCHASELINE_ID = v_Aux_new;
             v_stock := v_stock + v_qty_new - v_qty_old;
-            v_qty_old := v_qty_new;
           END IF;
+          v_neededqty_old := v_neededqty_new;
+          v_qty_old := v_qty_new;
         END IF;
 
         v_stock := v_stock + Cur_Lines.qty;

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and publish 
your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to