Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016105Openbravo ERP06. Material requirement planning (MRP)public2011-03-02 13:372011-04-04 12:19
maite 
adrianromero 
urgentmajoralways
closedfixed 
5
2.50MP26 
2.50MP28 
Core
No
0016105: Wrong quantity in Suggested Purchase Order when running Purchasing Plan
Wrong quantity in Suggested Purchase Order when running Purchasing Plan: Quantity of suggested purchase order should be sum of quantities of pending sales order
1. Master Data Management || Product || Product : search for Hammer
2. Master Data Management || Product || Product >> Purchasing : add record for Mcgiver with "current vendor " checked
3. Master Data Management || Product || Product >> Org Specific : add record for Main and Capacity=10000 and Safety Stock=0
4. Warehouse Management || Transactions || Physical Inventory || Header : set stock for hammers to 0 units
5. Material Requirement (MRP) || Transactions || Purchasing Plan || Header : create record for
  - Main
  - 02/03/2011
  - time horizon=10
  - safety = 0
  - vendor= mcgiver
  - product=hammer
Material Requirement (MRP) || Transactions || Purchasing Plan || Header >> Lines : add lines
  - line1: hammer + quantities= 0 + dates=02/03/2011 + type= Stock + fixed=Y
  - line2: hammer + quantities= 0 + dates=02/03/2011 + type= MinStock + fixed=Y
  - line3: hammer + quantities= -5 + dates=02/03/2011 + type= PendingSalesOrder + fixed=Y
  - line4: hammer + quantities= -3 + dates=02/03/2011 + type= PendingSalesOrder + fixed=Y
  - line5: hammer + quantities= -2 + dates=02/03/2011 + type= PendingSalesOrder + fixed=Y
6. Come back to Purchasing Plan header and press"Process Purchase Plan". Relize that line of type "Suggested Purchase Order" has Quantity different from 10 (which is sum of 5+3+2)
in line 139 of function mrp_purchaseplan should be added
v_neededqty_old := v_neededqty_new;
because actually this variable only is being updated when executing "IF" clause but not "ELSE" clause.

As same block:
v_neededqty_old := v_neededqty_new;
v_qty_old := v_qty_new;
v_stock := v_stock + v_qty_new;
will be executed in IF and ELSE they can be put outside
No tags attached.
depends on defect 0016521 closed adrianromero Wrong quantity in Suggested Purchase Order when running Purchasing Plan 
Issue History
2011-03-02 13:37maiteNew Issue
2011-03-02 13:37maiteAssigned To => adrianromero
2011-03-02 13:37maiteModules => Core
2011-03-02 13:37maiteIssue Monitored: networkb
2011-03-28 18:10adrianromeroStatusnew => scheduled
2011-03-28 18:10adrianromeroTypedefect => backport
2011-03-28 18:10adrianromeroIssue cloned0016521
2011-03-28 18:10adrianromeroRelationship addeddepends on 0016521
2011-03-28 18:11adrianromeroNote Added: 0035282
2011-04-01 12:33hgbotCheckin
2011-04-01 12:33hgbotNote Added: 0035453
2011-04-01 12:33hgbotStatusscheduled => resolved
2011-04-01 12:33hgbotResolutionopen => fixed
2011-04-01 12:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.50/rev/6bfb0bb2a95878c3383fe2165132596b03959b1a [^]
2011-04-04 12:19maiteNote Added: 0035524
2011-04-04 12:19maiteStatusresolved => closed

Notes
(0035282)
adrianromero   
2011-03-28 18:11   
Fixed. Pending to push the changes when repo is unfrozen.
(0035453)
hgbot   
2011-04-01 12:33   
Repository: erp/stable/2.50
Changeset: 6bfb0bb2a95878c3383fe2165132596b03959b1a
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Mar 28 18:10:13 2011 +0200
URL: http://code.openbravo.com/erp/stable/2.50/rev/6bfb0bb2a95878c3383fe2165132596b03959b1a [^]

Fixes issue 0016105: 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

---
M src-db/database/model/functions/MRP_PURCHASEPLAN.xml
---
(0035524)
maite   
2011-04-04 12:19   
verified