Skip to content

Commit

Permalink
fix: labels for Stock Ledger Invariant Check report (#37150)
Browse files Browse the repository at this point in the history
refactor: `Stock Ledger Invariant Check` report
  • Loading branch information
s-aga-r authored Sep 20, 2023
1 parent dd4769e commit f0859ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"),
},
]

Expand Down

0 comments on commit f0859ec

Please sign in to comment.