update estimate to have remarks
This commit is contained in:
parent
caa4bc2dca
commit
49617c39c4
2 changed files with 19 additions and 3 deletions
|
|
@ -462,6 +462,7 @@ def upsert_estimate(data):
|
|||
estimate.requires_half_payment = data.get("requires_half_payment", 0)
|
||||
estimate.custom_project_template = project_template
|
||||
estimate.custom_quotation_template = data.get("quotation_template", None)
|
||||
estimate.remarks = data.get("remarks", "")
|
||||
# estimate.company = data.get("company")
|
||||
# estimate.contact_email = data.get("contact_email")
|
||||
# estimate.quotation_to = client_doctype
|
||||
|
|
@ -515,7 +516,8 @@ def upsert_estimate(data):
|
|||
"letter_head": data.get("company"),
|
||||
"custom_project_template": data.get("project_template", None),
|
||||
"custom_quotation_template": data.get("quotation_template", None),
|
||||
"from_onsite_meeting": data.get("from_onsite_meeting", None)
|
||||
"from_onsite_meeting": data.get("from_onsite_meeting", None),
|
||||
"remarks": data.get("remarks", "")
|
||||
})
|
||||
for item in data.get("items", []):
|
||||
item = json.loads(item) if isinstance(item, str) else item
|
||||
|
|
@ -534,7 +536,7 @@ def upsert_estimate(data):
|
|||
# ClientService.append_link(data.get("customer"), "quotations", "quotation", new_estimate.name)
|
||||
print("DEBUG: New estimate created with name:", new_estimate.name)
|
||||
dict = new_estimate.as_dict()
|
||||
dict["items"] = [{**ItemService.get_full_dict(item.item_code), **item} for item in new_estimate.items]
|
||||
dict["items"] = [{**item.as_dict(), **ItemService.get_full_dict(item.item_code)} for item in new_estimate.items]
|
||||
return build_success_response(dict)
|
||||
except Exception as e:
|
||||
print(f"DEBUG: Error in upsert_estimate: {str(e)}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue