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: create entries for only PR items present in LCV #36852

Merged

Conversation

GursheenK
Copy link
Member

Problem
KeyError is thrown while submitting LCV for a Purchase Invoice where items do not match.

Steps to replicate bug

  1. Create a Purchase Invoice with multiple items.
  2. Create a LCV and select the PI in the Purchase Receipts table.
  3. Fetch items from the Purchase Invoice by clicking Get Items from Purchase Receipts.
  4. Delete some items from the Purchase Receipt Items child table.
  5. Allocate the total tax amount among remaining items.
  6. Submit the document.

Screenshot


Screenshot 2023-08-28 at 5 46 33 PM

Fix
Added check to ensure GL entries are made only for items present in the LCV.

no-docs

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Aug 28, 2023
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #36852 (d2ffa07) into develop (9d330a1) will increase coverage by 0.00%.
Report is 16 commits behind head on develop.
The diff coverage is 85.18%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #36852   +/-   ##
========================================
  Coverage    65.42%   65.42%           
========================================
  Files          794      794           
  Lines        62172    62181    +9     
========================================
+ Hits         40673    40681    +8     
- Misses       21499    21500    +1     
Files Changed Coverage Δ
..._integrations/connectors/woocommerce_connection.py 0.00% <0.00%> (ø)
...xt/accounts/doctype/payment_entry/payment_entry.py 83.50% <100.00%> (ø)
...ounts/doctype/purchase_invoice/purchase_invoice.py 84.07% <100.00%> (+0.02%) ⬆️
erpnext/controllers/accounts_controller.py 86.11% <100.00%> (ø)
erpnext/controllers/selling_controller.py 80.88% <100.00%> (ø)
erpnext/e_commerce/shopping_cart/cart.py 52.39% <100.00%> (ø)
...cturing/doctype/production_plan/production_plan.py 80.26% <100.00%> (ø)
...doctype/landed_cost_voucher/landed_cost_voucher.py 87.59% <100.00%> (+0.47%) ⬆️
...stock/doctype/purchase_receipt/purchase_receipt.py 91.35% <100.00%> (+0.01%) ⬆️

... and 2 files with indirect coverage changes

@deepeshgarg007 deepeshgarg007 merged commit 26e8b8f into frappe:develop Aug 29, 2023
14 checks passed
@deepeshgarg007 deepeshgarg007 added the backport version-14-hotfix backport to version 14 label Aug 29, 2023
mergify bot pushed a commit that referenced this pull request Aug 29, 2023
* fix: check if item code exists in lcv before creating gle

* refactor: use qb to fetch lcv items

(cherry picked from commit 26e8b8f)
deepeshgarg007 pushed a commit that referenced this pull request Aug 29, 2023
fix: create entries for only PR items present in LCV (#36852)

* fix: check if item code exists in lcv before creating gle

* refactor: use qb to fetch lcv items

(cherry picked from commit 26e8b8f)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request Aug 30, 2023
# [14.37.0](v14.36.0...v14.37.0) (2023-08-30)

### Bug Fixes

* added valuation field type (Float/Currency) in the filter (backport [#36866](#36866)) ([#36868](#36868)) ([22247cf](22247cf))
* Allow to make return against sales invoice which has closed sales order ([0f98cc8](0f98cc8))
* Asset Category filter is not working in asset depreciation([#36806](#36806)) ([bd41cb2](bd41cb2))
* create entries for only PR items present in LCV ([#36852](#36852)) ([d2091cc](d2091cc))
* error in report when data is not available to load chart in report (backport [#36842](#36842)) ([#36853](#36853)) ([9789b7b](9789b7b))
* error listindexoutofrange when save a production plan ([#36807](#36807)) ([fd41594](fd41594))
* fetch JVs in tax withholding report without party values ([bc6bd81](bc6bd81))
* fetch rounded total while pulling reference details on SO ([adc87f1](adc87f1))
* missing company flag for regional fn ([#36791](#36791)) ([c07548a](c07548a))
* SCR return status (backport [#36793](#36793)) ([#36796](#36796)) ([6edfcf4](6edfcf4))
* Tax withholding reversal on Debit Notes ([e8dc63c](e8dc63c))

### Features

* **MR:** Project and Cost Center in Connections (backport [#36794](#36794)) ([#36795](#36795)) ([4fa0777](4fa0777))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 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 needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants