Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012997Openbravo ERP05. Production managementpublic2010-04-15 09:492010-05-18 21:44
networkb 
sivaraman 
normalminorhave not tried
closedfixed 
5
2.50MP14 
2.50MP17 
Core
No
0012997: The callout associated to the Process Quantity field on the work requirement header should not round the quantity
The callout associated to the Process Quantity field on the work requirement header should not round the quantity.
The quantity is rounded when it should be rounded if the product is defined
in the "Org specific" tab as exact.
This behaviour is correct in MRP but not in the workrequirement window.
see the file attached to know how to configure the process plan to get this error.
No tags attached.
doc stepts_to_reproduct.doc (949,760) 2010-04-15 09:49
https://issues.openbravo.com/file_download.php?file_id=2443&type=bug
Issue History
2010-04-15 09:49networkbNew Issue
2010-04-15 09:49networkbAssigned To => adrianromero
2010-04-15 09:49networkbFile Added: stepts_to_reproduct.doc
2010-04-15 11:23adrianromeroStatusnew => scheduled
2010-04-15 11:23adrianromerofix_in_branch => pi
2010-05-06 17:20adrianromeroNote Added: 0026997
2010-05-07 12:44adrianromeroNote Added: 0027045
2010-05-10 07:22sivaramanAssigned Toadrianromero => sivaraman
2010-05-10 07:29hgbotCheckin
2010-05-10 07:29hgbotNote Added: 0027082
2010-05-10 07:29hgbotStatusscheduled => resolved
2010-05-10 07:29hgbotResolutionopen => fixed
2010-05-10 07:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9745eaee4d2af985749e2cc927c863c303de47b9 [^]
2010-05-10 07:53sivaramanNote Added: 0027083
2010-05-10 13:59adrianromeroNote Added: 0027101
2010-05-11 18:19jpabloaeTarget Version2.50MP16 => 2.50MP17
2010-05-14 12:13sureshbabuNote Added: 0027235
2010-05-14 12:36sureshbabuNote Added: 0027240
2010-05-14 12:36sureshbabuStatusresolved => closed
2010-05-15 00:00anonymoussf_bug_id0 => 3001854
2010-05-18 21:44hudsonbotCheckin
2010-05-18 21:44hudsonbotNote Added: 0027506

Notes
(0026997)
adrianromero   
2010-05-06 17:20   
The callout associated is:org.openbravo.erpCommon.ad_callouts.SL_WorkRequirement_Conversion

Here you can see that the quantity is always rounded:
quantity = secondaryQty.divide(convRate, 0, BigDecimal.ROUND_HALF_UP);

It should be rounded only if the associated product is defined in the "Org specific" tab as exact. Otherwise it should not be rounded

In any case, the solution must be discussed with GDA
(0027045)
adrianromero   
2010-05-07 12:44   
In this specific case, the quantity must be always rounded to the next positive integer because the number of processes cannot be decimal.

So the rounding to use must be:
quantity = secondaryQty.divide(convRate, 0, BigDecimal.ROUND_CEILING );
(0027082)
hgbot   
2010-05-10 07:29   
Repository: erp/devel/pi
Changeset: 9745eaee4d2af985749e2cc927c863c303de47b9
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Mon May 10 10:58:26 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/9745eaee4d2af985749e2cc927c863c303de47b9 [^]

Fixes issue 12997: The Process Quantity callout should not round the quantity in work requirement window

---
M src/org/openbravo/erpCommon/ad_callouts/SL_WorkRequirement_Conversion.java
---
(0027083)
sivaraman   
2010-05-10 07:53   
Steps to test:
Kindly follow all the steps as given in the 'Steps To Reproduce' section

Root cause and solution:
As the quantity cannot be decimal in this case, it has been rounded to the next positive integer in it's corresponding callout class (SL_WorkRequirement_Conversion).

Impact:
It has been verified that the fix meets the expected result as described by adrian without any other impact.
(0027101)
adrianromero   
2010-05-10 13:59   
To perform the same rounding in the MRP process the following steps have to be done to fix it properly:

There will be needed to modify the PL/SQL MRP_PROCESSPLAN_PLAN.

There is needed to modify the SQL query of the cursor Cur_Lines adding the view MA_PROCESSPLAN_TOTALIZED and joining using M_PRODUCT.MA_PROCESSPLAN_ID = MA_PROCESSPLAN_TOTALIZED.MA_PROCESSPLAN_ID AND M_PRODUCT.M_PRODUCT_ID = MA_PROCESSPLAN_TOTALIZED.PRODUCED

This way you get the value PRODQTY and you can round the new quantity this way:

 v_Qty_new := CEIL(v_qty_new/Cur_Lines.proqty)*Cur_Lines.proqty

Before the line

v_plannedorderdate_new := .....
(0027235)
sureshbabu   
2010-05-14 12:13   
@ siva can you update the steps to reproduce
(0027240)
sureshbabu   
2010-05-14 12:36   
i am closing the issue, since the process needs to be whole number
(0027506)
hudsonbot   
2010-05-18 21:44   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/9745eaee4d2a [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/aa11838d5f80 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17380.obx [^]