Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pos): add item in the existing item row when discount is applied #45447

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

venkat102
Copy link
Contributor

Issue:
The item is added to the new row when the discount is applied.
ref: 25597

Before:

pos-qty-issue.mp4

After:

pos-qty-fix.mp4

Backport needed for v14 & v15

@venkat102 venkat102 marked this pull request as ready for review January 27, 2025 17:26
@ruthra-kumar ruthra-kumar self-assigned this Jan 28, 2025
@ruthra-kumar ruthra-kumar self-requested a review January 28, 2025 05:34
@ruthra-kumar
Copy link
Member

@venkat102
What is the root cause here?

@ruthra-kumar
Copy link
Member

Also could you post some replication steps

@venkat102
Copy link
Contributor Author

@venkat102 What is the root cause here?

When there is a pricing rule to apply the discount on an item with a quantity of more than 3, In POS, the discount is applied when the 3rd is added. But the 4th item was added in a separate row.

This is because the item matches the existing row based on item_code, batch_no, uom, and rate. Since the discount is applied to the existing row, there will be a mismatch in the rate. So, the new item is added in a separate row. Also, the discount is not applied to the new item as the item quantity didn't reach the pricing rule limit.

@venkat102
Copy link
Contributor Author

Also could you post some replication steps

Steps to replicate:

  • create a pricing rule to apply a discount on a item, when the qty reaches a limit (minimum qty of 3)
    image

  • Open POS Invoice and add the item by clicking the item from the item list (it works fine when the qty is edited manually)

  • When it reaches the minimum qty, a discount will be applied and the next item will be added to the new row without a discount

@ruthra-kumar ruthra-kumar merged commit 98e727a into frappe:develop Feb 5, 2025
11 of 12 checks passed
ruthra-kumar added a commit that referenced this pull request Feb 5, 2025
…-45447

fix(pos): add item in the existing item row when discount is applied (backport #45447)
ruthra-kumar added a commit that referenced this pull request Feb 5, 2025
…-45447

fix(pos): add item in the existing item row when discount is applied (backport #45447)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants