mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 23:30:32 +00:00
fix(server): tax percentage calculation of tax sales liability summary report
This commit is contained in:
@@ -55,8 +55,9 @@ export class SalesTaxLiabilitySummary extends FinancialSheet {
|
|||||||
const salesTaxAmount = salesTax ? salesTax.credit - salesTax.debit : 0;
|
const salesTaxAmount = salesTax ? salesTax.credit - salesTax.debit : 0;
|
||||||
|
|
||||||
// Calculates the tax percentage.
|
// Calculates the tax percentage.
|
||||||
const taxPercentage = salesTaxAmount / payableTaxAmount;
|
const taxPercentage = R.compose(
|
||||||
const taxPercentageRate = taxPercentage / 100;
|
R.unless(R.equals(0), R.divide(R.__, salesTaxAmount))
|
||||||
|
)(payableTaxAmount);
|
||||||
|
|
||||||
// Calculates the payable tax amount.
|
// Calculates the payable tax amount.
|
||||||
const collectedTaxAmount = payableTax ? payableTax.debit : 0;
|
const collectedTaxAmount = payableTax ? payableTax.debit : 0;
|
||||||
@@ -66,7 +67,7 @@ export class SalesTaxLiabilitySummary extends FinancialSheet {
|
|||||||
taxName: `${taxRate.name} (${taxRate.rate}%)`,
|
taxName: `${taxRate.name} (${taxRate.rate}%)`,
|
||||||
taxableAmount: this.getAmountMeta(salesTaxAmount),
|
taxableAmount: this.getAmountMeta(salesTaxAmount),
|
||||||
taxAmount: this.getAmountMeta(payableTaxAmount),
|
taxAmount: this.getAmountMeta(payableTaxAmount),
|
||||||
taxPercentage: this.getPercentageAmountMeta(taxPercentageRate),
|
taxPercentage: this.getPercentageTotalAmountMeta(taxPercentage),
|
||||||
collectedTaxAmount: this.getAmountMeta(collectedTaxAmount),
|
collectedTaxAmount: this.getAmountMeta(collectedTaxAmount),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user