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: negative valuation rate in PR return #37424

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

s-aga-r
Copy link
Contributor

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

Source / Ref: 4290

Issue: Negative Valuation Rate in Purchase Receipt Return.

Steps to Replicate:

  • Create an Item (Valuation Method = Moving Average)
  • Create a Purchase Receipt (Qty = 10, Rate = 100)
  • Create a Material Receipt Stock Entry (Qty = 100, Basic Rate = 10) i.e., the Valuation Rate will be 18.18 after Submit.
  • Create a Material Issue Stock Entry (Qty = 100, Basic Rate = 18.18 [Auto Fetched])
  • Now, create a Return Purchase Return (Qty = -8, Rate = 100 [Auto fetched]). Check the Stock Ledger the Valuation Rate will be -309.09

Solution: Set the Outgoing Rate as the previous SLE Valuation Rate.

Before and After:

image

@github-actions github-actions bot added buying needs-tests This PR needs automated unit-tests. stock labels Oct 10, 2023
@s-aga-r s-aga-r removed the needs-tests This PR needs automated unit-tests. label Oct 10, 2023
@s-aga-r s-aga-r marked this pull request as ready for review October 10, 2023 18:02
@s-aga-r
Copy link
Contributor Author

s-aga-r commented Oct 11, 2023

unrelated failing test

@s-aga-r s-aga-r merged commit 26ad688 into frappe:version-14-hotfix Oct 11, 2023
mergify bot pushed a commit that referenced this pull request Oct 11, 2023
* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
s-aga-r added a commit that referenced this pull request Oct 11, 2023
* fix: negative valuation rate in PR return (#37424)

* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
mergify bot added a commit that referenced this pull request Oct 11, 2023
* fix: negative valuation rate in PR return (#37424)

* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit 66ad823)
s-aga-r pushed a commit that referenced this pull request Oct 11, 2023
…37462) (#37463)

fix: negative valuation rate in PR return (backport #37424) (#37462)

* fix: negative valuation rate in PR return (#37424)

* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit 66ad823)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request Oct 11, 2023
## [13.54.4](v13.54.3...v13.54.4) (2023-10-11)

### Bug Fixes

* negative valuation rate in PR return (backport [#37424](#37424)) (backport [#37462](#37462)) ([#37463](#37463)) ([f6b3532](f6b3532))
frappe-pr-bot pushed a commit that referenced this pull request Oct 12, 2023
# [14.44.0](v14.43.1...v14.44.0) (2023-10-12)

### Bug Fixes

* added validation for the batch on stock reco ([#37174](#37174)) ([4c337a6](4c337a6))
* ageing summary in AR ([15d2024](15d2024))
* allocate amt for payment term invoices ([b22ac13](b22ac13))
* call validate before setting repost flag ([bec3e8e](bec3e8e))
* do not run bg job for single doc ([4123e7b](4123e7b))
* **Employee:** enable `no_copy` for `relieving_date` (backport [#37344](#37344)) ([#37358](#37358)) ([2b38b78](2b38b78))
* exception on exporting errored rows ([e58b3b1](e58b3b1))
* fetch company details for Lead based quotation ([c1d40a6](c1d40a6))
* fetch dependent task subject and project (backport [#37401](#37401)) ([#37421](#37421)) ([0aad942](0aad942))
* ignore cancelled gle in voucher-wise balance report ([#36417](#36417)) ([ee1255a](ee1255a))
* incorrect status of the returned purchase receipt ([#37300](#37300)) ([63f4573](63f4573))
* linting issues ([6c8a65e](6c8a65e))
* negative valuation rate in PR return ([#37424](#37424)) ([26ad688](26ad688))
* payment request rounding in multi-currency and on status update ([eed5863](eed5863))
* production plan reserved qty incorrect calculation (backport [#37400](#37400)) ([#37458](#37458)) ([573b159](573b159))
* split inv allocated amt on server side ([06b0477](06b0477))
* typo in doctype name and qb ([606c99e](606c99e))
* **ux:** allow MR to Stop until fully received (backport [#37452](#37452)) ([#37456](#37456)) ([fb0b426](fb0b426))
* validation for si ([3dc68e3](3dc68e3))

### Features

* add repost btn in invoice ([cde848d](cde848d))
* allow on submit fields ([f5245f6](f5245f6))
* allow repost for pi ([2d13dda](2d13dda))
* composite WIP asset ([#37352](#37352)) ([0ecd7d2](0ecd7d2))
* disable currency exchange api. ([#33593](#33593)) ([1ca0516](1ca0516))
* filter on voucher no ([cb35218](cb35218))
* introduce unreconcile doctype ([ae8355c](ae8355c))
* UI for unreconcile ([9531a45](9531a45))
* unreconcile support for journal entry ([cd2d335](cd2d335))
* validate negative stock for inventory dimension ([#37373](#37373)) ([1480aca](1480aca))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.44.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

frappe-pr-bot pushed a commit that referenced this pull request Oct 19, 2023
## [13.54.5](v13.54.4...v13.54.5) (2023-10-19)

### Bug Fixes

* e-commerce permissions for address (backport [#37554](#37554)) ([#37560](#37560)) ([49d0ab5](49d0ab5))
* **gp:** wrong `allocated_amount` on multi sales person invoice ([7805c3a](7805c3a))
* Issues related to RFQ and Supplier Quotation on Portal (backport [#37565](#37565)) (backport [#37577](#37577)) ([#37588](#37588)) ([bc907b2](bc907b2))
* keep customer/supplier website role by default ([52aff1f](52aff1f))
* negative valuation rate in PR return (backport [#37424](#37424)) ([#37462](#37462)) ([66ad823](66ad823))
* use `flt` to ignore TypeError (backport [#37481](#37481)) ([#37489](#37489)) ([8b4e692](8b4e692))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
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