Merge branch 'fix/void-refunded'

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
2026-11-17 13:34:19 +02:00
9 changed files with 92 additions and 11 deletions
+7
View File
@@ -168,6 +168,13 @@ router.delete('/payments/:id', wrap(async (req, res) => {
res.json({ message: `Payment ${payment.receiptNumber} removed.` });
}));
// The money went back to the church (2.0.2): kept on record, no longer counts as paid.
router.post('/payments/:id/refund', wrap(async (req, res) => {
const payment = await billing.refundPayment(req.params.id, { on: req.body?.on, note: req.body?.note });
await audit(req, 'payment_refunded', payment.id, { receipt: payment.receiptNumber, amountCents: payment.amountCents, invoice: payment.invoice?.number || null, note: payment.refundNote });
res.json({ message: `Payment ${payment.receiptNumber} marked as refunded.${payment.invoice ? ` ${payment.invoice.number} is owing again; you can void it now.` : ''}` });
}));
router.post('/payments/:id/resend', emailLimiter, wrap(async (req, res) => {
await billing.resendReceipt(req.params.id);
await audit(req, 'receipt_resent', req.params.id);