fix: added valuation field type (Float/Currency) in the filter (#36866)
This commit is contained in:
parent
4856e11549
commit
dea802dc41
@ -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"),
|
||||
|
@ -446,9 +446,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": _("Reserved Stock"),
|
||||
|
@ -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",
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user