diff --git a/controllers/StockReportsController.php b/controllers/StockReportsController.php index 0cf0bfcf..78a0ef55 100644 --- a/controllers/StockReportsController.php +++ b/controllers/StockReportsController.php @@ -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';