Skip to content

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

Merged
nextchamp-saqib merged 18 commits into
frappe:developfrom
AfshanKhan:consider-rejected-quantity-for-purchase-invoice
Jun 24, 2021
Merged

feat: fetching of qty as per received qty from PR to PI#25837
nextchamp-saqib merged 18 commits into
frappe:developfrom
AfshanKhan:consider-rejected-quantity-for-purchase-invoice

Conversation

@AfshanKhan

@AfshanKhan AfshanKhan commented May 25, 2021

Copy link
Copy Markdown
Contributor

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

Comment thread erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@coveralls

coveralls commented May 26, 2021

Copy link
Copy Markdown

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.

Comment thread erpnext/buying/doctype/buying_settings/buying_settings.json Outdated
Comment thread erpnext/buying/doctype/buying_settings/buying_settings.json Outdated
@nextchamp-saqib

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread erpnext/controllers/accounts_controller.py Outdated
@nextchamp-saqib nextchamp-saqib changed the base branch from version-13-hotfix to develop June 21, 2021 05:52
@nextchamp-saqib

nextchamp-saqib commented Jun 21, 2021

Copy link
Copy Markdown
Member

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

Comment thread erpnext/controllers/accounts_controller.py Outdated
Comment thread erpnext/controllers/accounts_controller.py Outdated
@AfshanKhan

Copy link
Copy Markdown
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
Copy Markdown
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants