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: GL Entries not getting created for PR Return #37513

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

s-aga-r
Copy link
Contributor

@s-aga-r s-aga-r commented Oct 15, 2023

Source / Ref: 4388

Issue: Accounting Entries (GL Entries) not getting created for Purchase Return with 0 Rate, creating a difference between stock and account.

Steps to Reproduce:

  • Create a Purchase Receipt ex. Qty = 5, Rate = 100.
  • Create a Purchase Return ex. Qty = -5, Rate = 0.
  • Check the SLE and GL Entries

Typically, the return rate matches the purchase rate. For instance, let's consider an example where the Valuation Method is set to Moving Average. The current Purchase Rate is 0, and the Moving Average is 50. When you initiate a Purchase Return, the rate will remain at 0. This action will result in a stock adjustment of -250 units (calculated as -5 * 50), and no GL Entries will be generated which will create a difference of 250.

Purchase Receipt:

image

Purchase Return:

image

Before:

image

After:

image

@s-aga-r s-aga-r added the backport version-14-hotfix backport to version 14 label Oct 15, 2023
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Oct 15, 2023
@s-aga-r s-aga-r removed the needs-tests This PR needs automated unit-tests. label Oct 15, 2023
@s-aga-r s-aga-r marked this pull request as ready for review October 15, 2023 19:02
@s-aga-r s-aga-r merged commit 0f6d67d into frappe:develop Oct 15, 2023
10 of 12 checks passed
s-aga-r added a commit that referenced this pull request Oct 15, 2023
…37516)

* fix: GL Entries not getting created for PR Return

(cherry picked from commit 46add06)

* test: add test case for PR return with zero rate

(cherry picked from commit 253d478)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Oct 19, 2023
## [14.44.1](v14.44.0...v14.44.1) (2023-10-19)

### Bug Fixes

* billed_qty to show a sum of all invoiced qty from the purchase order item. (backport [#37539](#37539)) ([#37558](#37558)) ([ac7d6d6](ac7d6d6))
* consider received qty while creating SO -> MR (backport [#37414](#37414)) ([#37514](#37514)) ([1b94510](1b94510))
* don't set finance books if gross_purchase_amount is not set (backport [#37480](#37480)) ([#37482](#37482)) ([0590f21](0590f21))
* e-commerce permissions for address ([#37554](#37554)) ([022f85d](022f85d))
* german tranlations of "Is Return" ([f9b2355](f9b2355))
* GL Entries not getting created for PR Return (backport [#37513](#37513)) ([#37516](#37516)) ([c32258e](c32258e))
* **gp:** wrong `allocated_amount` on multi sales person invoice ([d266423](d266423))
* Incorrect vat amount in KSA VAT report ([44f7de0](44f7de0))
* inflated total amt in TDS report using back calculation ([78e22af](78e22af))
* Issues related to RFQ and Supplier Quotation on Portal (backport [#37565](#37565)) ([#37577](#37577)) ([e1504ef](e1504ef))
* keep customer/supplier website role by default ([76ef61c](76ef61c))
* keyerror on gl and pl comparision report ([6f143d3](6f143d3))
* payment entry count on supplier dashboard (backport [#37571](#37571)) ([#37575](#37575)) ([95abd79](95abd79))
* same Serial No get mapped while creating SO -> DN ([#37527](#37527)) ([5025850](5025850))
* serial and batch no get removed on save of return DN ([#37476](#37476)) ([f1814a1](f1814a1))
* Stock Reconciliation Insufficient Stock Error ([#37494](#37494)) ([9406ddb](9406ddb))
* **test:** project test case (backport [#37541](#37541)) ([#37543](#37543)) ([e23710b](e23710b))
* use `flt` to ignore TypeError ([#37481](#37481)) ([d2b22db](d2b22db))

### Performance Improvements

* index `dn_detail` in `Delivery Note Item` (backport [#37528](#37528)) ([#37530](#37530)) ([001c230](001c230))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant