webERP Forum

Full Version: PO From Stock - Wrong PurchData
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
SelectProduct.php
PO_Items.php

When clicking on "Order" hyperlink new PO does not use latest pricing from PurchData table. In example below we have new pricing coming into effect today and the code uses the old price.

In the example below the top entry went into effect this morning:

[attachment=762]

I revised the SQL and added the following:

Code:
    AND DATEDIFF(NOW(), purchdata.effectivefrom) >= 0
    ORDER BY purchdata.effectivefrom DESC
    LIMIT 1";

I think we should add effectivedate to the Stock purch data area table as well.

[attachment=763]