Consolidate Admin/Modules: 10 single-action controllers into 2

ModulesController: index, show, checkToken, enable, disable
ModuleInstallationController: download, upload, unzip, copy, complete
This commit is contained in:
Darko Gjorgjijoski
2026-04-03 21:16:18 +02:00
parent e9ee74cd01
commit d505677a74
21 changed files with 244 additions and 373 deletions

View File

@@ -60,39 +60,27 @@ class DashboardController extends Controller
}
while ($monthCounter < 12) {
array_push(
$invoice_totals,
Invoice::whereBetween(
'invoice_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_total')
);
array_push(
$expense_totals,
Expense::whereBetween(
'expense_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_amount')
);
array_push(
$receipt_totals,
Payment::whereBetween(
'payment_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_amount')
);
array_push(
$net_income_totals,
($receipt_totals[$i] - $expense_totals[$i])
);
$invoice_totals[] = Invoice::whereBetween(
'invoice_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_total');
$expense_totals[] = Expense::whereBetween(
'expense_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_amount');
$receipt_totals[] = Payment::whereBetween(
'payment_date',
[$start->format('Y-m-d'), $end->format('Y-m-d')]
)
->whereCompany()
->sum('base_amount');
$net_income_totals[] = ($receipt_totals[$i] - $expense_totals[$i]);
$i++;
array_push($months, $start->translatedFormat('M'));
$months[] = $start->translatedFormat('M');
$monthCounter++;
$end->startOfMonth();
$start->addMonth()->startOfMonth();