@php use App\Support\SidebarMenu; $user = Auth::user(); $greenBeanLinks = []; $beverageLinks = []; $accountingGroups = []; $accountingDirectLinks = []; if (SidebarMenu::can($user, 'hopecoffee.menu')) { // Green bean — daily intake → payment desk → processing SidebarMenu::push(SidebarMenu::link($user, 'GRN', 'add.grn.form', 'grn.add'), $greenBeanLinks); SidebarMenu::push(SidebarMenu::link($user, 'Batch reports', 'all.batch.reports', 'batch_reports.view'), $greenBeanLinks); SidebarMenu::push(SidebarMenu::link($user, 'Stock processing', 'coffee.processing.index', 'coffee_processing_factory.view'), $greenBeanLinks); SidebarMenu::push(SidebarMenu::link($user, 'Stock summary', 'all.coffee.stock', 'coffee_stock.view'), $greenBeanLinks); // Beverage — production floor workflow if (SidebarMenu::can($user, 'roast.create')) { SidebarMenu::push(SidebarMenu::link($user, 'Roast', 'stock.transfers.roast.form', 'roast.create'), $beverageLinks); SidebarMenu::push(SidebarMenu::link($user, 'Grind', 'roastings.grind.form', 'roast.create'), $beverageLinks); SidebarMenu::push(SidebarMenu::link($user, 'Package', 'stock.transfers.package.form', 'roast.create'), $beverageLinks); SidebarMenu::push(SidebarMenu::link($user, 'POS', 'beverage.sales.create', 'roast.create'), $beverageLinks); SidebarMenu::push(SidebarMenu::link($user, 'Inventory report', 'beverage.inventory.report', 'roast.create'), $beverageLinks); } // Accounting — operations first, then ledger and compliance $inventoryLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Payment vouchers', 'all.payment.vouchers', 'payment_valuation_final.view'), $inventoryLinks); SidebarMenu::push(SidebarMenu::link($user, 'Sales', 'coffee.sales.index', 'coffee_sales.view'), $inventoryLinks); SidebarMenu::push(SidebarMenu::link($user, 'Stock processing', 'coffee.processing.index', 'coffee_processing.view'), $inventoryLinks); SidebarMenu::push(SidebarMenu::link($user, 'Stock transfer', 'stock.transfers.index', 'stock_transfer.view'), $inventoryLinks); SidebarMenu::push(SidebarMenu::link($user, 'Stock summary', 'all.coffee.stock', 'coffee_stock.view'), $inventoryLinks); if ($inventoryLinks) { $accountingGroups[] = ['title' => 'Inventory / COGS', 'icon' => 'bx bx-basket', 'links' => $inventoryLinks]; } $receivableLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Receipts', 'payments.index', 'invoices.view'), $receivableLinks); SidebarMenu::push(SidebarMenu::link($user, 'Advances', 'all.advances', 'advances.view'), $receivableLinks); if ($receivableLinks) { $accountingGroups[] = ['title' => 'Receivables', 'icon' => 'bx bx-receipt', 'links' => $receivableLinks]; } $cashLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Bank accounts', 'bank.accounts.index', 'bank.view'), $cashLinks); SidebarMenu::push(SidebarMenu::link($user, 'Bank statement', 'bank.reconciliation.index', 'bank.reconcile'), $cashLinks); SidebarMenu::push(SidebarMenu::link($user, 'Bank reconciliation', 'reconciliation.index', 'bank.reconcile'), $cashLinks); SidebarMenu::push(SidebarMenu::safeLink($user, 'Cash transfers', 'cash.transfer', 'cash.transfer'), $cashLinks); if ($cashLinks) { $accountingGroups[] = ['title' => 'Cash & bank', 'icon' => 'bx bx-wallet', 'links' => $cashLinks]; } $ledgerLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Chart of accounts', 'all.accounts', 'accounts.view'), $ledgerLinks); SidebarMenu::push(SidebarMenu::link($user, 'Journal entries', 'journals.index', 'journals.view'), $ledgerLinks); SidebarMenu::push(SidebarMenu::link($user, 'Balance check', 'balance.check', 'balance_check.view'), $ledgerLinks); SidebarMenu::push(SidebarMenu::link($user, 'GP voucher', 'general.vouchers.index', 'general.vouchers.view'), $ledgerLinks); SidebarMenu::push(SidebarMenu::link($user, 'General journal', 'general.journals.index', 'general.journals.view'), $ledgerLinks); if ($ledgerLinks) { $accountingGroups[] = ['title' => 'General ledger', 'icon' => 'bx bx-book', 'links' => $ledgerLinks]; } $assetLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Asset register', 'fixed-assets.index', 'fixed.view'), $assetLinks); SidebarMenu::push(SidebarMenu::link($user, 'Depreciation runs', 'fixed-assets.depreciation.index', 'fixed.view'), $assetLinks); if ($assetLinks) { $accountingGroups[] = ['title' => 'Fixed assets', 'icon' => 'bx bx-buildings', 'links' => $assetLinks]; } SidebarMenu::push(SidebarMenu::link($user, 'Payroll', 'payroll.index', 'payroll.view'), $accountingDirectLinks); SidebarMenu::push(SidebarMenu::link($user, 'Budgets & forecasts', 'budgets.index', 'budgets.view'), $accountingDirectLinks); $taxLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'Tax rates', 'tax.rates.index', 'tax.manage'), $taxLinks); SidebarMenu::push(SidebarMenu::link($user, 'Withholding tax', 'tax.withholding.index', 'tax.view'), $taxLinks); SidebarMenu::push(SidebarMenu::link($user, 'Tax provisions', 'tax.provision.index', 'tax.view'), $taxLinks); if ($taxLinks) { $accountingGroups[] = ['title' => 'Tax', 'icon' => 'bx bx-calculator', 'links' => $taxLinks]; } $financialReportLinks = []; SidebarMenu::push(SidebarMenu::link($user, 'P&L / balance sheet', 'hc.reports.index', 'reports.view'), $financialReportLinks); if ($financialReportLinks) { $accountingGroups[] = ['title' => 'Financial reports', 'icon' => 'bx bx-bar-chart-square', 'links' => $financialReportLinks]; } } $hasAccounting = $accountingGroups || $accountingDirectLinks; $hasHopeCoffee = $hasAccounting || $greenBeanLinks || $beverageLinks; @endphp @if ($hasHopeCoffee) @if ($greenBeanLinks) @include('admin.body.partials.menu-group', [ 'title' => 'Green bean', 'icon' => 'bx bx-basket', 'links' => $greenBeanLinks, ]) @endif @if ($beverageLinks) @include('admin.body.partials.menu-group', [ 'title' => 'Beverage', 'icon' => 'bx bx-coffee', 'links' => $beverageLinks, ]) @endif @if ($hasAccounting)
  • @endif @endif