Skip to content

fix: pricing rule(mixed condition)#164

Merged
maniamartial merged 3 commits into
developfrom
dev2
Apr 15, 2026
Merged

fix: pricing rule(mixed condition)#164
maniamartial merged 3 commits into
developfrom
dev2

Conversation

@balachandar-web

Copy link
Copy Markdown
Contributor

No description provided.

@maniamartial

Copy link
Copy Markdown
Contributor

The root problem was that mixed-condition pricing rules (rules that apply across multiple line items) weren't working because apply_pricing_rule was receiving doc=None and items with no unique identifiers.

Additionally, discounts were being applied twice, once on the frontend and once by ERPNext, leading to negative rates.

This PR fixes both by providing a proper mock document context, indexing items correctly, and ensuring the undiscounted price is always used as the base rate.

@maniamartial maniamartial merged commit f721075 into develop Apr 15, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants