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

feat: fetching of qty as per received qty from PR to PI #25837

Conversation

AfshanKhan
Copy link
Contributor

@AfshanKhan AfshanKhan commented May 25, 2021

Added a checkbox "Consider Rejected Quantity For Purchase Invoice" in Buying Settings.

Screenshot 2021-05-25 at 11 32 47 PM

Purpose

Consider following Purchase Receipt.
Screenshot 2021-05-25 at 11 34 58 PM

When the checkbox is checked the Purchase Invoice from the above Purchase Receipt will consider Received Qty as Accepted Qty for Total Qty.
Screenshot 2021-05-25 at 11 37 17 PM

When the checkbox is not checked the Purchase Invoice from the above Purchase Receipt will consider Accepted Qty as Accepted Qty for Total Qty.
Screenshot 2021-05-25 at 11 36 13 PM

Documentation PR: frappe/erpnext_documentation#355

@coveralls
Copy link

coveralls commented May 26, 2021

Coverage Status

Coverage decreased (-0.04%) to 42.758% when pulling e1dcfef on AfshanKhan:consider-rejected-quantity-for-purchase-invoice into da66cef on frappe:develop.

@nextchamp-saqib
Copy link
Member

Unhandled case,

  • Purchase Receipt of 10 received qty, 2 rejected qty
  • Create Purchase Invoice with 5 accepted qty
  • Create another Invoice it will fetch accepted qty as 10, instead, it should have been 5

You can check the previous behaviour by unchecking the consider_rejected_quantity_for_purchase_invoice checkbox

@AfshanKhan
Copy link
Contributor Author

Unhandled case,

  • Purchase Receipt of 10 received qty, 2 rejected qty
  • Create Purchase Invoice with 5 accepted qty
  • Create another Invoice it will fetch accepted qty as 10, instead, it should have been 5

You can check the previous behaviour by unchecking the consider_rejected_quantity_for_purchase_invoice checkbox

Added the fix for this

@nextchamp-saqib nextchamp-saqib changed the base branch from version-13-hotfix to develop June 21, 2021 05:52
@nextchamp-saqib
Copy link
Member

nextchamp-saqib commented Jun 21, 2021

Another Case to fix:

  • Purchase Receipt created for 10 received qty, 8 accepted qty, 2 rejected qty
  • Trying to create a return using Create -> Purchase Return button, change received qty to -4, and accepted qty to -4, then saved & submit the return
  • Now create an Invoice against the original receipt, the qty is fetched as 10 and the invoice can be submitted too.
  • If you submit the invoice, the billed amount is for 10 qty while it shouldn't have been possible to bill amount more than 10 - returned qty = 6 qty

P.S: This case is handled if consider_rejected_quantity_for_purchase_invoice is unchecked

erpnext/controllers/accounts_controller.py Outdated Show resolved Hide resolved
erpnext/controllers/accounts_controller.py Outdated Show resolved Hide resolved
@AfshanKhan
Copy link
Contributor Author

Another Case to fix:

  • Purchase Receipt created for 10 received qty, 8 accepted qty, 2 rejected qty
  • Trying to create a return using Create -> Purchase Return button, change received qty to -4, and accepted qty to -4, then saved & submit the return
  • Now create an Invoice against the original receipt, the qty is fetched as 10 and the invoice can be submitted too.
  • If you submit the invoice, the billed amount is for 10 qty while it shouldn't have been possible to bill amount more than 10 - returned qty = 6 qty

P.S: This case is handled if consider_rejected_quantity_for_purchase_invoice is unchecked

Fixed

@nextchamp-saqib nextchamp-saqib merged commit 53fefd7 into frappe:develop Jun 24, 2021
@nextchamp-saqib
Copy link
Member

@AfshanKhan You can backport now on version-13-hotfix

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.

4 participants