2
0
mirror of https://github.com/frappe/books.git synced 2025-01-03 07:12:21 +00:00

Merge pull request #994 from AbleKSaju/fix-recursive-prule

fix: recursive free item in pricing rule
This commit is contained in:
Akshay 2024-10-29 09:44:31 +05:30 committed by GitHub
commit 0778752048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1091,8 +1091,15 @@ export default defineComponent({
(val) => val.isFreeItem
).length;
const recursivePricingRules = hasPricingRules?.filter(
(val) => val.pricingRule.isRecursive
);
setTimeout(async () => {
if (appliedPricingRuleCount !== hasPricingRules?.length) {
if (
appliedPricingRuleCount !== hasPricingRules?.length ||
recursivePricingRules
) {
await this.sinvDoc.appendPricingRuleDetail(hasPricingRules);
await this.sinvDoc.applyProductDiscount();
}