feat: add new permissions for attendance and profit margin, update return values in analysis component

This commit is contained in:
Yoga Pangestu 2026-08-13 14:01:29 +07:00
parent 1fe95d66fc
commit a468f6c4ff
2 changed files with 4 additions and 1 deletions

View File

@ -70,6 +70,7 @@ public function run(): void
'admin-toko' => array_values(array_filter($allPermissions, function ($p) { 'admin-toko' => array_values(array_filter($allPermissions, function ($p) {
return in_array($p, [ return in_array($p, [
'dashboard.view', 'dashboard.view',
'dashboard.attendance',
'dashboard.revenue', 'dashboard.revenue',
'dashboard.expense', 'dashboard.expense',
'dashboard.orders_channel', 'dashboard.orders_channel',
@ -88,6 +89,7 @@ public function run(): void
'analysis.profit_orders', 'analysis.profit_orders',
'analysis.profit_hpp', 'analysis.profit_hpp',
'analysis.profit_gross', 'analysis.profit_gross',
'analysis.profit_margin',
'analysis.top_customers', 'analysis.top_customers',
'analysis.top_products', 'analysis.top_products',
'analysis.top_suppliers', 'analysis.top_suppliers',
@ -379,6 +381,7 @@ public function run(): void
'analysis.profit_margin', 'analysis.profit_margin',
'analysis.top_customers', 'analysis.top_customers',
'analysis.top_products', 'analysis.top_products',
'analysis.top_suppliers',
'analysis.marketing_sales', 'analysis.marketing_sales',
'employees.view', 'employees.view',

View File

@ -515,7 +515,7 @@ export default function Analysis({
} }
if (hasAnyRole(['admin_toko', 'direktur'])) { if (hasAnyRole(['admin_toko', 'direktur'])) {
return { statCards: 1, revenue: 4, revenueByChannel: 5, orderPie: 6, expense: 7, totalOrder: 8, revenueTrend: 9, marketingSales: 10, topProducts: 11, topCustomers: 12, busyHours: 13 }; return { statCards: 1, revenue: 4, revenueByChannel: 5, orderPie: 6, expense: 7, totalOrder: 8, revenueTrend: 9, marketingSales: 10, topSuppliers: 11, topProducts: 12, topCustomers: 13, busyHours: 14 };
} }
if (hasRole('marketing')) { if (hasRole('marketing')) {