mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 21:41:57 +00:00
refactor(FE): Update customer payment types and exports
This commit is contained in:
@@ -284,7 +284,7 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
|
||||
<View style={[pdfStyles.tableCellHeader, { flex: 0.8 }]}>
|
||||
<Text>Aging</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellHeader, { flex: 1 }]}>
|
||||
<View style={[pdfStyles.tableCellHeader, { flex: 1.5 }]}>
|
||||
<Text>Referensi</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellHeader, { flex: 1.2 }]}>
|
||||
@@ -305,9 +305,6 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
|
||||
<View style={[pdfStyles.tableCellHeaderRight, { flex: 1.2 }]}>
|
||||
<Text>Harga Akhir</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellHeaderRight, { flex: 0.8 }]}>
|
||||
<Text>Pajak</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellHeaderRight, { flex: 1.2 }]}>
|
||||
<Text>Total</Text>
|
||||
</View>
|
||||
@@ -361,7 +358,7 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
|
||||
{item.aging_day ? formatNumber(item.aging_day) : '-'} hari
|
||||
</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1 }]}>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1.5 }]}>
|
||||
<Text>{item.reference || '-'}</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1.2 }]}>
|
||||
@@ -435,7 +432,7 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
|
||||
<View style={[pdfStyles.tableCell, { flex: 0.8 }]}>
|
||||
<Text></Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1 }]}>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1.5 }]}>
|
||||
<Text></Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCell, { flex: 1.2 }]}>
|
||||
@@ -453,20 +450,13 @@ const createPDFDocument = (params: CustomerPaymentExportPDFParams) => {
|
||||
<Text></Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellRight, { flex: 1.2 }]}>
|
||||
<Text>
|
||||
{formatCurrency(
|
||||
customerReport.summary.total_initial_amount
|
||||
)}
|
||||
</Text>
|
||||
<Text></Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellRight, { flex: 1.2 }]}>
|
||||
<Text>
|
||||
{formatCurrency(customerReport.summary.total_final_amount)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellRight, { flex: 0.8 }]}>
|
||||
<Text></Text>
|
||||
</View>
|
||||
<View style={[pdfStyles.tableCellRight, { flex: 1.2 }]}>
|
||||
<Text>
|
||||
{formatCurrency(customerReport.summary.total_grand_amount)}
|
||||
|
||||
@@ -32,7 +32,9 @@ export const generateCustomerPaymentExcel = (
|
||||
: '',
|
||||
Aging: formatNumber(item.aging_day || 0),
|
||||
Referensi: item.reference || '',
|
||||
'Nomor Polisi': item.vehicle_numbers || '',
|
||||
'Nomor Polisi': Array.isArray(item.vehicle_numbers)
|
||||
? item.vehicle_numbers.join(', ')
|
||||
: '',
|
||||
'Ekor/Qty': formatNumber(item.qty || 0),
|
||||
'Berat (Kg)': formatNumber(item.weight || 0),
|
||||
AVG: formatNumber(item.average_weight || 0),
|
||||
@@ -42,7 +44,9 @@ export const generateCustomerPaymentExcel = (
|
||||
Pembayaran: formatCurrency(item.payment_amount || 0),
|
||||
'Saldo Piutang': formatCurrency(item.accounts_receivable || 0),
|
||||
Keterangan: item.status || '',
|
||||
Pengambilan: item.pickup_info || '',
|
||||
Pengambilan: Array.isArray(item.pickup_info)
|
||||
? item.pickup_info.join(', ')
|
||||
: '',
|
||||
'Sales/Marketing': item.sales_person || '',
|
||||
})
|
||||
);
|
||||
@@ -58,9 +62,7 @@ export const generateCustomerPaymentExcel = (
|
||||
'Ekor/Qty': formatNumber(customerReport.summary.total_qty || 0),
|
||||
'Berat (Kg)': formatNumber(customerReport.summary.total_weight || 0),
|
||||
AVG: '',
|
||||
'Harga Awal': formatCurrency(
|
||||
customerReport.summary.total_initial_amount || 0
|
||||
),
|
||||
'Harga Awal': '',
|
||||
'Harga Akhir': formatCurrency(
|
||||
customerReport.summary.total_final_amount || 0
|
||||
),
|
||||
|
||||
@@ -412,9 +412,7 @@ const CustomerPaymentTab = () => {
|
||||
return <div className='text-right'>{formatCurrency(value)}</div>;
|
||||
},
|
||||
footer: () => (
|
||||
<div className='text-right font-semibold text-gray-900'>
|
||||
{formatCurrency(summary.total_initial_amount) || '-'}
|
||||
</div>
|
||||
<div className='text-right font-semibold text-gray-900'>-</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -510,7 +508,7 @@ const CustomerPaymentTab = () => {
|
||||
status: getPaymentStatusIndicatorColor(value),
|
||||
}}
|
||||
>
|
||||
{getPaymentStatusText(value)}
|
||||
<span>{getPaymentStatusText(value)}</span>
|
||||
</Badge>
|
||||
);
|
||||
},
|
||||
@@ -729,8 +727,6 @@ const CustomerPaymentTab = () => {
|
||||
const summary = customerReport.summary || {
|
||||
total_qty: 0,
|
||||
total_weight: 0,
|
||||
total_initial_amount: 0,
|
||||
total_credit_note: 0,
|
||||
total_final_amount: 0,
|
||||
total_grand_amount: 0,
|
||||
total_payment: 0,
|
||||
|
||||
+3
-4
@@ -7,7 +7,7 @@ export type CustomerPaymentRow = {
|
||||
trans_date: string;
|
||||
delivery_date: string | null;
|
||||
reference: string;
|
||||
vehicle_numbers: string;
|
||||
vehicle_numbers: string[];
|
||||
qty: number;
|
||||
weight: number;
|
||||
average_weight: number;
|
||||
@@ -16,16 +16,15 @@ export type CustomerPaymentRow = {
|
||||
total_price: number;
|
||||
payment_amount: number;
|
||||
accounts_receivable: number;
|
||||
aging_day: number;
|
||||
aging_day: number | null;
|
||||
status: string;
|
||||
pickup_info: string;
|
||||
pickup_info: string[];
|
||||
sales_person: string;
|
||||
};
|
||||
|
||||
export type CustomerPaymentSummary = {
|
||||
total_qty: number;
|
||||
total_weight: number;
|
||||
total_initial_amount: number;
|
||||
total_final_amount: number;
|
||||
total_grand_amount: number;
|
||||
total_payment: number;
|
||||
|
||||
Reference in New Issue
Block a user