Skip to content

Commit

Permalink
correct logic for existing tax code
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed Jul 16, 2024
1 parent 04f31e0 commit 81bc5b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ValidationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function isExistingTaxName(taxName: string, taxRates: TaxRates): boolean {

function isExistingTaxCode(taxCode: string, taxRates: TaxRates): boolean {
const trimmedTaxCode = taxCode.trim();
return !!Object.values(taxRates).find((taxRate) => taxRate.code === trimmedTaxCode);
return !!Object.keys(taxRates).find((taxID) => taxID === trimmedTaxCode);
}

/**
Expand Down

0 comments on commit 81bc5b0

Please sign in to comment.