From 9cffa531227d1c1b28de3925dd5ad926da349807 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 22 Jan 2026 11:26:47 +0700 Subject: [PATCH 01/16] feat(FE): Show age with week in sales report table --- .../pages/closing/sale/SalesReportTable.tsx | 16 ++++++++++------ src/types/api/closing.d.ts | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/pages/closing/sale/SalesReportTable.tsx b/src/components/pages/closing/sale/SalesReportTable.tsx index 6ddd9e4f..a5b2584a 100644 --- a/src/components/pages/closing/sale/SalesReportTable.tsx +++ b/src/components/pages/closing/sale/SalesReportTable.tsx @@ -112,12 +112,16 @@ const SalesReportTable = ({
Total Penjualan
), }, - // { - // id: 'age', - // accessorKey: 'age', - // header: 'Umur', - // cell: (props) => props.getValue() || '-', - // }, + { + id: 'age', + accessorKey: 'age', + header: 'Umur', + cell: (props) => { + const age = props.row.original.age; + const week = props.row.original.week; + return age && week ? `${formatNumber(age)} (Minggu ke-${week})` : '-'; + }, + }, { id: 'do_number', accessorKey: 'do_number', diff --git a/src/types/api/closing.d.ts b/src/types/api/closing.d.ts index 8135c013..31a0248d 100644 --- a/src/types/api/closing.d.ts +++ b/src/types/api/closing.d.ts @@ -17,6 +17,7 @@ export type BaseSales = { id: number; realization_date: string; age: number; + week: number; do_number: string; product: Product; customer: Customer; From 1e421e4230f8bcafc4f6a1a4f34d2e677989b080 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 22 Jan 2026 11:34:29 +0700 Subject: [PATCH 02/16] refactor(FE): Show age as days and weeks in table --- src/components/pages/closing/sale/SalesReportTable.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/pages/closing/sale/SalesReportTable.tsx b/src/components/pages/closing/sale/SalesReportTable.tsx index a5b2584a..a3eb6264 100644 --- a/src/components/pages/closing/sale/SalesReportTable.tsx +++ b/src/components/pages/closing/sale/SalesReportTable.tsx @@ -119,7 +119,9 @@ const SalesReportTable = ({ cell: (props) => { const age = props.row.original.age; const week = props.row.original.week; - return age && week ? `${formatNumber(age)} (Minggu ke-${week})` : '-'; + return age && week + ? `${formatNumber(age)} hari (${week} minggu)` + : '-'; }, }, { From eca8bd7026eacc0667a40d601be944a2409c8497 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 22 Jan 2026 11:36:02 +0700 Subject: [PATCH 03/16] refactor(FE): Display raw age instead of using formatNumber --- src/components/pages/closing/sale/SalesReportTable.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/pages/closing/sale/SalesReportTable.tsx b/src/components/pages/closing/sale/SalesReportTable.tsx index a3eb6264..99868984 100644 --- a/src/components/pages/closing/sale/SalesReportTable.tsx +++ b/src/components/pages/closing/sale/SalesReportTable.tsx @@ -119,9 +119,7 @@ const SalesReportTable = ({ cell: (props) => { const age = props.row.original.age; const week = props.row.original.week; - return age && week - ? `${formatNumber(age)} hari (${week} minggu)` - : '-'; + return age && week ? `${age} hari (${week} minggu)` : '-'; }, }, { From b17ccd502ef84ed29ad26c35648443144695863f Mon Sep 17 00:00:00 2001 From: randy-ar Date: Thu, 22 Jan 2026 14:19:48 +0700 Subject: [PATCH 04/16] hotfix: fix sales calculation --- .../pages/dashboard/DashboardProduction.tsx | 48 ++++++++++++-- .../pages/finance/add/FormFinanceAdd.tsx | 14 +---- .../delivery-order/DeliverOrderProduct.tsx | 39 +++++++++--- .../sales-order/SalesOrderProductForm.tsx | 62 ++++++++++--------- 4 files changed, 105 insertions(+), 58 deletions(-) diff --git a/src/components/pages/dashboard/DashboardProduction.tsx b/src/components/pages/dashboard/DashboardProduction.tsx index dd4abd47..35a957c1 100644 --- a/src/components/pages/dashboard/DashboardProduction.tsx +++ b/src/components/pages/dashboard/DashboardProduction.tsx @@ -444,7 +444,13 @@ const DashboardProduction = () => { )?.value === 'FARM' ? ( { @@ -466,7 +472,13 @@ const DashboardProduction = () => { ) : ( { @@ -502,7 +514,13 @@ const DashboardProduction = () => { )?.value === 'FLOCK' ? ( formik.setFieldValue('flock', selected) } @@ -519,7 +537,13 @@ const DashboardProduction = () => { ) : ( formik.setFieldValue('flock', selected) } @@ -548,7 +572,13 @@ const DashboardProduction = () => { )?.value === 'KANDANG' ? ( formik.setFieldValue('kandang', selected) } @@ -565,7 +595,13 @@ const DashboardProduction = () => { ) : ( formik.setFieldValue('kandang', selected) } diff --git a/src/components/pages/finance/add/FormFinanceAdd.tsx b/src/components/pages/finance/add/FormFinanceAdd.tsx index 168d306a..4189521e 100644 --- a/src/components/pages/finance/add/FormFinanceAdd.tsx +++ b/src/components/pages/finance/add/FormFinanceAdd.tsx @@ -54,9 +54,6 @@ const FormFinanceAdd = ({ }: FormFinanceAddProps) => { const router = useRouter(); const [serverErrorMessage, setServerErrorMessage] = useState(''); - const [isSupplier, setIsSupplier] = useState( - initialValues?.party?.type === 'SUPPLIER' - ); // ===== Formik ===== const formikInitialValues = useMemo((): FinanceFormValues => { @@ -215,7 +212,7 @@ const FormFinanceAdd = ({ ? formik.errors.party_type_option : '' } - isDisabled={type === 'edit' || isSupplier} + isDisabled={type === 'edit'} required isClearable /> @@ -254,7 +251,7 @@ const FormFinanceAdd = ({ } required isClearable - isDisabled={!formik.values.party_type_option?.value || isSupplier} + isDisabled={!formik.values.party_type_option?.value} />