2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix: recursive free item in pricing rule, ensuring free item quantity increases when condition is met

This commit is contained in:
AbleKSaju 2024-10-23 12:39:31 +05:30
parent 0d967c1015
commit b5f49147db

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();
}