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: incorrect outgoing rates when material_consumption enabled #28710

Merged
merged 2 commits into from
Dec 4, 2021

Conversation

noahjacob
Copy link
Contributor

@noahjacob noahjacob commented Dec 3, 2021

Pre-requisite

image

  • Enable "Allow Continuous Material Consumption".

Issue

  • When creating a Manufacture Entry which has the RM and FG, the outgoing rate was calculated based on the BOM and not the RM in the Stock Entry.
  • This creates a difference between Incoming and Outgoing Values.

outgoing_before

Fix

  • Even if the setting is enabled, while calculating the outgoing rate, the stock entry should give priority to the RM in the Stock Entry before the RM rates in the BOM.

outgoing_after

Steps

  • Enable the setting.
  • Submit a Work Order.
  • Create a Material Transfer.
  • Click on Finish to create a Manufacture Entry.

@noahjacob noahjacob added the needs-tests This PR needs automated unit-tests. label Dec 3, 2021
@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #28710 (35346de) into develop (37c318a) will increase coverage by 13.91%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##           develop   #28710       +/-   ##
============================================
+ Coverage    41.34%   55.26%   +13.91%     
============================================
  Files         1120     1121        +1     
  Lines        66673    66784      +111     
============================================
+ Hits         27567    36907     +9340     
+ Misses       39106    29877     -9229     
Impacted Files Coverage Δ
erpnext/stock/doctype/stock_entry/stock_entry.py 79.94% <100.00%> (+15.21%) ⬆️
erpnext/stock/doctype/bin/bin.py 87.27% <0.00%> (-4.54%) ⬇️
...e/asset_value_adjustment/asset_value_adjustment.py 86.04% <0.00%> (-3.49%) ⬇️
...value/warehouse_wise_item_balance_age_and_value.py 92.40% <0.00%> (-2.54%) ⬇️
...ctype/accounting_dimension/accounting_dimension.py 64.06% <0.00%> (-1.57%) ⬇️
...e/period_closing_voucher/period_closing_voucher.py 88.23% <0.00%> (-1.48%) ⬇️
.../report/stock_projected_qty/stock_projected_qty.py 88.15% <0.00%> (-1.32%) ⬇️
erpnext/tests/utils.py 97.01% <0.00%> (-1.10%) ⬇️
erpnext/regional/saudi_arabia/utils.py 23.75% <0.00%> (-0.70%) ⬇️
...next/accounts/doctype/subscription/subscription.py 81.74% <0.00%> (-0.57%) ⬇️
... and 332 more

@noahjacob noahjacob marked this pull request as ready for review December 3, 2021 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants