diff --git a/src/app/closing/detail/page.tsx b/src/app/closing/detail/page.tsx
index 6225b8dd..487533be 100644
--- a/src/app/closing/detail/page.tsx
+++ b/src/app/closing/detail/page.tsx
@@ -4,6 +4,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
import useSWR from 'swr';
import ClosingDetail from '@/components/pages/closing/ClosingDetail';
+import SalesReportTable from '@/components/pages/closing/sale/SalesReportTable';
import { ClosingApi } from '@/services/api/closing';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
@@ -19,6 +20,11 @@ const ClosingDetailPage = () => {
(id: number) => ClosingApi.getGeneralInfo(id)
);
+ const { data: salesReport, isLoading: isLoadingSalesReport } = useSWR(
+ closingId,
+ (id: number) => ClosingApi.getPenjualan(id)
+ );
+
if (!closingId) {
router.back();
@@ -43,6 +49,9 @@ const ClosingDetailPage = () => {
{!isLoadingClosing && isResponseSuccess(closing) && (
| {pengajuanItem.nonstock.name} | {pengajuanItem.qty} | -{formatCurrency(pengajuanItem.total_price)} | +{formatCurrency(pengajuanItem.price)} | {pengajuanItem.note ?? '-'} | |||||||||||||
| {realisasiItem.nonstock.name} | {realisasiItem.qty} | -{formatCurrency(realisasiItem.total_price)} | +{formatCurrency(realisasiItem.price)} | {realisasiItem.note ?? '-'} | Tanggal Transaksi | : | - {formatDate(initialValues?.expense_date, 'DD MMMM YYYY')} + {formatDate( + initialValues?.transaction_date, + 'DD MMMM YYYY' + )} | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Nonstock | Total Kuantitas | -Total Biaya | +Harga Satuan | Catatan | |||||||||||||
| {pengajuanItem.nonstock.name} | {pengajuanItem.qty} | -- {formatCurrency(pengajuanItem.total_price)} - | +{formatCurrency(pengajuanItem.price)} | {pengajuanItem.note ?? '-'} | diff --git a/src/components/pages/expense/ExpensesTable.tsx b/src/components/pages/expense/ExpensesTable.tsx index 3a50f233..bbcb6c4e 100644 --- a/src/components/pages/expense/ExpensesTable.tsx +++ b/src/components/pages/expense/ExpensesTable.tsx @@ -263,11 +263,11 @@ const ExpensesTable = () => { }, }, { - accessorKey: 'expense_date', + accessorKey: 'transaction_date', header: 'Tanggal Pengajuan', cell: (props) => - props.row.original.expense_date - ? formatDate(props.row.original.expense_date, 'DD MMM YYYY') + props.row.original.transaction_date + ? formatDate(props.row.original.transaction_date, 'DD MMM YYYY') : '-', }, { diff --git a/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts b/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts index 863238b9..77db761c 100644 --- a/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts +++ b/src/components/pages/expense/form/ExpenseRealizationForm.schema.ts @@ -27,7 +27,7 @@ type ExpenseRealizationFormSchemaType = { label: string; }; quantity?: number; - total_cost?: number; + price?: number; notes?: string; }[]; }[]; @@ -82,7 +82,7 @@ export const ExpenseRealizationFormSchema: Yup.ObjectSchema|||||||||||||
| Nonstock | Total Kuantitas | -Total Biaya | +Harga Satuan | Catatan |
- {(formik.values.cost_per_kandangs.length === 0 ||
+ {(formik.values.expense_nonstocks.length === 0 ||
!formik.values.supplier?.value) && (
@@ -122,9 +122,9 @@ const ExpenseRequestKandangDetailExpense: React.FC< Nonstock |
Total Kuantitas |
- Total Biaya |
+ Harga Satuan |
Catatan |
{type !== 'detail' && Aksi | }
| |