Skip to content

Commit

Permalink
Merge pull request #33088 from rohitwaghchaure/fixed-ux-for-valuation…
Browse files Browse the repository at this point in the history
…-rate

fix: Valuation Rate column UX in stock ledger report
  • Loading branch information
rohitwaghchaure committed Nov 23, 2022
2 parents a3c81da + be19e4f commit bbfa644
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions erpnext/stock/report/stock_ledger/stock_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ def execute(filters=None):
if sle.serial_no:
update_available_serial_nos(available_serial_nos, sle)

if sle.actual_qty:
sle["in_out_rate"] = flt(sle.stock_value_difference / sle.actual_qty, precision)

elif sle.voucher_type == "Stock Reconciliation":
sle["in_out_rate"] = sle.valuation_rate

data.append(sle)

if include_uom:
Expand Down Expand Up @@ -185,10 +191,18 @@ def get_columns(filters):
"convertible": "rate",
},
{
"label": _("Valuation Rate"),
"label": _("Avg Rate (Balance Stock)"),
"fieldname": "valuation_rate",
"fieldtype": "Currency",
"width": 110,
"width": 180,
"options": "Company:company:default_currency",
"convertible": "rate",
},
{
"label": _("Valuation Rate"),
"fieldname": "in_out_rate",
"fieldtype": "Currency",
"width": 140,
"options": "Company:company:default_currency",
"convertible": "rate",
},
Expand Down

0 comments on commit bbfa644

Please sign in to comment.