Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0013816 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 06. Material requirement planning (MRP) | major | always | 2010-06-28 18:20 | 2010-09-07 10:18 | |||
Reporter | networkb | View Status | public | |||||
Assigned To | sivaraman | |||||||
Priority | urgent | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | pi | Fixed in SCM revision | c358c1e82f10 | |||
Projection | none | ETA | none | Target Version | 2.50MP20 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | 2.50MP18 | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | ||||||||
OBNetwork customer | OBPS | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0013816: error when processing purchasing plan indicating Business Partner and Product Category. | |||||||
Description | When you define a Purchasing Plan with Business Partner and Product Category, products taken into account are not properly filtered | |||||||
Steps To Reproduce | 1.Material Requirement (MRP) || Setup || Planning Method || Header: create record. Go lines and create record: transaction type=pending sales order Weighting=1 2.Master Data Management || Product || Product >> Org Specific of Beer product and create record: panning method= your_planning_method Min. Quantity=1 Safety Stock=1 3. Sales Management || Transactions || Sales Order || Header:create SO for Mcgiver with Scheduled Delivery Date=28/07/2010 Go to Lines and set product=hat and qty=20 Process SO. 4. Material Requirement (MRP) || Transactions || Purchasing Plan || Header: document date= 28-06-2010 time horizon=60 bp=mcgiver product category=food and run "Process Purchase Plan" Go to Lines and realize that product Beer has been taken into account when it shouldn't , because there is no pending Sales Order for any product of Food category | |||||||
Proposed Solution | Having a look at the code, the following change is required in function mrp_run_initialize: FOR Cur_Product IN (SELECT p.M_Product_ID, COALESCE(sd.qtyonhand,0) AS qtyonhand, COALESCE(po.STOCKMIN, p.STOCKMIN, 0) AS STOCKMIN, COALESCE(po.MRP_PlanningMethod_ID, p.MRP_PlanningMethod_ID) AS MRP_PlanningMethod_ID FROM M_PRODUCT p LEFT JOIN M_PRODUCT_ORG po ON p.M_PRODUCT_ID = po.M_PRODUCT_ID AND po.AD_ORG_ID = p_Org_ID LEFT JOIN (SELECT M_Product_ID, SUM(qtyonhand) as qtyonhand FROM M_STORAGE_DETAIL GROUP BY M_Product_ID) sd ON p.M_Product_ID = sd.M_Product_ID WHERE (p_product_ID IS NULL OR p.M_PRODUCT_ID = p_Product_ID) AND (p_product_ID IS NULL OR p.ISACTIVE = 'Y') AND (p_Product_Category_ID IS NULL OR p.M_PRODUCT_CATEGORY_ID = p_Product_Category_ID) AND (p_Planner_ID IS NULL OR COALESCE(po.MRP_PLANNER_ID, p.MRP_Planner_ID) = p_Planner_ID) AND Ad_Isorgincluded(p_Org_ID, p.AD_ORG_ID, p_Client_ID) > -1 AND p.AD_Client_ID = p_Client_ID AND ((p_Production = 'Y' AND p.ISPURCHASED = 'N') OR (p_Production = 'N' AND p.ISPURCHASED = 'Y')) AND (p_Production = 'Y' OR (p_Vendor_ID IS NULL OR EXISTS (SELECT 1 FROM M_PRODUCT_PO WHERE M_PRODUCT_PO.M_PRODUCT_ID = p.M_PRODUCT_ID AND M_PRODUCT_PO.C_BPARTNER_ID = p_Vendor_ID AND M_PRODUCT_PO.ISCURRENTVENDOR = 'Y' AND M_PRODUCT_PO.ISACTIVE = 'Y' ))) AND (p_BPartner_ID IS NULL OR EXISTS (SELECT 1 FROM C_ORDER o, C_ORDERLINE ol WHERE o.C_ORDER_ID = ol.C_ORDER_ID AND o.C_BPARTNER_ID = p_BPartner_ID AND o.IsSOTrx = 'Y' --AND C_Order_Status(o.C_ORDER_ID) IN (1, 2, 3) AND o.PROCESSED = 'Y' AND ol.QTYORDERED <> ol.QTYDELIVERED AND ol.m_product_id=p.m_product_id AND ol.DatePromised IS NOT NULL AND Mrp_Check_Planningmethod( COALESCE(po.MRP_PlanningMethod_ID, p.MRP_PlanningMethod_ID), 'SO', TO_NUMBER(ol.DatePromised - p_PlanningDate), p_TimeHorizon) <> -1 AND Ad_Isorgincluded(o.AD_ORG_ID, p_Org_ID, p_Client_ID) > -1) OR EXISTS (SELECT 1 FROM MRP_SALESFORECAST sf, MRP_SALESFORECASTLINE sfl WHERE sf.MRP_SALESFORECAST_ID = sfl.MRP_SALESFORECAST_ID AND sf.IsActive = 'Y' AND sf.C_BPARTNER_ID = p_BPartner_ID AND sfl.m_product_id=p.m_product_id AND Mrp_Check_Planningmethod( COALESCE(po.MRP_PlanningMethod_ID, p.MRP_PlanningMethod_ID), 'SF', TO_NUMBER(sfl.DatePlanned - p_PlanningDate), p_TimeHorizon) <> -1 AND Ad_Isorgincluded(sf.AD_ORG_ID, p_Org_ID, p_Client_ID) > -1) ) AND (p_BP_Group_ID IS NULL OR EXISTS(SELECT 1 FROM C_ORDER o, C_ORDERLINE ol, C_BPARTNER bp WHERE o.C_ORDER_ID = ol.C_ORDER_ID AND o.C_BPartner_ID = bp.C_BPartner_ID AND o.IsSOTrx = 'Y' AND bp.C_BP_Group_ID = p_BP_Group_ID --AND C_Order_Status(o.C_ORDER_ID) IN (1, 2, 3) AND o.PROCESSED = 'Y' AND ol.QTYORDERED <> ol.QTYDELIVERED AND ol.DatePromised IS NOT NULL AND Mrp_Check_Planningmethod( COALESCE(po.MRP_PlanningMethod_ID, p.MRP_PlanningMethod_ID), 'SO', TO_NUMBER(ol.DatePromised - p_PlanningDate), p_TimeHorizon) <> -1 AND Ad_Isorgincluded(o.AD_ORG_ID, p_Org_ID, p_Client_ID) > -1) OR EXISTS (SELECT 1 FROM MRP_SALESFORECAST sf, MRP_SALESFORECASTLINE sfl, C_BPARTNER bp WHERE sf.MRP_SALESFORECAST_ID = sfl.MRP_SALESFORECAST_ID AND sf.IsActive = 'Y' AND sf.C_BPartner_ID = bp.C_BPartner_ID AND bp.C_BP_Group_ID = p_BP_Group_ID AND Mrp_Check_Planningmethod( COALESCE(po.MRP_PlanningMethod_ID, p.MRP_PlanningMethod_ID), 'SF', TO_NUMBER(sfl.DatePlanned - p_PlanningDate), p_TimeHorizon) <> -1 AND Ad_Isorgincluded(sf.AD_ORG_ID, p_Org_ID, p_Client_ID) > -1) ) ) LOOP ... ... where AND ol.m_product_id=p.m_product_id and AND sfl.m_product_id=p.m_product_id clauses have been added | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0029253) hgbot (developer) 2010-07-13 12:29 |
Repository: erp/devel/pi Changeset: c358c1e82f105cbf3fe234df292bcb481bf81a8d Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com> Date: Tue Jul 13 15:58:25 2010 +0530 URL: http://code.openbravo.com/erp/devel/pi/rev/c358c1e82f105cbf3fe234df292bcb481bf81a8d [^] Fixes issue 13816: error when processing purchasing plan indicating Business Partner and Product Category Two new AND clause has been introduced in order to make sure the lines created are belongs to the selected product category --- M src-db/database/model/functions/MRP_RUN_INITIALIZE.xml --- |
(0029254) sivaraman (viewer) 2010-07-13 12:36 |
Steps to test: 1.Material Requirement (MRP) || Setup || Planning Method || Header: create record. Go lines and create record: transaction type=pending sales order Weighting=1 2.Master Data Management || Product || Product >> Org Specific of Beer product and create record: panning method= your_planning_method Min. Quantity=1 Safety Stock=1 3.Sales Management || Transactions || Sales Order || Header:create SO for Mcgiver with Scheduled Delivery Date=28/07/2010 Go to Lines and set product=hat and qty=20 Process Sales Order 4.Material Requirement (MRP) || Transactions || Purchasing Plan || Header: document date= 28-06-2010 time horizon=60 bp=mcgiver product category=food Business Partner Category=null 5.Run "Process Purchase Plan" and verify if no lines created |
(0029294) hudsonbot (viewer) 2010-07-14 04: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/c358c1e82f10 [^] Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/2a91111beef4 [^] Tests: http://builds.openbravo.com/view/int/ [^] OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17878.obx [^] |
(0029494) sureshbabu (viewer) 2010-07-23 09:28 |
verified.. |
(0030638) gorkaion (viewer) 2010-09-06 12:21 |
The clauses have been added to the bpartner case, but not for the bp_group not null case. |
![]() |
|||
Date Modified | Username | Field | Change |
2010-06-28 18:20 | networkb | New Issue | |
2010-06-28 18:20 | networkb | Assigned To | => adrianromero |
2010-06-28 18:20 | networkb | OBNetwork customer | => Yes |
2010-07-05 13:31 | adrianromero | Status | new => scheduled |
2010-07-05 13:31 | adrianromero | fix_in_branch | => pi |
2010-07-13 12:11 | sivaraman | Assigned To | adrianromero => sivaraman |
2010-07-13 12:29 | hgbot | Checkin | |
2010-07-13 12:29 | hgbot | Note Added: 0029253 | |
2010-07-13 12:29 | hgbot | Status | scheduled => resolved |
2010-07-13 12:29 | hgbot | Resolution | open => fixed |
2010-07-13 12:29 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/c358c1e82f105cbf3fe234df292bcb481bf81a8d [^] |
2010-07-13 12:36 | sivaraman | Note Added: 0029254 | |
2010-07-14 04:44 | hudsonbot | Checkin | |
2010-07-14 04:44 | hudsonbot | Note Added: 0029294 | |
2010-07-23 09:28 | sureshbabu | Note Added: 0029494 | |
2010-07-23 09:28 | sureshbabu | Status | resolved => closed |
2010-07-24 00:00 | anonymous | sf_bug_id | 0 => 3033804 |
2010-09-06 12:21 | gorkaion | Note Added: 0030638 | |
2010-09-06 12:21 | gorkaion | Status | closed => new |
2010-09-06 12:21 | gorkaion | Resolution | fixed => open |
2010-09-07 10:18 | gorkaion | Issue cloned | 0014455 |
2010-09-07 10:18 | gorkaion | Relationship added | related to 0014455 |
2010-09-07 10:18 | gorkaion | Status | new => closed |
2010-09-07 10:18 | gorkaion | Resolution | open => fixed |
Copyright © 2000 - 2009 MantisBT Group |