Skip to content

Conversation

brunomiguelpinto
Copy link
Contributor

@brunomiguelpinto brunomiguelpinto commented Aug 26, 2025

Context

Progressive billing credits were being distributed across all invoice fees, regardless of whether a fee belonged to the same charge as the progressive billing invoice.

Description

This PR updates Credits::ProgressiveBillingService so that credits from a progressive billing invoice are only applied to matching fees on the target invoice (same charge_id/context), instead of being spread across all fees.

This change was needed so that when we apply the credits from the wallet, we need to know the remaining fee, removing the progressive billing part

This issue would be more evident if we had multiple wallets, and some of them only applied to specific fees, the amount we need to take would not be correct (because the calculations would be affected by the progressive billing )

@brunomiguelpinto brunomiguelpinto marked this pull request as draft August 26, 2025 13:46
@brunomiguelpinto brunomiguelpinto self-assigned this Aug 26, 2025
@brunomiguelpinto brunomiguelpinto added the Invoice Related to Invoices label Aug 26, 2025
@brunomiguelpinto brunomiguelpinto marked this pull request as ready for review August 27, 2025 17:18
@brunomiguelpinto brunomiguelpinto merged commit b3a1518 into main Aug 28, 2025
14 checks passed
@brunomiguelpinto brunomiguelpinto deleted the fix-apply-credits-fees branch August 28, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invoice Related to Invoices
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants