fix: labels for Stock Ledger Invariant Check report (#37150)

refactor: `Stock Ledger Invariant Check` report
This commit is contained in:
s-aga-r 2023-09-20 18:36:24 +05:30 committed by GitHub
parent dd4769ecf1
commit f0859ecc60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@
// For license information, please see license.txt
const DIFFERNCE_FIELD_NAMES = [
const DIFFERENCE_FIELD_NAMES = [
'difference_in_qty',
'fifo_qty_diff',
'fifo_value_diff',
@ -37,7 +37,7 @@ frappe.query_reports['Stock Ledger Invariant Check'] = {
formatter (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (DIFFERNCE_FIELD_NAMES.includes(column.fieldname) && Math.abs(data[column.fieldname]) > 0.001) {
if (DIFFERENCE_FIELD_NAMES.includes(column.fieldname) && Math.abs(data[column.fieldname]) > 0.001) {
value = '<span style="color:red">' + value + '</span>';
}
return value;

View File

@ -186,7 +186,7 @@ def get_columns():
{
"fieldname": "fifo_queue_qty",
"fieldtype": "Float",
"label": _("(C) Total qty in queue"),
"label": _("(C) Total Qty in Queue"),
},
{
"fieldname": "fifo_qty_diff",
@ -211,52 +211,52 @@ def get_columns():
{
"fieldname": "stock_value_difference",
"fieldtype": "Float",
"label": _("(F) Stock Value Difference"),
"label": _("(F) Change in Stock Value"),
},
{
"fieldname": "stock_value_from_diff",
"fieldtype": "Float",
"label": _("Balance Stock Value using (F)"),
"label": _("(G) Sum of Change in Stock Value"),
},
{
"fieldname": "diff_value_diff",
"fieldtype": "Float",
"label": _("K - D"),
"label": _("G - D"),
},
{
"fieldname": "fifo_stock_diff",
"fieldtype": "Float",
"label": _("(G) Stock Value difference (FIFO queue)"),
"label": _("(H) Change in Stock Value (FIFO Queue)"),
},
{
"fieldname": "fifo_difference_diff",
"fieldtype": "Float",
"label": _("F - G"),
"label": _("H - F"),
},
{
"fieldname": "valuation_rate",
"fieldtype": "Float",
"label": _("(H) Valuation Rate"),
"label": _("(I) Valuation Rate"),
},
{
"fieldname": "fifo_valuation_rate",
"fieldtype": "Float",
"label": _("(I) Valuation Rate as per FIFO"),
"label": _("(J) Valuation Rate as per FIFO"),
},
{
"fieldname": "fifo_valuation_diff",
"fieldtype": "Float",
"label": _("H - I"),
"label": _("I - J"),
},
{
"fieldname": "balance_value_by_qty",
"fieldtype": "Float",
"label": _("(J) Valuation = Value (D) ÷ Qty (A)"),
"label": _("(K) Valuation = Value (D) ÷ Qty (A)"),
},
{
"fieldname": "valuation_diff",
"fieldtype": "Float",
"label": _("H - J"),
"label": _("I - K"),
},
]