webERP Forum

Full Version: Frequently Ordered Items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All
I would like to modify the Frequently Ordered Items to only show results only for the current customer, has anyone done this? I have tried to modify SelectOrderItems.php line 1508
$SixMonthsAgo = DateAdd (Date($_SESSION['DefaultDateFormat']),'m',-6);
Without success.
For all the great work.
Can you try changing the SQL at line 1452 in SelectOrderItems.php to:

$SQL="SELECT stockmaster.units,
SUM(qtyinvoiced) salesqty
FROM `salesorderdetails`INNER JOIN `stockmaster`
ON salesorderdetails.stkcode = stockmaster.stockid
INNER JOIN salesorders
ON salesorders.orderno=salesorderdetails.orderno
WHERE ActualDispatchDate >= '" . FormatDateForSQL($SixMonthsAgo) . "'
AND salesorders.debtorno='" . $_SESSION['Items'.$identifier]->DebtorNo . "'
GROUP BY stkcode
ORDER BY salesqty DESC
LIMIT " . $_SESSION['FrequentlyOrderedItems'];

This should show the frequently ordered items just for the selected customer but I haven't tested this so can you let me know if it works?

Thanks For the help
worked great.