From 15c167d24d506e7742bf2982a1849f36cd1f8258 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 13:24:08 +0700 Subject: [PATCH 1/8] fix: add permission for Penjualan and Keuangan menu --- src/config/constant.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config/constant.ts b/src/config/constant.ts index fff9fa92..c2465cda 100644 --- a/src/config/constant.ts +++ b/src/config/constant.ts @@ -114,11 +114,13 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [ text: 'Penjualan', link: '/marketing', icon: 'heroicons-outline:currency-dollar', + permission: ['lti.marketing.delivery_order.list'], }, { text: 'Keuangan', link: '/finance', icon: 'heroicons-outline:banknotes', + permission: ['lti.finance.transactions.list'], }, { text: 'Biaya', From aecf4701736a2620fa697766e73a00dc4e3f239f Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 13:57:17 +0700 Subject: [PATCH 2/8] chore: add max size and bottom label for file input in daily checklist form --- .../components/pages/daily-checklist/DailyChecklistContent.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx b/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx index 79049480..266b8740 100644 --- a/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx +++ b/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx @@ -1478,6 +1478,8 @@ export function DailyChecklistContent() { inputWrapper: 'flex items-center', label: 'font-semibold text-gray-900', }} + maxSize={5242880} // 5 MB + bottomLabel='Ukuran file maksimal 5MB' /> )} From 2c27b2e41d08b37563aa0d1fbe289b24b1520040 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 14:34:48 +0700 Subject: [PATCH 3/8] chore: add transfer_context query when fetching source warehouse --- .../inventory/movement/form/MovementForm.tsx | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/components/pages/inventory/movement/form/MovementForm.tsx b/src/components/pages/inventory/movement/form/MovementForm.tsx index b2f50361..dbb30314 100644 --- a/src/components/pages/inventory/movement/form/MovementForm.tsx +++ b/src/components/pages/inventory/movement/form/MovementForm.tsx @@ -86,6 +86,15 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => { } // ===== USE SELECT HOOKS ===== + const { + setInputValue: setSourceWarehouseSelectInputValue, + isLoadingOptions: isLoadingSourceWarehouses, + loadMore: loadMoreSourceWarehouses, + rawData: sourceWarehouses, + } = useSelect(WarehouseApi.basePath, 'id', 'name', 'search', { + transfer_context: 'inventory_transfer', + }); + const { setInputValue: setWarehouseSelectInputValue, isLoadingOptions: isLoadingWarehouses, @@ -136,6 +145,25 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => { return stockMap; }, [allProductWarehouses]); + const sourceWarehouseOptions = useMemo(() => { + if (!isResponseSuccess(sourceWarehouses)) return []; + + return ( + sourceWarehouses?.data.map((w) => { + warehouseStockMap.get(w.id); + return { + value: w.id, + label: w.name, + area: w.area?.name, + location: + 'type' in w && (w.type === 'LOKASI' || w.type === 'KANDANG') + ? w.location?.name + : undefined, + }; + }) || [] + ); + }, [sourceWarehouses, warehouseStockMap]); + const warehouseOptions = useMemo(() => { if (!isResponseSuccess(warehouses)) return []; @@ -1354,10 +1382,10 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => { placeholder='Pilih gudang asal...' value={formik.values.source_warehouse} onChange={handleSourceWarehouseChange} - options={warehouseOptions} - onInputChange={setWarehouseSelectInputValue} - onMenuScrollToBottom={loadMoreWarehouses} - isLoading={isLoadingWarehouses} + options={sourceWarehouseOptions} + onInputChange={setSourceWarehouseSelectInputValue} + onMenuScrollToBottom={loadMoreSourceWarehouses} + isLoading={isLoadingSourceWarehouses} isError={ formik.touched.source_warehouse_id && Boolean(formik.errors.source_warehouse_id) From d3be683b6998e7d4b121e458f28fa6060f4c71f7 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 14:35:21 +0700 Subject: [PATCH 4/8] chore: add transfer_context query when fetching source project flock --- .../production/transfer-to-laying/TransferToLayingFormModal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx b/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx index 87541d8c..399468c7 100644 --- a/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx +++ b/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx @@ -98,6 +98,7 @@ const TransferToLayingFormModal = () => { 'search', { category: 'GROWING', + transfer_context: 'transfer_to_laying', } ); From 190792affeb342aeac7d7b5b65bf99019d5c8e0d Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 14:44:26 +0700 Subject: [PATCH 5/8] chore: format license plate number --- src/components/pages/report/DailyMarketingsTable.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/pages/report/DailyMarketingsTable.tsx b/src/components/pages/report/DailyMarketingsTable.tsx index 67702035..2ed5a9cb 100644 --- a/src/components/pages/report/DailyMarketingsTable.tsx +++ b/src/components/pages/report/DailyMarketingsTable.tsx @@ -10,7 +10,13 @@ import DebouncedTextInput from '@/components/input/DebouncedTextInput'; import Card from '@/components/Card'; import Collapse from '@/components/Collapse'; -import { cn, formatCurrency, formatDate, formatNumber } from '@/lib/helper'; +import { + cn, + formatCurrency, + formatDate, + formatNumber, + formatVechicleNumber, +} from '@/lib/helper'; import { isResponseSuccess } from '@/lib/api-helper'; import { DailyMarketingRow } from '@/types/api/report/marketing'; import { MarketingReportApi } from '@/services/api/report/marketing-report'; @@ -94,7 +100,9 @@ const DailyMarketingsTable = ({ accessorKey: 'vehicle_number', header: 'No. Polisi', cell: (props) => ( - {props.row.original.vehicle_number} + + {formatVechicleNumber(props.row.original.vehicle_number)} + ), }, { From 24f2b94bb8a041624679466829f9a707a121a444 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 15:38:12 +0700 Subject: [PATCH 6/8] feat: update menu permissions --- src/config/constant.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/config/constant.ts b/src/config/constant.ts index c2465cda..120b6b6a 100644 --- a/src/config/constant.ts +++ b/src/config/constant.ts @@ -5,6 +5,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [ text: 'Dashboard', link: '/dashboard', icon: 'heroicons-outline:chart-bar-square', + permission: ['lti.dashboard.list'], }, { text: 'Daily Checklist', @@ -138,26 +139,46 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [ text: 'Laporan', link: '/report', icon: 'mdi:chart-box-outline', + permission: [ + 'lti.repport.debtsupplier.list', + 'lti.repport.customerpayment.list', + 'lti.repport.purchasesupplier.list', + 'lti.repport.expense.list', + 'lti.repport.delivery.list', + 'lti.repport.gethppperkandang.list', + 'lti.repport.production_result.list', + ], submenu: [ { text: 'Keuangan', link: '/report/finance', + permission: [ + 'lti.repport.debtsupplier.list', + 'lti.repport.customerpayment.list', + ], }, { text: 'Logistik & Persediaan', link: '/report/logistic-stock', + permission: ['lti.repport.purchasesupplier.list'], }, { text: 'Biaya Operasional', link: '/report/expense', + permission: ['lti.repport.expense.list'], }, { text: 'Penjualan', link: '/report/marketing', + permission: [ + 'lti.repport.delivery.list', + 'lti.repport.gethppperkandang.list', + ], }, { text: 'Hasil Produksi', link: '/report/production-result', + permission: ['lti.repport.production_result.list'], }, ], }, @@ -206,6 +227,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [ 'lti.master.suppliers.list', 'lti.master.uoms.list', 'lti.master.warehouses.list', + 'lti.master.production_standards.list', ], submenu: [ { @@ -276,6 +298,7 @@ export const MAIN_DRAWER_LINKS: SidebarMenuItem[] = [ { text: 'Standar Produksi', link: '/master-data/production-standard', + permission: ['lti.master.production_standards.list'], }, ], }, From 92cc082c5433aa2051bb20185d54bb8cb93862e2 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 15:39:04 +0700 Subject: [PATCH 7/8] chore: use localized language --- src/components/helper/PermissionNotFound.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/helper/PermissionNotFound.tsx b/src/components/helper/PermissionNotFound.tsx index 75e48c62..e2823b8b 100644 --- a/src/components/helper/PermissionNotFound.tsx +++ b/src/components/helper/PermissionNotFound.tsx @@ -1,10 +1,17 @@ +import Button from '@/components/Button'; + const PermissionNotFound = () => { return (
-

Permission Not Found

+

+ Hak Akses Tidak Ditemukan +

- You do not have permission to access this page. + Anda tidak memiliki hak akses untuk mengakses halaman ini.

+
); }; From 8ce72b21e1df2ae8be983fdfabce20387d3f7cd5 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 30 Jan 2026 15:39:16 +0700 Subject: [PATCH 8/8] chore: update permissions for /report/marketing --- src/config/route-permission.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/route-permission.ts b/src/config/route-permission.ts index 44f3728e..20ee5292 100644 --- a/src/config/route-permission.ts +++ b/src/config/route-permission.ts @@ -116,7 +116,10 @@ export const ROUTE_PERMISSIONS: Record = { // Report '/report/logistic-stock/': ['lti.repport.purchasesupplier.list'], '/report/expense/': ['lti.repport.expense.list'], - '/report/marketing/': ['lti.repport.delivery.list'], + '/report/marketing/': [ + 'lti.repport.delivery.list', + 'lti.repport.gethppperkandang.list', + ], '/report/production-result/': ['lti.repport.production_result.list'], '/report/finance/': [ 'lti.repport.finance.list',