Fix SQL query

This commit is contained in:
Daniel Reinoso 2024-10-25 17:49:06 -03:00
parent 83c1cf0160
commit be513122fa

View File

@ -14,12 +14,12 @@ class StockReportsController extends BaseController
{
$startDate = $request->getQueryParams()['start_date'];
$endDate = $request->getQueryParams()['end_date'];
$where = " AND pph.purchased_date BETWEEN '$startDate' AND '$endDate'";
$where .= " AND pph.purchased_date BETWEEN '$startDate' AND '$endDate'";
}
else
{
// Default to this month
$where = " AND pph.purchased_date >= DATE(DATE('now', 'localtime'), 'start of month')";
$where .= " AND pph.purchased_date >= DATE(DATE('now', 'localtime'), 'start of month')";
}
$groupBy = 'product';