webERP Forum

Full Version: MRP calculation bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I found this bug in MRP calculation when a Purchase order status is actually complete but if the received quantity is less than ordered quantity it was taking this quantity into account while calculating MRPsupplies.

I changed the sql to as below at line 372 in MRP.php.

$sql = "INSERT INTO mrpsupplies (id,
part,
duedate,
supplyquantity,
ordertype,
orderno,
mrpdate,
updateflag)
SELECT Null,
purchorderdetails.itemcode,
purchorderdetails.deliverydate,
(quantityord - quantityrecd) AS netqty,
'PO',
purchorderdetails.orderno,
purchorderdetails.deliverydate,
0
FROM purchorderdetails,
purchorders
WHERE purchorderdetails.orderno = purchorders.orderno
AND purchorders.status != 'Cancelled'
AND purchorders.status != 'Rejected'
AND purchorders.status != 'Completed'
AND(quantityord - quantityrecd) > 0";


This may already have been done in the commit but if not, then somebody please commit this.

Thanks
Hi,

Thank you for your report. I commit your fix to the trunk and add a new lines check purchorderdetails.completed=0 to ensure same problem happen.

Best regards!

Exson
Reference URL's