fix: Use customer name instead of name(id) in PSOA (#34412)
This commit is contained in:
parent
d8e54a21fb
commit
fa776d2987
@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2>
|
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2>
|
||||||
<div>
|
<div>
|
||||||
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party[0] }}</b></h5>
|
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party_name[0] }}</b></h5>
|
||||||
<h5 style="float: right;">
|
<h5 style="float: right;">
|
||||||
{{ _("Date: ") }}
|
{{ _("Date: ") }}
|
||||||
<b>{{ frappe.format(filters.from_date, 'Date')}}
|
<b>{{ frappe.format(filters.from_date, 'Date')}}
|
||||||
|
@ -24,7 +24,7 @@ from erpnext.accounts.report.general_ledger.general_ledger import execute as get
|
|||||||
class ProcessStatementOfAccounts(Document):
|
class ProcessStatementOfAccounts(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not self.subject:
|
if not self.subject:
|
||||||
self.subject = "Statement Of Accounts for {{ customer.name }}"
|
self.subject = "Statement Of Accounts for {{ customer.customer_name }}"
|
||||||
if not self.body:
|
if not self.body:
|
||||||
self.body = "Hello {{ customer.name }},<br>PFA your Statement Of Accounts from {{ doc.from_date }} to {{ doc.to_date }}."
|
self.body = "Hello {{ customer.name }},<br>PFA your Statement Of Accounts from {{ doc.from_date }} to {{ doc.to_date }}."
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ def get_report_pdf(doc, consolidated=True):
|
|||||||
"account": [doc.account] if doc.account else None,
|
"account": [doc.account] if doc.account else None,
|
||||||
"party_type": "Customer",
|
"party_type": "Customer",
|
||||||
"party": [entry.customer],
|
"party": [entry.customer],
|
||||||
|
"party_name": [entry.customer_name] if entry.customer_name else None,
|
||||||
"presentation_currency": presentation_currency,
|
"presentation_currency": presentation_currency,
|
||||||
"group_by": doc.group_by,
|
"group_by": doc.group_by,
|
||||||
"currency": doc.currency,
|
"currency": doc.currency,
|
||||||
@ -156,7 +157,7 @@ def get_customers_based_on_territory_or_customer_group(customer_collection, coll
|
|||||||
]
|
]
|
||||||
return frappe.get_list(
|
return frappe.get_list(
|
||||||
"Customer",
|
"Customer",
|
||||||
fields=["name", "email_id"],
|
fields=["name", "customer_name", "email_id"],
|
||||||
filters=[[fields_dict[customer_collection], "IN", selected]],
|
filters=[[fields_dict[customer_collection], "IN", selected]],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -179,7 +180,7 @@ def get_customers_based_on_sales_person(sales_person):
|
|||||||
if sales_person_records.get("Customer"):
|
if sales_person_records.get("Customer"):
|
||||||
return frappe.get_list(
|
return frappe.get_list(
|
||||||
"Customer",
|
"Customer",
|
||||||
fields=["name", "email_id"],
|
fields=["name", "customer_name", "email_id"],
|
||||||
filters=[["name", "in", list(sales_person_records["Customer"])]],
|
filters=[["name", "in", list(sales_person_records["Customer"])]],
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -228,7 +229,7 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
|
|||||||
if customer_collection == "Sales Partner":
|
if customer_collection == "Sales Partner":
|
||||||
customers = frappe.get_list(
|
customers = frappe.get_list(
|
||||||
"Customer",
|
"Customer",
|
||||||
fields=["name", "email_id"],
|
fields=["name", "customer_name", "email_id"],
|
||||||
filters=[["default_sales_partner", "=", collection_name]],
|
filters=[["default_sales_partner", "=", collection_name]],
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -245,7 +246,12 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
customer_list.append(
|
customer_list.append(
|
||||||
{"name": customer.name, "primary_email": primary_email, "billing_email": billing_email}
|
{
|
||||||
|
"name": customer.name,
|
||||||
|
"customer_name": customer.customer_name,
|
||||||
|
"primary_email": primary_email,
|
||||||
|
"billing_email": billing_email,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
return customer_list
|
return customer_list
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
"allow_workflow": 1,
|
|
||||||
"creation": "2020-08-03 16:35:21.852178",
|
"creation": "2020-08-03 16:35:21.852178",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"customer",
|
"customer",
|
||||||
|
"customer_name",
|
||||||
"billing_email",
|
"billing_email",
|
||||||
"primary_email"
|
"primary_email"
|
||||||
],
|
],
|
||||||
@ -30,11 +30,18 @@
|
|||||||
"fieldtype": "Read Only",
|
"fieldtype": "Read Only",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Billing Email"
|
"label": "Billing Email"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fetch_from": "customer.customer_name",
|
||||||
|
"fieldname": "customer_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Customer Name",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-08-03 22:55:38.875601",
|
"modified": "2023-03-13 00:12:34.508086",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Process Statement Of Accounts Customer",
|
"name": "Process Statement Of Accounts Customer",
|
||||||
@ -43,5 +50,6 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user