Merge pull request #31566 from deepeshgarg007/ignore_account_currency
fix: Allow multi currency invoice against single party account
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
"automatically_fetch_payment_terms",
|
"automatically_fetch_payment_terms",
|
||||||
"column_break_17",
|
"column_break_17",
|
||||||
"enable_common_party_accounting",
|
"enable_common_party_accounting",
|
||||||
|
"allow_multi_currency_invoices_against_single_party_account",
|
||||||
"report_setting_section",
|
"report_setting_section",
|
||||||
"use_custom_cash_flow",
|
"use_custom_cash_flow",
|
||||||
"deferred_accounting_settings_section",
|
"deferred_accounting_settings_section",
|
||||||
@@ -339,6 +340,13 @@
|
|||||||
"fieldname": "report_setting_section",
|
"fieldname": "report_setting_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Report Setting"
|
"label": "Report Setting"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "Enabling this will allow creation of multi-currency invoices against single party account in company currency",
|
||||||
|
"fieldname": "allow_multi_currency_invoices_against_single_party_account",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Allow multi-currency invoices against single party account "
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
@@ -346,7 +354,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-04-08 14:45:06.796418",
|
"modified": "2022-07-11 13:37:50.605141",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Accounts Settings",
|
"name": "Accounts Settings",
|
||||||
|
|||||||
@@ -1472,8 +1472,15 @@ class AccountsController(TransactionBase):
|
|||||||
self.get("debit_to") if self.doctype == "Sales Invoice" else self.get("credit_to")
|
self.get("debit_to") if self.doctype == "Sales Invoice" else self.get("credit_to")
|
||||||
)
|
)
|
||||||
party_account_currency = get_account_currency(party_account)
|
party_account_currency = get_account_currency(party_account)
|
||||||
|
allow_multi_currency_invoices_against_single_party_account = frappe.db.get_singles_value(
|
||||||
|
"Accounts Settings", "allow_multi_currency_invoices_against_single_party_account"
|
||||||
|
)
|
||||||
|
|
||||||
if not party_gle_currency and (party_account_currency != self.currency):
|
if (
|
||||||
|
not party_gle_currency
|
||||||
|
and (party_account_currency != self.currency)
|
||||||
|
and not allow_multi_currency_invoices_against_single_party_account
|
||||||
|
):
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_("Party Account {0} currency ({1}) and document currency ({2}) should be same").format(
|
_("Party Account {0} currency ({1}) and document currency ({2}) should be same").format(
|
||||||
frappe.bold(party_account), party_account_currency, self.currency
|
frappe.bold(party_account), party_account_currency, self.currency
|
||||||
|
|||||||
Reference in New Issue
Block a user