Added Estimate dial API calls.
This commit is contained in:
parent
91e4d47d48
commit
81f3489a24
1 changed files with 28 additions and 3 deletions
|
|
@ -481,6 +481,31 @@ def upsert_estimate(data):
|
||||||
print(f"DEBUG: Error in upsert_estimate: {str(e)}")
|
print(f"DEBUG: Error in upsert_estimate: {str(e)}")
|
||||||
return build_error_response(str(e), 500)
|
return build_error_response(str(e), 500)
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_unapproved_estimates_count(company):
|
||||||
|
"""Get the number of unapproved estimates."""
|
||||||
|
try:
|
||||||
|
draft_filters = {'status': "Draft", "company": company}
|
||||||
|
submitted_filters = {'status': "Submitted", "company": company}
|
||||||
|
draft_count = frappe.db.count("Quotation", filters=draft_filters)
|
||||||
|
submitted_count = frappe.db.count("Quotation", filters=submitted_filters)
|
||||||
|
return build_success_response([draft_count, submitted_count])
|
||||||
|
except Exception as e:
|
||||||
|
return build_error_response(str(e), 500)
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_estimates_half_down_count(company):
|
||||||
|
"""Get the number unpaid half-down estimates."""
|
||||||
|
try:
|
||||||
|
filters = {'requires_half_payment': True, 'company': company}
|
||||||
|
count = frappe.db.count("Quotation", filters=filters)
|
||||||
|
return build_success_response([count])
|
||||||
|
except Exception as e:
|
||||||
|
return build_error_response(str(e), 500)
|
||||||
|
|
||||||
|
|
||||||
def get_estimate_history(estimate_name):
|
def get_estimate_history(estimate_name):
|
||||||
"""Get the history of changes for a specific estimate."""
|
"""Get the history of changes for a specific estimate."""
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue