Skip to content

Commit

Permalink
improve suspicious tax log (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski authored Dec 17, 2024
1 parent 2b45d2b commit 9b63c59
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export class AvataxCalculateTaxesAdapter {
const transformedResponse = this.avataxCalculateTaxesResponseTransformer.transform(response);

transformedResponse.lines.forEach((l) => {
const tax = (l.total_gross_amount - l.total_net_amount);
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 9b63c59

Please sign in to comment.