From 6319b6d5fe397b0618dd76c7b5bf820f7b417870 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:07:39 +0700 Subject: [PATCH 1/6] refactor(FE): Guard warehouse before accessing location --- src/components/pages/purchase/order/PurchaseOrderDetail.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index 72f9c474..61044c97 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -723,8 +723,8 @@ const PurchaseOrderDetail = ({ :{' '} - {purchaseData.items?.[0]?.warehouse?.type === 'LOKASI' && - purchaseData.items?.[0]?.warehouse?.location?.name + {purchaseData.items?.[0]?.warehouse && + 'location' in purchaseData.items[0].warehouse ? purchaseData.items[0].warehouse.location.name : '-'} From 0e179f1643b22d3d59d1d96ef00c9bd41c5e9801 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:08:37 +0700 Subject: [PATCH 2/6] refactor(FE): Use location type guard for warehouse access --- .../pages/purchase/order/PurchaseOrderInvoice.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx b/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx index 36aea9c7..aed154d0 100644 --- a/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx @@ -324,12 +324,14 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { PT LUMBUNG TELUR INDONESIA - {purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' + {purchaseData?.items?.[0]?.warehouse && + 'location' in purchaseData.items[0].warehouse ? purchaseData.items[0].warehouse.location.name : '-'} - {purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' + {purchaseData?.items?.[0]?.warehouse && + 'location' in purchaseData.items[0].warehouse ? purchaseData.items[0].warehouse.location.address : '-'} @@ -434,7 +436,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { - {item.warehouse?.type === 'LOKASI' + {item.warehouse && 'location' in item.warehouse ? item.warehouse.location.address : '-'} From 28a32cb6c48f4c927057e406f3414d4a4978b1dd Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:21:22 +0700 Subject: [PATCH 3/6] refactor(FE): Move travel document button into receipt section --- .../purchase/order/PurchaseOrderDetail.tsx | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index 61044c97..21307af9 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -540,31 +540,6 @@ const PurchaseOrderDetail = ({ accessorKey: 'travel_number', cell: (props) => props.row.original.travel_number || '-', }, - { - header: 'Dokumen Surat Jalan', - accessorKey: 'travel_document_path', - cell: (props) => { - const documentPath = props.row.original.travel_document_path; - return documentPath ? ( - - ) : ( - '-' - ); - }, - }, { header: 'No. Armada Pengangkut', accessorKey: 'vehicle_number', @@ -905,11 +880,29 @@ const PurchaseOrderDetail = ({ Informasi Penerimaan Barang {canShowPenerimaanBarang && ( - - - +
+ {goodsReceiptItems[0]?.travel_document_path && ( + + )} + + + +
)}
From 72356917ff8f15d51e398086d3859ff1bdb3f0bf Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:23:40 +0700 Subject: [PATCH 4/6] refactor(FE): Show dash for missing transport per item --- src/components/pages/purchase/order/PurchaseOrderDetail.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index 21307af9..9f010f03 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -563,7 +563,10 @@ const PurchaseOrderDetail = ({ { header: 'Transport /Item', accessorKey: 'transport_per_item', - cell: (props) => formatCurrency(props.getValue() as number), + cell: (props) => { + const value = props.row.original.transport_per_item; + return value ? formatCurrency(value) : '-'; + }, }, ]; From 46b819c200b2353db00c3ce1673e3d9f25dccd87 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:27:16 +0700 Subject: [PATCH 5/6] refactor(FE): Use approval step_name or action for status --- .../production/recording/RecordingTable.tsx | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/components/pages/production/recording/RecordingTable.tsx b/src/components/pages/production/recording/RecordingTable.tsx index 7808c5bf..8d8caad1 100644 --- a/src/components/pages/production/recording/RecordingTable.tsx +++ b/src/components/pages/production/recording/RecordingTable.tsx @@ -1013,21 +1013,6 @@ const RecordingTable = () => { approvalHistoryModal.openModal(); }; - const getStatusText = (action: string) => { - switch (action) { - case 'APPROVED': - return 'Disetujui'; - case 'REJECTED': - return 'Ditolak'; - case 'CREATED': - return 'Dibuat'; - case 'UPDATED': - return 'Diperbarui'; - default: - return action; - } - }; - return ( { }} onClick={openApprovalHistory} > - {getStatusText(approval.action)} + {approval.step_name || approval.action} ); }, From 8b0a6f054b52e5c45d130d7a322e9ca686b4639c Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 20 Jan 2026 10:31:32 +0700 Subject: [PATCH 6/6] refactor(FE): Format zero transport per item as currency --- src/components/pages/purchase/order/PurchaseOrderDetail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index 9f010f03..47dbc8f0 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -565,7 +565,7 @@ const PurchaseOrderDetail = ({ accessorKey: 'transport_per_item', cell: (props) => { const value = props.row.original.transport_per_item; - return value ? formatCurrency(value) : '-'; + return value ? formatCurrency(value) : formatCurrency(0); }, }, ];