Compare commits
3 Commits
0663cd2d8c
...
8256af1ffd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8256af1ffd | ||
|
|
f2bfdbebf5 | ||
|
|
a4022a8920 |
@ -2,7 +2,7 @@ import frappe, json
|
||||
from custom_ui.db_utils import process_query_conditions, build_datatable_dict, get_count_or_filters, build_success_response, build_error_response
|
||||
|
||||
# ===============================================================================
|
||||
# ESTIMATES & INVOICES API METHODS
|
||||
# INVOICES API METHODS
|
||||
# ===============================================================================
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ def get_invoice_table_data(filters={}, sortings=[], page=1, page_size=10):
|
||||
tableRow["id"] = invoice["name"]
|
||||
tableRow["address"] = invoice.get("custom_installation_address", "")
|
||||
tableRow["customer"] = invoice.get("customer", "")
|
||||
tableRow["grand_total"] = invoice.get("grand_total", "")
|
||||
tableRow["grand_total"] = f"${invoice.get('grand_total', '')}0"
|
||||
tableRow["status"] = invoice.get("status", "")
|
||||
tableRow["items"] = invoice.get("items", "")
|
||||
tableRows.append(tableRow)
|
||||
|
||||
@ -1072,10 +1072,12 @@ const handleStatusButtonClick = (column, rowData) => {
|
||||
|
||||
const getBadgeColor = (status) => {
|
||||
switch (status?.toLowerCase()) {
|
||||
case "paid":
|
||||
case "completed":
|
||||
case "open":
|
||||
case "active":
|
||||
return "success";
|
||||
case "draft":
|
||||
case "in progress":
|
||||
case "pending":
|
||||
return "warn";
|
||||
|
||||
@ -37,13 +37,16 @@ const columns = [
|
||||
type: "status-button",
|
||||
sortable: true,
|
||||
buttonVariant: "outlined",
|
||||
onStatusClick: (status, rowData) => handleEstimateClick(status, rowData),
|
||||
onStatusClick: (status, rowData) => handleInvoiceClick(status, rowData),
|
||||
//disableCondition: (status) => status?.toLowerCase() === "draft",
|
||||
disableCondition: false
|
||||
},
|
||||
{ label: "Grand Total", fieldName: "grandTotal", type: "text", sortable: true },
|
||||
];
|
||||
|
||||
const handleInvoiceClick = () => {
|
||||
}
|
||||
|
||||
const handleLazyLoad = async (event) => {
|
||||
console.log("Invoices page - handling lazy load:", event);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user