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: company wise deferred accounting fields in item #37023

Merged

Conversation

GursheenK
Copy link
Member

@GursheenK GursheenK commented Sep 11, 2023

Problem
For a particular Item, the fields to enable deferred accounting and set the default deferred account for that particular Item are available in the Purchasing and Sales tabs in the Item Master. However, these are set for that particular Item for all the companies. If one needs to set different deferred accounts for the same Item in different companies, this cannot be achieved from the Item master.

Solution

Moved the deferred accounting fields to the Accounting Tab.

Screenshot 2023-09-11 at 2 07 05 PM

Show the deferred_expense_account and deferred_revenue_account fields in the Item Defaults table (which is company wise) depending on whether Deferred Accounting is enabled for the particular item.

Screenshot 2023-09-11 at 2 07 38 PM

Closes #36841

no-docs

@github-actions github-actions bot added needs-tests This PR needs automated unit-tests. stock labels Sep 11, 2023
Copy link
Member

@deepeshgarg007 deepeshgarg007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also need a patch to move the existing account from Item doctype to Item Defaults

@@ -696,7 +696,11 @@ def get_default_discount_account(args, item):
def get_default_deferred_account(args, item, fieldname=None):
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
return (
item.get(fieldname)
frappe.db.get_value(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
frappe.db.get_value(
frappe.db.get_value(
Suggested change
frappe.db.get_value(
frappe.db.get_cached_value(

@deepeshgarg007 deepeshgarg007 added the backport version-14-hotfix backport to version 14 label Sep 16, 2023
@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #37023 (e40d943) into develop (fc01668) will increase coverage by 0.00%.
Report is 1 commits behind head on develop.
The diff coverage is n/a.

❗ Current head e40d943 differs from pull request most recent head ce832d6. Consider uploading reports for the commit ce832d6 to get more accurate results

@@           Coverage Diff            @@
##           develop   #37023   +/-   ##
========================================
  Coverage    66.49%   66.50%           
========================================
  Files          793      793           
  Lines        62435    62432    -3     
========================================
- Hits         41519    41518    -1     
+ Misses       20916    20914    -2     
Files Changed Coverage
erpnext/stock/get_item_details.py ø

@deepeshgarg007 deepeshgarg007 merged commit 099468e into frappe:develop Sep 16, 2023
10 checks passed
mergify bot pushed a commit that referenced this pull request Sep 16, 2023
* fix: move deferred accounts in accounting section

* fix: move deferred check boxes in item accounting

* fix: show company wise acc in filters

* fix: fetch item deferred account from child table

* fix: tests using deferred acc

* refactor: use cached value

* fix: cached value call

* feat: patch to migrate deferred acc

* fix: hardcode education module doctypes in patch

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 099468e)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/patches/v14_0/delete_education_doctypes.py
#	erpnext/stock/doctype/item/item.json
deepeshgarg007 added a commit that referenced this pull request Sep 18, 2023
* fix: company wise deferred accounting fields in item (#37023)

* fix: move deferred accounts in accounting section

* fix: move deferred check boxes in item accounting

* fix: show company wise acc in filters

* fix: fetch item deferred account from child table

* fix: tests using deferred acc

* refactor: use cached value

* fix: cached value call

* feat: patch to migrate deferred acc

* fix: hardcode education module doctypes in patch

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 099468e)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/patches/v14_0/delete_education_doctypes.py
#	erpnext/stock/doctype/item/item.json

* chore: resolve conflicts

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Sep 20, 2023
# [14.40.0](v14.39.0...v14.40.0) (2023-09-20)

### Bug Fixes

* + btn not appearing for delivery note connection (backport [#36980](#36980)) ([#37070](#37070)) ([c2a0c1e](c2a0c1e))
* accepted warehouse and rejected warehouse can't be same (backport [#36973](#36973)) ([#37071](#37071)) ([b56c9b9](b56c9b9))
* after applying coupon code, field in_words not updated ([#37133](#37133)) ([1cb8c64](1cb8c64))
* Apply dimension filter, irrespective of dimesion columns ([9bc44a3](9bc44a3))
* asset validation misfire on debit notes ([b33db6c](b33db6c))
* company wise deferred accounting fields in item ([#37023](#37023)) ([13aaff3](13aaff3))
* Don't allow merging accounts with different currency ([#37074](#37074)) ([c41cb39](c41cb39))
* don't set from warehouse for purchase material request ([#37132](#37132)) ([e62b783](e62b783))
* Duplicate Serial Nos validation in POS ([#36927](#36927)) ([366325c](366325c))
* fetch logic for repay_from_salary in loan_repayment [v14] ([#37135](#37135)) ([480a0ca](480a0ca))
* ignore user permissions for `Source Warehouse` in MR (backport [#37102](#37102)) ([#37110](#37110)) ([727dcc5](727dcc5))
* incorrect stock ledger entries in DN (backport [#36944](#36944)) ([#37066](#37066)) ([699ad80](699ad80))
* packed item using expired price ([413b40f](413b40f))
* POS opening Issue if Product Bundle is available ([#37138](#37138)) ([af05864](af05864))
* precision issue and column name ([#37073](#37073)) ([f2395a9](f2395a9))
* Purchase Receipt Provisional Accounting GL Entries (backport [#37046](#37046)) ([#37068](#37068)) ([8772e40](8772e40))
* Remove redundant code ([#37001](#37001)) ([3ecdf02](3ecdf02))
* **ux:** move `get_route_options_for_new_doc` to `refresh` ([#37092](#37092)) ([a563fed](a563fed))
* validate duplicate serial no in DN ([fffa13f](fffa13f))

### Features

* provision to create RIV from `Stock Ledger Invariant Check` report (backport [#37115](#37115)) ([#37147](#37147)) ([29ff0ce](29ff0ce))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 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. stock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants