Compare commits

...

3 Commits

Author SHA1 Message Date
rocketdebris
8256af1ffd Added color handling for Invoice status-buttons. 2025-12-02 14:02:01 -05:00
rocketdebris
f2bfdbebf5 Added stub for handling status button clicks for invoices. 2025-12-02 14:02:01 -05:00
rocketdebris
a4022a8920 Added rudimentary currency rendering for grand total. 2025-12-02 14:02:01 -05:00
3 changed files with 8 additions and 3 deletions

View File

@ -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)

View File

@ -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";

View File

@ -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);