refactor(FE): Consolidate date filters into trans_date

This commit is contained in:
rstubryan
2026-02-05 14:28:14 +07:00
parent fb1b310d1d
commit 92886fe5e2
2 changed files with 5 additions and 15 deletions
@@ -60,8 +60,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
const dataTypeOptions = useMemo(
() => [
{ value: 'do_date', label: 'Tanggal Jual' },
{ value: 'payment_date', label: 'Tanggal Bayar' },
{ value: 'trans_date', label: 'Tanggal Jual/Bayar' },
{ value: 'realization_date', label: 'Tanggal Realisasi' },
],
[]
@@ -182,10 +181,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
// filterSales.length > 0
// ? filterSales.map((v) => String(v.value)).join(',')
// : undefined,
filter_by: filterByType.value as
| 'do_date'
| 'payment_date'
| 'realization_date',
filter_by: filterByType.value as 'trans_date' | 'realization_date',
start_date: filterStartDate || undefined,
end_date: filterEndDate || undefined,
page: currentPage,
@@ -228,10 +224,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
// filterSales.length > 0
// ? filterSales.map((v) => String(v.value)).join(',')
// : undefined,
filter_by: filterByType.value as
| 'do_date'
| 'payment_date'
| 'realization_date',
filter_by: filterByType.value as 'trans_date' | 'realization_date',
start_date: filterStartDate || undefined,
end_date: filterEndDate || undefined,
limit: 100,
@@ -310,10 +303,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
// : undefined,
start_date: filterStartDate || undefined,
end_date: filterEndDate || undefined,
filter_by: filterByType.value as
| 'do_date'
| 'payment_date'
| 'realization_date',
filter_by: filterByType.value as 'trans_date' | 'realization_date',
},
});
toast.success('PDF berhasil dibuat dan diunduh.');
+1 -1
View File
@@ -15,7 +15,7 @@ export class FinanceApiService extends BaseApiService<
customer_ids?: string,
// TODO: Uncomment when BE is ready
// sales_id?: string,
filter_by?: 'do_date' | 'payment_date' | 'realization_date',
filter_by?: 'trans_date' | 'realization_date',
start_date?: string,
end_date?: string,
page?: number,