fix: incorrect color in the BOM Stock Report

(cherry picked from commit a8f03ebf7f)
(cherry picked from commit e98b34617f)
This commit is contained in:
Rohit Waghchaure
2023-02-22 14:24:18 +05:30
committed by Mergify
parent 9766827a08
commit 0490e3bfe6

View File

@@ -25,8 +25,9 @@ frappe.query_reports["BOM Stock Report"] = {
],
"formatter": function(value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.id == "item") {
if (data["enough_parts_to_build"] > 0) {
if (data["in_stock_qty"] >= data["required_qty"]) {
value = `<a style='color:green' href="/app/item/${data['item']}" data-doctype="Item">${data['item']}</a>`;
} else {
value = `<a style='color:red' href="/app/item/${data['item']}" data-doctype="Item">${data['item']}</a>`;