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:
jtricerolph 2026-09-21 10:50:06 +00:00
parent b750004714
commit af1560d58f
3 changed files with 11 additions and 4 deletions

View file

@ -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)