diff --git a/src/components/pages/finance/FinanceDetail.tsx b/src/components/pages/finance/FinanceDetail.tsx index 7f24178f..03291420 100644 --- a/src/components/pages/finance/FinanceDetail.tsx +++ b/src/components/pages/finance/FinanceDetail.tsx @@ -9,6 +9,7 @@ import Table from '@/components/Table'; import { FINANCE_INITIAL_BALANCE_STATUS, FINANCE_TRANSACTION_STATUS, + FINANCE_INJECTION_STATUS, } from '@/config/constant'; import { formatCurrency, formatDate, formatTitleCase } from '@/lib/helper'; import { FinanceApi } from '@/services/api/finance'; @@ -33,7 +34,7 @@ const FinanceDetail = ({ finance }: { finance: Finance }) => { }, { label: 'Pihak', - value: finance.party.name, + value: finance.party.id ? finance.party.name : '-', }, { label: 'Tanggal', @@ -51,7 +52,7 @@ const FinanceDetail = ({ finance }: { finance: Finance }) => { const informasiTransfer = [ { label: 'No. Referensi', - value: finance.reference_number, + value: finance.reference_number ?? '-', }, { label: 'Nomor Rekening', @@ -69,7 +70,16 @@ const FinanceDetail = ({ finance }: { finance: Finance }) => { label: 'Sisa', value: formatCurrency(finance.income_amount), }, - ]; + ].filter((item) => { + // Hide party account number row if transaction type is INJECTION + if ( + FINANCE_INJECTION_STATUS.includes(finance.transaction_type) && + item.label === `Rekening ${formatTitleCase(finance.party.type)}` + ) { + return false; + } + return true; + }); const confirmationModalDeleteClickHandler = async () => { setIsDeleteLoading(true); @@ -162,6 +172,18 @@ const FinanceDetail = ({ finance }: { finance: Finance }) => { )} + {FINANCE_INJECTION_STATUS.includes(finance.transaction_type) && ( + + + + )} - */} - + - {/* + - */} - + )} {initialValues?.latest_approval?.step_number != 1 && ( <> - {/* - */} - + )} @@ -466,7 +426,7 @@ const MarketingDetail = ({
{initialValues?.latest_approval?.step_number != 3 && ( <> - {/* + - */} - + )} - {/* + - */} - +
- {/*
- {JSON.stringify(formik.values)} -
-
- {JSON.stringify(formik.errors)} -
*/} - {/* + - */} - + )} diff --git a/src/components/pages/marketing/form/repeater/sales-order/SalesOrderProductForm.tsx b/src/components/pages/marketing/form/repeater/sales-order/SalesOrderProductForm.tsx index 75aa3ba6..aa9dd9e8 100644 --- a/src/components/pages/marketing/form/repeater/sales-order/SalesOrderProductForm.tsx +++ b/src/components/pages/marketing/form/repeater/sales-order/SalesOrderProductForm.tsx @@ -11,7 +11,7 @@ import SelectInput, { useSelect, } from '@/components/input/SelectInput'; import { Kandang } from '@/types/api/master-data/kandang'; -import { KandangApi, WarehouseApi } from '@/services/api/master-data'; +import { WarehouseApi } from '@/services/api/master-data'; import { ProductWarehouse } from '@/types/api/inventory/product-warehouse'; import { ProductWarehouseApi } from '@/services/api/inventory'; import NumberInput from '@/components/input/NumberInput'; @@ -180,9 +180,6 @@ const SalesOrderProductForm = ({ )} - {/* - {JSON.stringify(formik.errors)} - */}
{ const cols = [ - // { - // id: 'select', - // header: ({ - // table, - // }: { - // table: TanStack.Table; - // }) => ( - //
- // - //
- // ), - // cell: ({ - // row, - // }: { - // row: TanStack.Row; - // }) => ( - //
- // - //
- // ), - // }, { accessorFn: (row: DeliveryOrderProductFormValues) => row.do_number, header: 'No. Pengiriman', @@ -188,18 +156,6 @@ const DeliveryOrderProductTable = ({ )} {!props.row.original.qty && '-'} - {/* {formType == 'add_deliver' && ( - - )} */}
), @@ -248,22 +204,6 @@ const DeliveryOrderProductTable = ({ Tambah Pengiriman - {/* {selectedRowIds.length > 0 && ( - - )} */} ); diff --git a/src/config/route-permission.ts b/src/config/route-permission.ts index c25f6981..7c256795 100644 --- a/src/config/route-permission.ts +++ b/src/config/route-permission.ts @@ -76,7 +76,12 @@ export const ROUTE_PERMISSIONS: Record = { // Finance '/finance/': ['lti.finance.transactions.list'], - '/finance/detail/': ['lti.finance.transactions.detail'], + '/finance/detail/': [ + 'lti.finance.transactions.detail', + 'lti.finance.initial_balances.detail', + 'lti.finance.injections.detail', + 'lti.finance.payments.detail', + ], '/finance/add/': ['lti.finance.payments.create'], '/finance/detail/edit/': ['lti.finance.payments.update'], '/finance/add/initial-balance/': ['lti.finance.initial_balances.create'],