update reports
This commit is contained in:
parent
d4f9a4496f
commit
c24fdab770
@ -119,8 +119,8 @@ $expenseSales = $expenseCatStmt->fetchAll();
|
||||
// Total Summary
|
||||
$totalStmt = $pdo->prepare("
|
||||
SELECT
|
||||
COUNT(id) as total_orders,
|
||||
SUM(total_amount) as total_revenue
|
||||
COUNT(o.id) as total_orders,
|
||||
SUM(o.total_amount) as total_revenue
|
||||
FROM orders o
|
||||
WHERE DATE(o.created_at) BETWEEN ? AND ?
|
||||
AND o.status != 'cancelled'
|
||||
@ -130,9 +130,9 @@ $totalStmt->execute($queryParams);
|
||||
$summary = $totalStmt->fetch();
|
||||
|
||||
$totalExpStmt = $pdo->prepare("
|
||||
SELECT SUM(amount) as total_expenses
|
||||
SELECT SUM(e.amount) as total_expenses
|
||||
FROM expenses e
|
||||
WHERE expense_date BETWEEN ? AND ?
|
||||
WHERE e.expense_date BETWEEN ? AND ?
|
||||
$expenseOutletCondition
|
||||
");
|
||||
$totalExpStmt->execute($queryParams);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user