fix estimate search filtering
This commit is contained in:
parent
49617c39c4
commit
cf577f3ac7
1 changed files with 7 additions and 0 deletions
|
|
@ -15,6 +15,13 @@ def get_estimate_table_data_v2(filters={}, sortings=[], page=1, page_size=10):
|
||||||
"""Get paginated estimate table data with filtering and sorting."""
|
"""Get paginated estimate table data with filtering and sorting."""
|
||||||
print("DEBUG: Raw estimate options received:", filters, sortings, page, page_size)
|
print("DEBUG: Raw estimate options received:", filters, sortings, page, page_size)
|
||||||
filters, sortings, page, page_size = DbUtils.process_datatable_request(filters, sortings, page, page_size)
|
filters, sortings, page, page_size = DbUtils.process_datatable_request(filters, sortings, page, page_size)
|
||||||
|
if filters.get("address"):
|
||||||
|
# change the key from address to custom_job_address
|
||||||
|
filters["custom_job_address"] = filters.pop("address")
|
||||||
|
filters["custom_job_address"] = ["like", f"%{filters['custom_job_address']['value']}%"]
|
||||||
|
if filters.get("customer"):
|
||||||
|
filters["actual_customer_name"] = ["like", f"%{filters.pop('customer')['value']}%"]
|
||||||
|
print("DEBUG: Processed estimate options - Filters:", filters, "Sortings:", sortings, "Page:", page, "Page Size:", page_size)
|
||||||
sortings = "modified desc" if not sortings else sortings
|
sortings = "modified desc" if not sortings else sortings
|
||||||
count = frappe.db.count("Quotation", filters=filters)
|
count = frappe.db.count("Quotation", filters=filters)
|
||||||
print(f"DEBUG: Number of estimates returned: {count}")
|
print(f"DEBUG: Number of estimates returned: {count}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue