fix: get tax formula active only #109

Merged
irfan merged 1 commits from development into production 2024-10-14 19:18:00 +00:00
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {
TransactionBundlingItemEntity,
TransactionItemEntity,
} from '../../entities/transaction-item.entity';
import { STATUS } from 'src/core/strings/constants/base.constants';
@Injectable()
export class PriceCalculator {
@ -87,7 +88,11 @@ export class PriceCalculator {
profit_share: profitShare,
};
const dpp = await this.formulaService.salesPriceFormula();
const taxFormula = await this.taxService.getManyByOptions({});
const taxFormula = await this.taxService.getManyByOptions({
where: {
status: STATUS.ACTIVE,
},
});
const shareFormulas = await this.formulaService.profitShareFormula();
const taxShareFormulas = shareFormulas.map((formula) => {
return {