mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
This is an automatic backport of pull request #30634 done by [Mergify](https://mergify.com). Conflicts fixed.
This commit is contained in:
@@ -124,11 +124,10 @@ def get_columns(invoice_list, additional_table_columns):
|
|||||||
_("Purchase Receipt") + ":Link/Purchase Receipt:100",
|
_("Purchase Receipt") + ":Link/Purchase Receipt:100",
|
||||||
{"fieldname": "currency", "label": _("Currency"), "fieldtype": "Data", "width": 80},
|
{"fieldname": "currency", "label": _("Currency"), "fieldtype": "Data", "width": 80},
|
||||||
]
|
]
|
||||||
expense_accounts = (
|
|
||||||
tax_accounts
|
expense_accounts = []
|
||||||
) = (
|
tax_accounts = []
|
||||||
expense_columns
|
unrealized_profit_loss_accounts = []
|
||||||
) = tax_columns = unrealized_profit_loss_accounts = unrealized_profit_loss_account_columns = []
|
|
||||||
|
|
||||||
if invoice_list:
|
if invoice_list:
|
||||||
expense_accounts = frappe.db.sql_list(
|
expense_accounts = frappe.db.sql_list(
|
||||||
@@ -163,10 +162,11 @@ def get_columns(invoice_list, additional_table_columns):
|
|||||||
unrealized_profit_loss_account_columns = [
|
unrealized_profit_loss_account_columns = [
|
||||||
(account + ":Currency/currency:120") for account in unrealized_profit_loss_accounts
|
(account + ":Currency/currency:120") for account in unrealized_profit_loss_accounts
|
||||||
]
|
]
|
||||||
|
tax_columns = [
|
||||||
for account in tax_accounts:
|
(account + ":Currency/currency:120")
|
||||||
if account not in expense_accounts:
|
for account in tax_accounts
|
||||||
tax_columns.append(account + ":Currency/currency:120")
|
if account not in expense_accounts
|
||||||
|
]
|
||||||
|
|
||||||
columns = (
|
columns = (
|
||||||
columns
|
columns
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ class Customer(TransactionBase):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_customer_group_details(self):
|
def get_customer_group_details(self):
|
||||||
doc = frappe.get_doc("Customer Group", self.customer_group)
|
doc = frappe.get_doc("Customer Group", self.customer_group)
|
||||||
self.accounts = self.credit_limits = []
|
self.accounts = []
|
||||||
|
self.credit_limits = []
|
||||||
self.payment_terms = self.default_price_list = ""
|
self.payment_terms = self.default_price_list = ""
|
||||||
|
|
||||||
tables = [["accounts", "account"], ["credit_limits", "credit_limit"]]
|
tables = [["accounts", "account"], ["credit_limits", "credit_limit"]]
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ class TestCustomer(FrappeTestCase):
|
|||||||
c_doc.customer_name = "Testing Customer"
|
c_doc.customer_name = "Testing Customer"
|
||||||
c_doc.customer_group = "_Testing Customer Group"
|
c_doc.customer_group = "_Testing Customer Group"
|
||||||
c_doc.payment_terms = c_doc.default_price_list = ""
|
c_doc.payment_terms = c_doc.default_price_list = ""
|
||||||
c_doc.accounts = c_doc.credit_limits = []
|
c_doc.accounts = []
|
||||||
|
c_doc.credit_limits = []
|
||||||
c_doc.insert()
|
c_doc.insert()
|
||||||
c_doc.get_customer_group_details()
|
c_doc.get_customer_group_details()
|
||||||
self.assertEqual(c_doc.payment_terms, "_Test Payment Term Template 3")
|
self.assertEqual(c_doc.payment_terms, "_Test Payment Term Template 3")
|
||||||
|
|||||||
Reference in New Issue
Block a user