mirror of
https://github.com/frappe/books.git
synced 2025-01-03 15:17:30 +00:00
fix: recursive free item in pricing rule, ensuring free item quantity increases when condition is met
This commit is contained in:
parent
0d967c1015
commit
b5f49147db
@ -1091,8 +1091,15 @@ export default defineComponent({
|
|||||||
(val) => val.isFreeItem
|
(val) => val.isFreeItem
|
||||||
).length;
|
).length;
|
||||||
|
|
||||||
|
const recursivePricingRules = hasPricingRules?.filter(
|
||||||
|
(val) => val.pricingRule.isRecursive
|
||||||
|
);
|
||||||
|
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
if (appliedPricingRuleCount !== hasPricingRules?.length) {
|
if (
|
||||||
|
appliedPricingRuleCount !== hasPricingRules?.length ||
|
||||||
|
recursivePricingRules
|
||||||
|
) {
|
||||||
await this.sinvDoc.appendPricingRuleDetail(hasPricingRules);
|
await this.sinvDoc.appendPricingRuleDetail(hasPricingRules);
|
||||||
await this.sinvDoc.applyProductDiscount();
|
await this.sinvDoc.applyProductDiscount();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user