diff --git a/custom_ui/api/db/estimates.py b/custom_ui/api/db/estimates.py index 19e4815..d9873f6 100644 --- a/custom_ui/api/db/estimates.py +++ b/custom_ui/api/db/estimates.py @@ -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)}") diff --git a/frontend/src/components/pages/Estimate.vue b/frontend/src/components/pages/Estimate.vue index 6b90878..2073e0b 100644 --- a/frontend/src/components/pages/Estimate.vue +++ b/frontend/src/components/pages/Estimate.vue @@ -90,7 +90,17 @@ Loading available items... - +