fix: 'In Qty' and 'Out Qty' columns in Report Stock Ledger

This commit is contained in:
marination 2020-01-28 16:04:49 +05:30
parent 84afdfdb4c
commit 372c5e51d5
2 changed files with 8 additions and 2 deletions

View File

@ -83,6 +83,9 @@ frappe.query_reports["Stock Ledger"] = {
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;
},

View File

@ -39,10 +39,13 @@ def execute(filters=None):
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"])