KamoCRM

Credit-balance pen sets an absolute target (mint up / invalidate down)

FixSecurityService
Shipped
30 ஜூலை, 2026 அன்று 3:50 PM UTC
Author
Kamo
Commit
11103d6

The Manage-Credits pen edit only ever LOWERED a balance: updateAllotment routed creditBalance to invalidateCreditsToTarget, which no-ops when target >= current. And on a member/product with no allotment row yet, save() POSTs to createAllotment, which ignored the numeric balance entirely. So edits only "worked" when reducing an existing allotment — the cause of "works for some members/vendors, not others." Add **************** reconcile the available balance to the entered value in BOTH directions — mint the shortfall (createCredits) when raising, invalidate the excess (invalidateCreditsToTarget, oldest-first) when lowering, no-op when equal. updateAllotment now uses it; createAllotment mints the starting balance for a fresh row. The pen is now the single add/remove control.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing