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: consolidated report not consider company currency #27863

Conversation

rohitwaghchaure
Copy link
Collaborator

Multi-currency issue in Consolidated report

Issue
Created child-parent company, parent company has currency INR and child company has Currency USD, system was showing

Screenshot 2021-10-07 at 7 58 12 PM

After Fix
Screenshot 2021-10-07 at 9 00 48 PM

Multi-currency COA for parent and child company

Issue
If you add new account in the parent company then system creates the same account in all the child company with currency same as parent company currency, but if the child company belongs to different currency then it set incorrect currency/

After Fix
System will use company currency while adding new Account from parent company to child company

@rohitwaghchaure rohitwaghchaure force-pushed the multi-currency-issue-for-consolidated-report branch from b333015 to dc42064 Compare October 8, 2021 06:41
@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #27863 (19d14da) into develop (64c1347) will increase coverage by 0.01%.
The diff coverage is 1.63%.

@@             Coverage Diff             @@
##           develop   #27863      +/-   ##
===========================================
+ Coverage    54.49%   54.50%   +0.01%     
===========================================
  Files         1248     1248              
  Lines        67521    67556      +35     
===========================================
+ Hits         36795    36823      +28     
- Misses       30726    30733       +7     
Impacted Files Coverage Δ
...cial_statement/consolidated_financial_statement.py 0.00% <0.00%> (ø)
erpnext/accounts/doctype/account/account.py 71.09% <50.00%> (+0.11%) ⬆️
...ctype/woocommerce_settings/woocommerce_settings.py 80.39% <0.00%> (-3.93%) ⬇️
erpnext/education/doctype/student/student.py 73.95% <0.00%> (-3.13%) ⬇️
...ion/doctype/course_enrollment/course_enrollment.py 45.09% <0.00%> (-1.97%) ⬇️
erpnext/stock/report/stock_ageing/stock_ageing.py 91.36% <0.00%> (-1.44%) ⬇️
...ice_creation_tool/opening_invoice_creation_tool.py 60.41% <0.00%> (-0.70%) ⬇️
...ype/account/chart_of_accounts/chart_of_accounts.py 78.62% <0.00%> (-0.69%) ⬇️
erpnext/stock/get_item_details.py 79.38% <0.00%> (-0.47%) ⬇️
erpnext/selling/doctype/sales_order/sales_order.py 76.39% <0.00%> (-0.46%) ⬇️
... and 16 more

@rohitwaghchaure rohitwaghchaure merged commit 3f99a87 into frappe:develop Oct 11, 2021
@rohitwaghchaure
Copy link
Collaborator Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Oct 11, 2021

Command backport version-13-hotfix: success

Backports have been created

rohitwaghchaure added a commit that referenced this pull request Oct 11, 2021
…-27863

fix: consolidated report not consider company currency (backport #27863)
@centaur78
Copy link

hi @rohitwaghchaure

Just got the below error when trying to view the report

image

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1205, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 621, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 233, in run
    result = generate_report_result(report, filters, user, custom_columns)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 75, in generate_report_result
    res = report.execute_script_report(filters)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py", line 122, in execute_script_report
    res = self.execute_module(filters)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py", line 139, in execute_module
    return frappe.get_attr(method_name)(frappe._dict(filters))
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py", line 50, in execute
    data, message, chart, report_summary = get_balance_sheet_data(fiscal_year, companies, columns, filters)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py", line 78, in get_balance_sheet_data
    message, opening_balance = prepare_companywise_opening_balance(asset, liability, equity, companies)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py", line 118, in prepare_companywise_opening_balance
    opening_value += get_opening_balance(account_name, data, company)
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

@hasan-dodiya
Copy link

hasan-dodiya commented Oct 16, 2021

photo_2021-10-16_21-25-20

Child-Parent company issue in bank reconciliation tool currency issue.

Created child-parent company, parent company has currency INR and child company has Currency USD, system was showing

I have a USD bank account and when I display the bank reconciliation it shows the INR Symbol (company default)

@hasan-dodiya
Copy link

photo_2021-10-16_21-25-20

Child-Parent company issue in bank reconciliation tool currency issue.

Created child-parent company, parent company has currency INR and child company has Currency USD, system was showing

I have a USD bank account and when I display the bank reconciliation it shows the INR Symbol (company default)

@rohitwaghchaure Any update on this facing isuue

asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
…ssue-for-consolidated-report

fix: consolidated report not consider company currency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants