feat: enhance payment status handling and summary in MyPaymentsPage
- Added support for 'partial' payment status in MyPaymentsPage and related components. - Updated API responses to include 'paid_rials' and 'summary' for invoices. - Introduced InvoicePaymentStatus service to derive payment status based on actual payments. - Enhanced tests to cover new payment scenarios including partial payments and payment methods. - Updated documentation to reflect changes in payment status and API responses.
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
const STATUS_OPTIONS = [
|
||||
{ value: '', label: 'همه وضعیتها' },
|
||||
{ value: 'paid', label: 'پرداخت شده' },
|
||||
{ value: 'partial', label: 'پرداخت ناقص' },
|
||||
{ value: 'unsettled', label: 'تسویه نشده' },
|
||||
];
|
||||
|
||||
@@ -108,7 +109,20 @@ export default function MyPaymentsPage() {
|
||||
header: 'تاریخ',
|
||||
render: (r) => <span dir="ltr">{formatDate(r.issued_at)} - {formatTime(r.issued_at)}</span>,
|
||||
},
|
||||
{ key: 'amount_rials', header: 'مبلغ', render: (r) => <span style={{ fontWeight: 600 }}>{formatRial(r.amount_rials)}</span> },
|
||||
{
|
||||
key: 'amount_rials',
|
||||
header: 'مبلغ',
|
||||
render: (r) => (
|
||||
<div>
|
||||
<div style={{ fontWeight: 600 }}>{formatRial(r.amount_rials)}</div>
|
||||
{r.status === 'partial' && (
|
||||
<div style={{ fontSize: 11.5, color: 'var(--text-3)', marginTop: 2 }}>
|
||||
پرداختشده: {formatRial(r.paid_rials)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{ key: 'status', header: 'وضعیت', render: (r) => <StatusBadge type="invoice" value={r.status} /> },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user