From 6cd09a413dd9cc663199c1ed43c8a87522115636 Mon Sep 17 00:00:00 2001 From: randy-ar Date: Wed, 31 Dec 2025 12:25:08 +0700 Subject: [PATCH 1/5] fix(FE): fix delete reseponse project flock --- .../production/project-flock/ProjectFlockTable.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/pages/production/project-flock/ProjectFlockTable.tsx b/src/components/pages/production/project-flock/ProjectFlockTable.tsx index 025e7186..7d9ce7da 100644 --- a/src/components/pages/production/project-flock/ProjectFlockTable.tsx +++ b/src/components/pages/production/project-flock/ProjectFlockTable.tsx @@ -228,11 +228,18 @@ const ProjectFlockTable = ({ refresh }: { refresh?: () => void }) => { const confirmationModalDeleteClickHandler = async () => { setIsDeleteLoading(true); - await ProjectFlockApi.delete(selectedSingleRow?.id as number); + const response = await ProjectFlockApi.delete( + selectedSingleRow?.id as number + ); + if (isResponseSuccess(response)) { + toast.success(response?.message as string); + } + if (isResponseError(response)) { + toast.error(response?.message as string); + } refreshProjectFlocks(); deleteModal.closeModal(); - toast.success('Successfully delete Project Flock!'); setIsDeleteLoading(false); setRowSelection({}); }; From 1a8d794a66cac2f3da6370ed3b967d52eea2d74e Mon Sep 17 00:00:00 2001 From: randy-ar Date: Wed, 31 Dec 2025 13:10:58 +0700 Subject: [PATCH 2/5] fix(FE): fix finance party select --- src/components/pages/finance/add/FormFinanceAdd.tsx | 2 ++ .../add/initial-balance/FormFinanceAddInitialBalance.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/components/pages/finance/add/FormFinanceAdd.tsx b/src/components/pages/finance/add/FormFinanceAdd.tsx index f7fdf446..c835740e 100644 --- a/src/components/pages/finance/add/FormFinanceAdd.tsx +++ b/src/components/pages/finance/add/FormFinanceAdd.tsx @@ -188,6 +188,8 @@ const FormFinanceAdd = ({ value={formik.values.party_type_option} onChange={(value) => { formik.setFieldValue('party_type_option', value); + formik.setFieldValue('party_id_option', null); + formik.setFieldValue('party_account_number', ''); }} isError={Boolean( formik.touched.party_type_option && diff --git a/src/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance.tsx b/src/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance.tsx index aa185647..f8fd51d5 100644 --- a/src/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance.tsx +++ b/src/components/pages/finance/add/initial-balance/FormFinanceAddInitialBalance.tsx @@ -189,6 +189,8 @@ const FormFinanceAddInitialBalance = ({ value={formik.values.party_type_option} onChange={(value) => { formik.setFieldValue('party_type_option', value); + formik.setFieldValue('party_id_option', null); + formik.setFieldValue('party_account_number', ''); }} isError={Boolean( formik.touched.party_type_option && From 15b3151c5fd294dbbb1a8dd35b6f6f1c66c290dd Mon Sep 17 00:00:00 2001 From: randy-ar Date: Wed, 31 Dec 2025 13:18:22 +0700 Subject: [PATCH 3/5] fix(FE): fix perhitungan sapronak --- .../ClosingSapronakCalculationTable.tsx | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/src/components/pages/closing/ClosingSapronakCalculationTable.tsx b/src/components/pages/closing/ClosingSapronakCalculationTable.tsx index b6703549..1ec3c971 100644 --- a/src/components/pages/closing/ClosingSapronakCalculationTable.tsx +++ b/src/components/pages/closing/ClosingSapronakCalculationTable.tsx @@ -3,7 +3,7 @@ import Card from '@/components/Card'; import Table from '@/components/Table'; -import { formatCurrency, formatNumber } from '@/lib/helper'; +import { formatCurrency, formatDate, formatNumber } from '@/lib/helper'; import { RowSapronakCalculation, TotalSapronakCalculation, @@ -38,23 +38,29 @@ const ClosingSapronakCalculationTable = ({ { header: 'Tanggal', accessorKey: 'tanggal', - cell: (props) => (props.getValue() as string) || '-', + cell: (props) => + props.row.original.tanggal + ? formatDate(props.row.original.tanggal, 'DD MMM YYYY') + : '-', footer: 'Total', }, { header: 'No. Referensi', accessorKey: 'no_referensi', - cell: (props) => (props.getValue() as string) || '-', + cell: (props) => (props.row.original.no_referensi as string) || '-', footer: '', }, { header: 'QTY Masuk', accessorKey: 'qty_masuk', - cell: (props) => formatNumber(props.getValue() as number), + cell: (props) => + props.row.original.qty_masuk + ? formatNumber(props.row.original.qty_masuk as number) + : '-', footer: total ? () => (
- {formatNumber(total?.qty_masuk)} + {total?.qty_masuk ? formatNumber(total?.qty_masuk) : '-'}
) : '', @@ -62,11 +68,14 @@ const ClosingSapronakCalculationTable = ({ { header: 'QTY Keluar', accessorKey: 'qty_keluar', - cell: (props) => formatNumber(props.getValue() as number), + cell: (props) => + props.row.original.qty_keluar + ? formatNumber(props.row.original.qty_keluar as number) + : '-', footer: total ? () => (
- {formatNumber(total?.qty_keluar)} + {total?.qty_keluar ? formatNumber(total?.qty_keluar) : '-'}
) : '', @@ -74,11 +83,14 @@ const ClosingSapronakCalculationTable = ({ { header: 'QTY Pakai', accessorKey: 'qty_pakai', - cell: (props) => formatNumber(props.getValue() as number), + cell: (props) => + props.row.original.qty_pakai + ? formatNumber(props.row.original.qty_pakai as number) + : '-', footer: total ? () => (
- {formatNumber(total?.qty_pakai)} + {total?.qty_pakai ? formatNumber(total?.qty_pakai) : '-'}
) : '', @@ -86,23 +98,28 @@ const ClosingSapronakCalculationTable = ({ { header: 'Uraian', accessorKey: 'uraian', - cell: (props) => (props.getValue() as string) || '-', + cell: (props) => (props.row.original.uraian as string) || '-', footer: '', }, { header: 'Kategori Produk', accessorKey: 'kategori_produk', - cell: (props) => (props.getValue() as string) || '-', + cell: (props) => (props.row.original.kategori_produk as string) || '-', footer: '', }, { header: 'Harga Beli/Qty (Rp)', accessorKey: 'harga_beli_per_qty', - cell: (props) => formatCurrency(props.getValue() as number), + cell: (props) => + props.row.original.harga_beli_per_qty + ? formatCurrency(props.row.original.harga_beli_per_qty as number) + : '-', footer: total ? () => (
- {formatCurrency(total?.harga_beli_per_qty)} + {total?.harga_beli_per_qty + ? formatCurrency(total?.harga_beli_per_qty) + : '-'}
) : '', @@ -110,11 +127,14 @@ const ClosingSapronakCalculationTable = ({ { header: 'Total Harga (Rp)', accessorKey: 'total_harga', - cell: (props) => formatCurrency(props.getValue() as number), + cell: (props) => + props.row.original.total_harga + ? formatCurrency(props.row.original.total_harga as number) + : '-', footer: total ? () => (
- {formatCurrency(total?.total_harga)} + {total?.total_harga ? formatCurrency(total?.total_harga) : '-'}
) : '', @@ -122,7 +142,7 @@ const ClosingSapronakCalculationTable = ({ { header: 'Keterangan', accessorKey: 'keterangan', - cell: (props) => (props.getValue() as string) || '-', + cell: (props) => (props.row.original.keterangan as string) || '-', footer: '', }, ]; From 3769309ce30dfe56ff1e454b3630489baf07b3db Mon Sep 17 00:00:00 2001 From: randy-ar Date: Wed, 31 Dec 2025 13:28:27 +0700 Subject: [PATCH 4/5] hotfix(FE): bypass permission marketinh --- .../pages/marketing/MarketingTable.tsx | 105 +++++++++++++++--- .../marketing/detail/MarketingDetail.tsx | 84 +++++++++++--- .../pages/marketing/form/MarketingForm.tsx | 13 ++- 3 files changed, 166 insertions(+), 36 deletions(-) diff --git a/src/components/pages/marketing/MarketingTable.tsx b/src/components/pages/marketing/MarketingTable.tsx index f9cbdbfe..0247fc75 100644 --- a/src/components/pages/marketing/MarketingTable.tsx +++ b/src/components/pages/marketing/MarketingTable.tsx @@ -52,7 +52,7 @@ const RowsOptionsMenu = ({ )} >
- + {/* - + */} + {props.row.original.latest_approval.step_number != 1 && ( - + <> + {/* + + */} - + )} {props.row.original.latest_approval.step_number != 3 && ( - + <> + {/* + + */} - + )} - + {/* - + */} +
); @@ -302,7 +353,7 @@ const MarketingTable = () => { }} />
- + {/* - + */} + - + {/* - + */} +
{initialValues?.latest_approval?.step_number == 1 && ( <> - + {/* - + */} + - + {/* - + */} + )} {initialValues?.latest_approval?.step_number != 1 && ( - + <> + {/* + + */} + */} - + )} - + {/* - + */} + - + {/* - + */} + )} From 4ec62c936e73546edd7525e117aefb64eaecd1eb Mon Sep 17 00:00:00 2001 From: randy-ar Date: Wed, 31 Dec 2025 13:32:11 +0700 Subject: [PATCH 5/5] hotfix(FE): bypass permission marketing --- src/config/route-permission.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/config/route-permission.ts b/src/config/route-permission.ts index 0a17175d..7c7ab0ac 100644 --- a/src/config/route-permission.ts +++ b/src/config/route-permission.ts @@ -58,14 +58,27 @@ export const ROUTE_PERMISSIONS: Record = { '/purchase/detail/edit/': ['lti.purchase.update'], // Marketing - '/marketing/': ['lti.marketing.delivery_order.list'], - '/marketing/add/delivery-orders/': ['lti.marketing.delivery_order.create'], - '/marketing/add/sales-orders/': ['lti.marketing.sales_order.create'], - '/marketing/detail/': ['lti.marketing.delivery_order.detail'], + '/marketing/': ['lti.dashboard.list', 'lti.marketing.delivery_order.list'], + '/marketing/add/delivery-orders/': [ + 'lti.dashboard.list', + 'lti.marketing.delivery_order.create', + ], + '/marketing/add/sales-orders/': [ + 'lti.dashboard.list', + 'lti.marketing.sales_order.create', + ], + '/marketing/detail/': [ + 'lti.dashboard.list', + 'lti.marketing.delivery_order.detail', + ], '/marketing/detail/delivery-orders/edit/': [ + 'lti.dashboard.list', 'lti.marketing.delivery_order.update', ], - '/marketing/detail/sales-orders/edit/': ['lti.marketing.sales_order.update'], + '/marketing/detail/sales-orders/edit/': [ + 'lti.dashboard.list', + 'lti.marketing.sales_order.update', + ], // Expense '/expense/': ['lti.expense.list'],