Set billing address to correct field in upsert_estimate.
This commit is contained in:
parent
860bd69531
commit
c5e4f3f72a
1 changed files with 5 additions and 5 deletions
|
|
@ -26,7 +26,7 @@ def get_estimate_table_data_v2(filters={}, sortings=[], page=1, page_size=10):
|
||||||
start=(page) * page_size,
|
start=(page) * page_size,
|
||||||
order_by=sortings
|
order_by=sortings
|
||||||
)
|
)
|
||||||
|
|
||||||
estimates = [frappe.get_doc("Quotation", name).as_dict() for name in estimate_names]
|
estimates = [frappe.get_doc("Quotation", name).as_dict() for name in estimate_names]
|
||||||
tableRows = []
|
tableRows = []
|
||||||
for estimate in estimates:
|
for estimate in estimates:
|
||||||
|
|
@ -41,7 +41,7 @@ def get_estimate_table_data_v2(filters={}, sortings=[], page=1, page_size=10):
|
||||||
tableRows.append(tableRow)
|
tableRows.append(tableRow)
|
||||||
table_data_dict = build_datatable_dict(data=tableRows, count=count, page=page, page_size=page_size)
|
table_data_dict = build_datatable_dict(data=tableRows, count=count, page=page, page_size=page_size)
|
||||||
return build_success_response(table_data_dict)
|
return build_success_response(table_data_dict)
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_estimate_table_data(filters={}, sortings=[], page=1, page_size=10):
|
def get_estimate_table_data(filters={}, sortings=[], page=1, page_size=10):
|
||||||
|
|
@ -283,14 +283,14 @@ def send_estimate_email(estimate_name):
|
||||||
attachments=[{"fname": f"{quotation.name}.pdf", "fcontent": pdf}]
|
attachments=[{"fname": f"{quotation.name}.pdf", "fcontent": pdf}]
|
||||||
)
|
)
|
||||||
print(f"DEBUG: Email sent to {email} successfully.")
|
print(f"DEBUG: Email sent to {email} successfully.")
|
||||||
|
|
||||||
# Update quotation status
|
# Update quotation status
|
||||||
quotation.custom_current_status = "Submitted"
|
quotation.custom_current_status = "Submitted"
|
||||||
quotation.custom_sent = 1
|
quotation.custom_sent = 1
|
||||||
quotation.save()
|
quotation.save()
|
||||||
quotation.submit()
|
quotation.submit()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
updated_quotation = frappe.get_doc("Quotation", estimate_name)
|
updated_quotation = frappe.get_doc("Quotation", estimate_name)
|
||||||
return build_success_response(updated_quotation.as_dict())
|
return build_success_response(updated_quotation.as_dict())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -510,7 +510,7 @@ def upsert_estimate(data):
|
||||||
"company": data.get("company"),
|
"company": data.get("company"),
|
||||||
"actual_customer_name": client_doc.name,
|
"actual_customer_name": client_doc.name,
|
||||||
"customer_type": address_doc.customer_type,
|
"customer_type": address_doc.customer_type,
|
||||||
"customer_address": client_doc.custom_billing_address,
|
"customer_address": client_doc.primary_address,
|
||||||
"contact_person": data.get("contact_name"),
|
"contact_person": data.get("contact_name"),
|
||||||
"letter_head": data.get("company"),
|
"letter_head": data.get("company"),
|
||||||
"custom_project_template": data.get("project_template", None),
|
"custom_project_template": data.get("project_template", None),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue