feat: resolve taxes for product fees - #6256
Conversation
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — Draft product invoices are not invalidated when an assigned rate-card tax itself is updated or deleted.
|
| billing_entity_taxes(customer.billing_entity_id) | ||
| end | ||
|
|
||
| def product_taxes |
There was a problem hiding this comment.
it's not the scope of this PR but the previous applicable_taxes is a bit problematic already. We perform the ApplyTaxesService and accidentally does a N+1 https://github.com/getlago/lago-api/blob/main/app/services/invoices/compute_amounts_from_fees.rb#L20. I'd add a task in Linear to tackle this and avoid continue with the same issue for product_taxes.
| @taxes_by_code ||= rate_card.organization.taxes.where(code: tax_codes).index_by(&:code) | ||
| end | ||
|
|
||
| def refresh_draft_invoices |
There was a problem hiding this comment.
question also for @rsempe @brunomiguelpinto do we need to apply the refresh for the rate_override as well?
There was a problem hiding this comment.
no extra refresh needed: overrides carry no taxes of their own (taxes are just on the card, right?)
There was a problem hiding this comment.
I see, in this case what is the rule to apply taxes? I thought was because of the pricing in properties.
|
Should we have to add |
69c9411 to
0fb2578
Compare
0fb2578 to
7e5a8c9
Compare
7e5a8c9 to
1f7ff43
Compare
Context
Part of the "products and plans" project.
Product fees did not resolve taxes from rate cards.
Description