fix: added valuation field type (Float/Currency) in the filter (#36866)
(cherry picked from commit dea802dc41)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -71,6 +71,14 @@ frappe.query_reports["Stock Balance"] = {
|
||||
"width": "80",
|
||||
"options": "Warehouse Type"
|
||||
},
|
||||
{
|
||||
"fieldname": "valuation_field_type",
|
||||
"label": __("Valuation Field Type"),
|
||||
"fieldtype": "Select",
|
||||
"width": "80",
|
||||
"options": "Currency\nFloat",
|
||||
"default": "Currency"
|
||||
},
|
||||
{
|
||||
"fieldname":"include_uom",
|
||||
"label": __("Include UOM"),
|
||||
|
||||
@@ -430,9 +430,12 @@ class StockBalanceReport(object):
|
||||
{
|
||||
"label": _("Valuation Rate"),
|
||||
"fieldname": "val_rate",
|
||||
"fieldtype": "Float",
|
||||
"fieldtype": self.filters.valuation_field_type or "Currency",
|
||||
"width": 90,
|
||||
"convertible": "rate",
|
||||
"options": "Company:company:default_currency"
|
||||
if self.filters.valuation_field_type == "Currency"
|
||||
else None,
|
||||
},
|
||||
{
|
||||
"label": _("Company"),
|
||||
|
||||
@@ -82,7 +82,15 @@ frappe.query_reports["Stock Ledger"] = {
|
||||
"label": __("Include UOM"),
|
||||
"fieldtype": "Link",
|
||||
"options": "UOM"
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "valuation_field_type",
|
||||
"label": __("Valuation Field Type"),
|
||||
"fieldtype": "Select",
|
||||
"width": "80",
|
||||
"options": "Currency\nFloat",
|
||||
"default": "Currency"
|
||||
},
|
||||
],
|
||||
"formatter": function (value, row, column, data, default_formatter) {
|
||||
value = default_formatter(value, row, column, data);
|
||||
|
||||
@@ -196,17 +196,21 @@ def get_columns(filters):
|
||||
{
|
||||
"label": _("Avg Rate (Balance Stock)"),
|
||||
"fieldname": "valuation_rate",
|
||||
"fieldtype": "Float",
|
||||
"fieldtype": filters.valuation_field_type,
|
||||
"width": 180,
|
||||
"options": "Company:company:default_currency",
|
||||
"options": "Company:company:default_currency"
|
||||
if filters.valuation_field_type == "Currency"
|
||||
else None,
|
||||
"convertible": "rate",
|
||||
},
|
||||
{
|
||||
"label": _("Valuation Rate"),
|
||||
"fieldname": "in_out_rate",
|
||||
"fieldtype": "Float",
|
||||
"fieldtype": filters.valuation_field_type,
|
||||
"width": 140,
|
||||
"options": "Company:company:default_currency",
|
||||
"options": "Company:company:default_currency"
|
||||
if filters.valuation_field_type == "Currency"
|
||||
else None,
|
||||
"convertible": "rate",
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user