Skip to content

Commit

Permalink
improve log for non zero line (#1663)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski authored Dec 17, 2024
1 parent bb269a5 commit 5648721
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ export class AvataxCalculateTaxesAdapter {
transformedResponse.lines.forEach((l) => {
const tax = l.total_gross_amount - l.total_net_amount;
const rate = l.tax_rate;
const lineIsZero = l.total_net_amount === 0 ?? l.total_gross_amount === 0;

if (tax === 0 && rate !== 0) {
this.logger.warn("Line has zero tax, but rate is not zero", {
if (tax === 0 && rate !== 0 && !lineIsZero) {
this.logger.warn("Non-zero line has zero tax, but rate is not zero", {
taxCalculationSummary: response.summary,
});
}
Expand Down

0 comments on commit 5648721

Please sign in to comment.