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

Discount Amount Cleared When Modifying Item Rate in Quotation #45046

Open
kanedai opened this issue Jan 2, 2025 · 7 comments
Open

Discount Amount Cleared When Modifying Item Rate in Quotation #45046

kanedai opened this issue Jan 2, 2025 · 7 comments
Assignees
Labels

Comments

@kanedai
Copy link

kanedai commented Jan 2, 2025

Information about Bug:

When creating a Quotation or other price-related documents, modifying the Rate field in the Items child table causes an issue:

  1. Change the Rate of an item (e.g., from 2200 to 2000).
  2. The system automatically calculates and populates the discount_amount field based on the difference.
  3. Upon clicking Save, the discount_amount field is cleared.
  4. This results in the price reverting to the original price set in the price list, disregarding the manual rate adjustment.

Steps to Reproduce:

  1. Open a Quotation or similar price-related document.
  2. In the Items table, modify the Rate field for any item.
  3. Observe that the discount_amount is populated correctly.
  4. Click Save and check the discount_amount and Rate fields.

Expected Behavior:
After saving, the discount_amount and the manually modified Rate should be retained, and the final price calculation should reflect these adjustments.

Actual Behavior:
The discount_amount is cleared, and the Rate reverts to the original value from the price list.

Module

other

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

erpnext 15.47.3
frappe 15.51.1
@kanedai kanedai added the bug label Jan 2, 2025
@perotom
Copy link

perotom commented Jan 2, 2025

Same with invoices. We are not able to bill anything as discounts are not working.

ERPNext: v15.47.3 (version-15)
Frappe Framework: v15.51.1 (version-15)

@dsridhar17
Copy link

dsridhar17 commented Jan 2, 2025

Same issue
When a discount is added to the sales quotation and saved, the discount gets reset to 0.
ERPNEXT Version 15
Frappe version 15
Deployed on Frappe Cloud
Please resolve this as soon as possible as workflows are blocked.
Fyi no Pricing Rule is implemented, the discount is added case by case in each quotation.

@donnieferdian
Copy link

same issue,.. i hope it will be fix soon,..

@SvbZ3r0
Copy link
Contributor

SvbZ3r0 commented Jan 6, 2025

@rohitwaghchaure This is a critical issue which breaks invoicing workflows. Is there a way to downgrade to a previous version until this is fixed?

@mihir-kandoi mihir-kandoi self-assigned this Jan 6, 2025
@mihir-kandoi
Copy link
Contributor

Unable to reproduce on develop, version-15-hotfix and version-15

Please provide a screen recording of this issue.

@rknroot
Copy link

rknroot commented Jan 6, 2025

Hi, we also faced same problem. after updating to v15.47.5 working fine.

@SvbZ3r0
Copy link
Contributor

SvbZ3r0 commented Jan 6, 2025

Problem still exists in v15.47.5.

@mihir-kandoi
Steps to replicate

  1. Create new Purchase Invoice
  2. Choose Supplier, and fill in all necessary fields
  3. Add an Item which has existing Item Price such that the rate field is autopopulated
  4. Edit rate field to a lower amount (Increasing price doesn't trigger this error)
  5. Check if discount is set
  6. Edit the posting_date
  7. discount field is reset, and rate field goes back to original price
Screen.Recording.2025-01-06.191304.mp4

I'm not sure if there are other ways to trigger this, but this way is completely replicable.

Another thing I noticed while debugging this:

  1. Add an Item which has existing Item Price such that the rate field is autopopulated
  2. Edit rate field to a lower amount
  3. Check if discount is set
  4. Edit rate field to a higher amount
  5. margin field is set, but discount field is not reset.

Not sure if that is related, but I found that odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants