From c102a4043c639d47639efd6cc5557e50798f0852 Mon Sep 17 00:00:00 2001 From: randy-ar Date: Tue, 3 Feb 2026 13:40:46 +0700 Subject: [PATCH 1/3] fix(FE): fixing status badge color --- src/components/helper/StatusBadge.tsx | 2 ++ .../pages/closing/ClosingOverheadTable.tsx | 18 +++++++++--------- .../report/finance/tab/DebtSupplierTab.tsx | 11 +++++++++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/helper/StatusBadge.tsx b/src/components/helper/StatusBadge.tsx index f9725fff..c90ddaee 100644 --- a/src/components/helper/StatusBadge.tsx +++ b/src/components/helper/StatusBadge.tsx @@ -28,6 +28,7 @@ const StatusBadge = ({ 'bg-error/20': color === 'error', 'bg-primary/20': color === 'info', 'bg-[#FF9A20]/12': color === 'warning', + 'bg-[#1166EF]/12': color === 'primary', }, className?.badge ), @@ -45,6 +46,7 @@ const StatusBadge = ({ 'text-error': color === 'error', 'text-primary': color === 'info', 'text-[#FF9A20]': color === 'warning', + 'text-[#1166EF]': color === 'primary', })} > diff --git a/src/components/pages/closing/ClosingOverheadTable.tsx b/src/components/pages/closing/ClosingOverheadTable.tsx index 0d51ae3b..a7a170eb 100644 --- a/src/components/pages/closing/ClosingOverheadTable.tsx +++ b/src/components/pages/closing/ClosingOverheadTable.tsx @@ -250,29 +250,29 @@ const ClosingOverheadTable = ({ body: 'p-4 shadow-button-soft border border-base-content/10 rounded-lg', }} > -
+

Pembelian Kandang

-
-
+
+
Populasi Akhir KANDANG{' '} Pemakaian Di FARM
-
-
+
+
Populasi Akhir Proyek
-
-
+
+
{formatNumber(chickinPopulation ?? 0)} {formatCurrency( @@ -281,8 +281,8 @@ const ClosingOverheadTable = ({ : 0 )}
-
-
+
+
{formatNumber(generalInformation?.population ?? 0)}
diff --git a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx index 646cfb15..88e5a693 100644 --- a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx +++ b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx @@ -36,7 +36,6 @@ import SelectInputRadio from '@/components/input/SelectInputRadio'; import { useFinanceTabStore } from '@/stores/finance-tab/finance-tab.store'; import StatusBadge from '@/components/helper/StatusBadge'; import DebtSupplierSkeleton from '@/components/pages/report/finance/skeleton/DebtSupplierSkeleton'; -import DataStateSkeleton from '@/components/helper/skeleton/DataStateSkeleton'; const dueStatus: Record = { 'Sudah Jatuh Tempo': 'error', @@ -60,7 +59,15 @@ const getPillBadge = ( ? dueStatus[statusText] || 'neutral' : paymentStatus[statusText] || 'neutral'; - return ; + return ( + + ); }; interface DebtSupplierTabProps { From 40411b0417431a21d44dd8733f9ac222d70ebdcf Mon Sep 17 00:00:00 2001 From: randy-ar Date: Tue, 3 Feb 2026 14:12:08 +0700 Subject: [PATCH 2/3] fix(FE): fixing total text color debt supplier --- .../pages/report/finance/tab/DebtSupplierTab.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx index 88e5a693..5e7781bf 100644 --- a/src/components/pages/report/finance/tab/DebtSupplierTab.tsx +++ b/src/components/pages/report/finance/tab/DebtSupplierTab.tsx @@ -473,7 +473,9 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => { footer: () => { const value = supplier?.total.total_price; return ( -
+
{formatCurrency(value || 0)}
); @@ -495,7 +497,9 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => { footer: () => { const value = supplier?.total.payment_price; return ( -
+
{formatCurrency(value || 0)}
); @@ -517,7 +521,9 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => { footer: () => { const value = supplier?.total.debt_price; return ( -
+
{formatCurrency(value || 0)}
); From c24cf7ed1a63fa804fd629c95d8b667b808cb9aa Mon Sep 17 00:00:00 2001 From: randy-ar Date: Tue, 3 Feb 2026 14:39:34 +0700 Subject: [PATCH 3/3] fix(FE): adding standard fcr to growing production standard --- .../form/ProductionStandardForm.schema.ts | 2 +- .../form/ProductionStandardForm.tsx | 104 +++++++++++------- 2 files changed, 63 insertions(+), 43 deletions(-) diff --git a/src/components/pages/master-data/production-standard/form/ProductionStandardForm.schema.ts b/src/components/pages/master-data/production-standard/form/ProductionStandardForm.schema.ts index eb59a9c0..86951db9 100644 --- a/src/components/pages/master-data/production-standard/form/ProductionStandardForm.schema.ts +++ b/src/components/pages/master-data/production-standard/form/ProductionStandardForm.schema.ts @@ -32,7 +32,7 @@ const GrowingRepeaterFormSchema = Yup.object({ target_hen_house_production: Yup.number().optional(), target_egg_weight: Yup.number().optional(), target_egg_mass: Yup.number().optional(), - standard_fcr: Yup.number().optional(), + standard_fcr: Yup.number().required('Wajib diisi!'), }).optional(), }); diff --git a/src/components/pages/master-data/production-standard/form/ProductionStandardForm.tsx b/src/components/pages/master-data/production-standard/form/ProductionStandardForm.tsx index c445a840..1b490fbb 100644 --- a/src/components/pages/master-data/production-standard/form/ProductionStandardForm.tsx +++ b/src/components/pages/master-data/production-standard/form/ProductionStandardForm.tsx @@ -386,14 +386,6 @@ const ProductionStandardForm = ({ `${row.original.production_standard_details?.target_egg_mass} kg`, enableSorting: false, }, - { - header: 'FCR', - accessorFn: (row) => - row.production_standard_details?.standard_fcr, - cell: ({ row }) => - `${row.original.production_standard_details?.standard_fcr} g`, - enableSorting: false, - }, ] : []; @@ -468,6 +460,13 @@ const ProductionStandardForm = ({ return [ ...baseColumns, ...productionColumns, + { + header: 'FCR', + accessorFn: (row) => row.production_standard_details?.standard_fcr, + cell: ({ row }) => + `${row.original.production_standard_details?.standard_fcr} g`, + enableSorting: false, + }, ...uniformityColumns, ...(formType !== 'detail' ? [actionColumn] : []), ]; @@ -753,24 +752,46 @@ const ProductionStandardForm = ({ e.preventDefault(); // For GROWING category, clear production_standard_details errors and set default values + // but preserve standard_fcr since it's used for both LAYING and GROWING if (formik.values.project_category === 'GROWING') { - // Set default values for production_standard_details + // Set default values for production_standard_details, preserving standard_fcr formik.values.details?.forEach((detail) => { detail.production_standard_details = { target_hen_day_production: 0, target_hen_house_production: 0, target_egg_weight: 0, target_egg_mass: 0, - standard_fcr: 0, + standard_fcr: + detail.production_standard_details?.standard_fcr || 0, }; }); - // Clear any errors related to production_standard_details + // Clear errors only for LAYING-specific fields in production_standard_details + // Preserve standard_fcr error since it's required for both categories const currentErrors = { ...formik.errors }; if (currentErrors.details && Array.isArray(currentErrors.details)) { const cleanedDetails = currentErrors.details .map((detailError) => { if (detailError && typeof detailError === 'object') { + const prodDetails = ( + detailError as { + production_standard_details?: ProductionDetailsErrors; + } + ).production_standard_details; + + // If there's standard_fcr error, preserve it + if (prodDetails && prodDetails.standard_fcr) { + const { production_standard_details, ...rest } = + detailError; + return { + ...rest, + production_standard_details: { + standard_fcr: prodDetails.standard_fcr, + }, + }; + } + + // Otherwise, remove entire production_standard_details errors const { production_standard_details, ...rest } = detailError; return Object.keys(rest).length > 0 ? rest : undefined; } @@ -896,7 +917,7 @@ const ProductionStandardForm = ({ gridTemplateColumns: formik.values.project_category === 'LAYING' ? 'repeat(10, minmax(auto, 1fr)) minmax(auto, auto)' - : 'repeat(4, minmax(auto, 1fr)) minmax(auto, auto)', + : 'repeat(5, minmax(auto, 1fr)) minmax(auto, auto)', }} > - + )} + - - )} + ) + ) && + getProductionDetailsTouched( + repeaterFormik.touched + .production_standard_details, + 'standard_fcr' + ) + } + />