feat(reports): simplify dashboards, align OT flow labels, and normalize filters
This commit is contained in:
@@ -53,8 +53,7 @@ type WorkOrderDetail struct {
|
||||
}
|
||||
|
||||
var allowedTransitions = map[string][]string{
|
||||
"quote": {"open", "cancelled"},
|
||||
"open": {"in_progress", "cancelled"},
|
||||
"quote": {"in_progress", "cancelled"},
|
||||
"in_progress": {"completed", "cancelled"},
|
||||
"completed": {"invoiced", "cancelled"},
|
||||
"invoiced": {},
|
||||
@@ -236,7 +235,7 @@ func AddItem(ctx context.Context, conn *pgxpool.Conn, woID, catalogItemID, descr
|
||||
FROM work_orders
|
||||
WHERE id=$1
|
||||
AND status NOT IN ('cancelled','invoiced')
|
||||
AND (status <> 'open' OR NULLIF($4,'') IS NOT NULL)
|
||||
AND (status <> 'in_progress' OR NULLIF($4,'') IS NOT NULL)
|
||||
RETURNING id, work_order_id, catalog_item_id, description, COALESCE(change_justification,''), qty, unit_price, discount_pct, total`,
|
||||
woID, catalogItemID, description, changeJustification, qty, unitPrice, discountPct).
|
||||
Scan(&i.ID, &i.WorkOrderID, &i.CatalogItemID, &i.Description, &i.ChangeJustification, &i.Qty, &i.UnitPrice, &i.DiscountPct, &i.Total)
|
||||
|
||||
Reference in New Issue
Block a user