From b17ccd502ef84ed29ad26c35648443144695863f Mon Sep 17 00:00:00 2001 From: randy-ar Date: Thu, 22 Jan 2026 14:19:48 +0700 Subject: [PATCH 1/3] 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} />