fix: 'In Qty' and 'Out Qty' columns in Report Stock Ledger
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js
index df3bba5..3d5cfdc 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.js
@@ -83,6 +83,9 @@
if (column.fieldname == "out_qty" && data.out_qty < 0) {
value = "<span style='color:red'>" + value + "</span>";
}
+ else if (column.fieldname == "in_qty" && data.in_qty > 0) {
+ value = "<span style='color:green'>" + value + "</span>";
+ }
return value;
},
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index fc49db5..670a0e2 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -39,10 +39,13 @@
sle.update({
"qty_after_transaction": actual_qty,
"stock_value": stock_value,
- "in_qty": max(sle.actual_qty, 0),
- "out_qty": min(sle.actual_qty, 0)
})
+ sle.update({
+ "in_qty": max(sle.actual_qty, 0),
+ "out_qty": min(sle.actual_qty, 0)
+ })
+
# get the name of the item that was produced using this item
if sle.voucher_type == "Stock Entry":
purpose, work_order, fg_completed_qty = frappe.db.get_value(sle.voucher_type, sle.voucher_no, ["purpose", "work_order", "fg_completed_qty"])