From 0ed6c246b1289b4c496d0c19c66b8d25e479eef2 Mon Sep 17 00:00:00 2001 From: randy-ar Date: Thu, 29 Jan 2026 20:18:42 +0700 Subject: [PATCH] fix(FE): fix badge and table pdf --- src/components/helper/StatusBadge.tsx | 2 + .../finance/export/DebtSupllierExportPDF.tsx | 59 ++++++++++++------- .../report/finance/tab/DebtSupplierTab.tsx | 21 +------ 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/components/helper/StatusBadge.tsx b/src/components/helper/StatusBadge.tsx index c4f99593..f9725fff 100644 --- a/src/components/helper/StatusBadge.tsx +++ b/src/components/helper/StatusBadge.tsx @@ -27,6 +27,7 @@ const StatusBadge = ({ 'bg-success/30': color === 'success', 'bg-error/20': color === 'error', 'bg-primary/20': color === 'info', + 'bg-[#FF9A20]/12': color === 'warning', }, className?.badge ), @@ -43,6 +44,7 @@ const StatusBadge = ({ 'text-[#008000]': color === 'success', 'text-error': color === 'error', 'text-primary': color === 'info', + 'text-[#FF9A20]': color === 'warning', })} > diff --git a/src/components/pages/report/finance/export/DebtSupllierExportPDF.tsx b/src/components/pages/report/finance/export/DebtSupllierExportPDF.tsx index 869430b0..edcd360f 100644 --- a/src/components/pages/report/finance/export/DebtSupllierExportPDF.tsx +++ b/src/components/pages/report/finance/export/DebtSupllierExportPDF.tsx @@ -281,16 +281,16 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { No - + No. PR - + No. PO - + Tgl Terima/Bayar - + Tgl PO @@ -320,7 +320,12 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { Status - + No. Perjalanan @@ -330,16 +335,16 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { {/* NO */} - + {/* No. PR */} - + {/* No. PO */} - + {/* Tgl Terima/Bayar */} - + {/* Tgl PO */} @@ -381,8 +386,13 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { {/* Status */} - - {/* No. Perjalanan */} + + @@ -400,13 +410,13 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { {index + 1} - + {item.pr_number || '-'} - + {item.po_number || '-'} - + {item.received_date ? item.received_date != '-' @@ -415,7 +425,7 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { : '-'} - + {item.po_date ? item.po_date != '-' @@ -526,7 +536,12 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { - )} - + {item.travel_number || '-'} @@ -538,18 +553,18 @@ const createPDFDocument = (params: DebtSupplierExportPDFParams) => { Total - - - - - - + + + + + + {formatNumber(supplierReport.total.aging)} Hari diff --git a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx index aa66cf66..811c739b 100644 --- a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx +++ b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx @@ -2,10 +2,7 @@ import Button from '@/components/Button'; import Card from '@/components/Card'; import Dropdown from '@/components/Dropdown'; import DateInput from '@/components/input/DateInput'; -import SelectInput, { - OptionType, - useSelect, -} from '@/components/input/SelectInput'; +import { OptionType, useSelect } from '@/components/input/SelectInput'; import Menu from '@/components/menu/Menu'; import MenuItem from '@/components/menu/MenuItem'; import Modal, { useModal } from '@/components/Modal'; @@ -32,12 +29,12 @@ import { DebtSupplierFilterType, } from '@/components/pages/report/finance/filter/DebtSupplierFilter'; import ButtonFilter from '@/components/helper/ButtonFilter'; -import Badge from '@/components/Badge'; import { Color } from '@/types/theme'; import { Supplier } from '@/types/api/master-data/supplier'; import SelectInputCheckbox from '@/components/input/SelectInputCheckbox'; import SelectInputRadio from '@/components/input/SelectInputRadio'; import { useFinanceTabStore } from '@/stores/finance-tab/finance-tab.store'; +import StatusBadge from '@/components/helper/StatusBadge'; const dueStatus: Record = { 'Sudah Jatuh Tempo': 'error', @@ -61,19 +58,7 @@ const getPillBadge = ( ? dueStatus[statusText] || 'neutral' : paymentStatus[statusText] || 'neutral'; - return ( - - {statusText} - - ); + return ; }; interface DebtSupplierTabProps {