Merge pull request #23360 from anupamvs/batch-wise

fix: Batch-Wise Balance History filter validation
This commit is contained in:
rohitwaghchaure 2020-09-22 10:32:51 +05:30 committed by GitHub
commit 7230b0f9a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -9,13 +9,15 @@ frappe.query_reports["Batch-Wise Balance History"] = {
"fieldtype": "Date",
"width": "80",
"default": frappe.sys_defaults.year_start_date,
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
"width": "80",
"default": frappe.datetime.get_today()
"default": frappe.datetime.get_today(),
"reqd": 1
},
{
"fieldname": "item",

View File

@ -11,6 +11,9 @@ from frappe.utils import cint, flt, getdate
def execute(filters=None):
if not filters: filters = {}
if filters.from_date > filters.to_date:
frappe.throw(_("From Date must be before To Date"))
float_precision = cint(frappe.db.get_default("float_precision")) or 3
columns = get_columns(filters)