Show refunds as refunds in transaction breakdown checklist
Refunds were rendered like payments (abs value, no marker). Backend now flags items with is_refund from NewBook item_type (refunds_raised / refunds_voided) and labels the type '-refund'; frontend shows them in red with a leading minus. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
b750004714
commit
af1560d58f
3 changed files with 11 additions and 4 deletions
|
|
@ -279,7 +279,8 @@ export function parseTransactionBreakdown(rawData) {
|
|||
const desc = t.item_description || ''
|
||||
const payType = t.payment_type || ''
|
||||
const isVoided = t.item_type === 'payments_voided' || t.item_type === 'refunds_voided'
|
||||
const displayType = isVoided ? payType + ' -void' : payType
|
||||
const isRefund = t.item_type === 'refunds_raised' || t.item_type === 'refunds_voided'
|
||||
const displayType = (isRefund ? payType + ' -refund' : payType) + (isVoided ? ' -void' : '')
|
||||
const category = categorise(payType)
|
||||
|
||||
const item = {
|
||||
|
|
@ -288,6 +289,7 @@ export function parseTransactionBreakdown(rawData) {
|
|||
details: '',
|
||||
amount: parseFloat(t.item_amount || 0),
|
||||
is_voided: isVoided,
|
||||
is_refund: isRefund,
|
||||
}
|
||||
|
||||
const ticketMatch = desc.match(/^Ticket:\s*(\d+)\s*-\s*(.+)$/i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue