-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(anrok): return zero-tax breakdown if client facing taxes sum is 0 (…
…#2797) ## Context If taxes are payable by seller, line_items.tax_amount_cents will be 0, but tax_breakdown might be not 0 (these taxes the seller will pay), so we don't need to create applied taxes if in taxes returned from the tax provider, the tax_amount_cents of the line_item is 0 ## Description updated `Invoice::ApplyProviderTaxes` and `Fee::ApplyProviderTaxes` to create zero-taxes if fee.tax_amount_cents is 0, but tax_breakdown contains some taxes;
- Loading branch information
1 parent
347506b
commit c308ead
Showing
5 changed files
with
156 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
spec/fixtures/integration_aggregator/taxes/invoices/success_response_seller_pays_taxes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"succeededInvoices": [ | ||
{ | ||
"issuing_date": "2024-03-07", | ||
"sub_total_excluding_taxes": 9900, | ||
"taxes_amount_cents": 0, | ||
"currency": "USD", | ||
"contact": { | ||
"external_id": "cus_lago_12345", | ||
"name": "John Doe", | ||
"taxable": true, | ||
"tax_number": "1234567890" | ||
}, | ||
"fees": [ | ||
{ | ||
"item_id": "lago_fee_id", | ||
"item_code": "lago_default_b2b", | ||
"amount_cents": 9900, | ||
"tax_amount_cents": 0, | ||
"tax_breakdown": [ | ||
{ | ||
"name": "GST/HST", | ||
"rate": "0.10", | ||
"tax_amount": 990, | ||
"type": "tax_exempt" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"failedInvoices": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters