update on psosale string 1 bugs
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m15s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Successful in 36s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-18 22:47:24 +07:00
parent 2173c3ee81
commit 6319d4c6cb
4 changed files with 19 additions and 4 deletions

View File

@@ -187,9 +187,9 @@ public function dashboard()
$data = [
'total_expense' => (float) $expense_amount,
'total_income' => (float) $income_amount + $sale_profit,
'total_items' => Product::where('business_id', $business_id)->count(),
'total_categories' => Category::where('business_id', $business_id)->count(),
'stock_value' => $total_stock_value,
'total_items' => (int) Product::where('business_id', $business_id)->count(),
'total_categories' => (int) Category::where('business_id', $business_id)->count(),
'stock_value' => (float) $total_stock_value,
'total_due' => (float) Sale::where('business_id', $business_id)->whereBetween('saleDate', [$start, $end])->sum('dueAmount'),
'total_profit' => (float) Sale::where('business_id', $business_id)->whereBetween('created_at', [$start, $end])->where('lossProfit', '>', 0)->sum('lossProfit'),
'total_loss' => (float) Sale::where('business_id', $business_id)->whereBetween('created_at', [$start, $end])->where('lossProfit', '<', 0)->sum('lossProfit'),