fix: added valuation field type (Float/Currency) in the filter (#36866)

This commit is contained in:
rohitwaghchaure 2023-08-29 16:53:00 +05:30 committed by GitHub
parent 4856e11549
commit dea802dc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 6 deletions

View File

@ -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"),

View File

@ -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"),

View File

@ -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);

View File

@ -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",
},
{