-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(UX): use doc.status for Job Card status (#31320)
fix(UX): use doc.status for JC status - Use doc.status directly for indicator - single source of truth - Update status to cancelled when doc is cancelled
- Loading branch information
Showing
3 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
frappe.listview_settings['Job Card'] = { | ||
has_indicator_for_draft: true, | ||
|
||
get_indicator: function(doc) { | ||
if (doc.status === "Work In Progress") { | ||
return [__("Work In Progress"), "orange", "status,=,Work In Progress"]; | ||
} else if (doc.status === "Completed") { | ||
return [__("Completed"), "green", "status,=,Completed"]; | ||
} else if (doc.docstatus == 2) { | ||
return [__("Cancelled"), "red", "status,=,Cancelled"]; | ||
} else if (doc.status === "Material Transferred") { | ||
return [__('Material Transferred'), "blue", "status,=,Material Transferred"]; | ||
} else { | ||
return [__("Open"), "red", "status,=,Open"]; | ||
} | ||
const status_colors = { | ||
"Work In Progress": "orange", | ||
"Completed": "green", | ||
"Cancelled": "red", | ||
"Material Transferred": "blue", | ||
"Open": "red", | ||
}; | ||
const status = doc.status || "Open"; | ||
const color = status_colors[status] || "blue"; | ||
|
||
return [__(status), color, `status,=,${status}`]; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters