fix: get tax formula active only
continuous-integration/drone/push Build is passing Details

pull/109/head
shancheas 2024-10-15 02:17:13 +07:00
parent 55ddc9b605
commit c0a0b2316d
1 changed files with 6 additions and 1 deletions

View File

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