Table of Contents

#39 — after refunding nothing changes in the dashboard (Resolved)

← Back to Manara Bugs · View issue #39 in MantisBT


Reported by: Nour aboulhosn on 2026-07-25T11:15:39+01:00
Assigned to: Walid Hamdan
Resolved by: Walid Hamdan on 2026-07-25T11:41:23+01:00
Severity: major
Priority: normal
Reproducibility: always
Category: General

Description: in the refund and credits the records are right and the status or type is refund which is right and the refunded amount is correct, but after checking the total in the main dashboard nothing has changed even though we just refunded a specific amount.

Steps to Reproduce: After creating an active customer with an active subscription, i checked if the payment is recorded which is positive then i decided to refund his payment, it went through smoothly but after checking the dashboard and taking screenshots of it to see if any changes have occurred i realized that the amount that was refunded wasn't substracted from the net liquidity.

Resolution: In CreditNoteController, recording a refund is a plain INSERT INTO credit_notes — refunds are deliberately kept in their own separate audit ledger table, never touching the payments table or the invoice's paid amount (this is by original design, not an oversight — refunds structurally can't be negative payments in this schema). The problem is that Payment::sumBetween()/sumSeries() — the exact queries behind “Total Paid” and “Net Liquidity” on the dashboard — only ever summed the payments table and had zero knowledge that credit_notes existed. So a refund was recorded correctly and looked right on the Credit Notes page, but was completely invisible to every dashboard figure derived from “Total Paid.” Fixed by having those two payment-summing methods also subtract refund amounts from credit_notes (keyed by the day the refund itself was recorded), so Net Liquidity, the Financial Trends chart, and the AI report all now reflect refunds automatically.

Activity / Notes

Full History

Date User Field Change
2026-07-25T11:15:39+01:00 Nour aboulhosn issue-new New Issue
2026-07-25T11:41:23+01:00 Walid Hamdan Status new ⇒ resolved
2026-07-25T11:41:23+01:00 Walid Hamdan note-added Note Added: 0000003
2026-07-25T11:42:16+01:00 Walid Hamdan note-updated Note Edited: 0000003
2026-07-25T11:43:08+01:00 Walid Hamdan Assigned To ⇒ whamdan

Synced automatically from MantisBT issue #39.