From 40a40a1fa7362a8ec7ab1d16f1984c0ab959d277 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Fri, 31 Jan 2025 15:56:42 +0100 Subject: [PATCH] fix: Always cast date filter before adding minutes --- .../batch_wise_balance_history.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py index fa13bef66f4..21c289742dc 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py @@ -4,7 +4,7 @@ import frappe from frappe import _ -from frappe.utils import add_to_date, cint, flt, get_datetime, get_table_name, getdate +from frappe.utils import add_to_date, cint, flt, get_date_str, get_datetime, get_table_name, getdate from pypika import functions as fn from erpnext.deprecation_dumpster import deprecated @@ -78,18 +78,18 @@ def execute(filters=None): def get_columns(filters): """return columns based on filters""" - columns = ( - [_("Item") + ":Link/Item:100"] - + [_("Item Name") + "::150"] - + [_("Description") + "::150"] - + [_("Warehouse") + ":Link/Warehouse:100"] - + [_("Batch") + ":Link/Batch:100"] - + [_("Opening Qty") + ":Float:90"] - + [_("In Qty") + ":Float:80"] - + [_("Out Qty") + ":Float:80"] - + [_("Balance Qty") + ":Float:90"] - + [_("UOM") + "::90"] - ) + columns = [ + _("Item") + ":Link/Item:100", + _("Item Name") + "::150", + _("Description") + "::150", + _("Warehouse") + ":Link/Warehouse:100", + _("Batch") + ":Link/Batch:100", + _("Opening Qty") + ":Float:90", + _("In Qty") + ":Float:80", + _("Out Qty") + ":Float:80", + _("Balance Qty") + ":Float:90", + _("UOM") + "::90", + ] return columns @@ -179,7 +179,7 @@ def get_stock_ledger_entries_for_batch_bundle(filters): sle = frappe.qb.DocType("Stock Ledger Entry") batch_package = frappe.qb.DocType("Serial and Batch Entry") - to_date = get_datetime(filters.to_date + " 23:59:59") + to_date = get_datetime(get_date_str(filters.to_date) + " 23:59:59") query = ( frappe.qb.from_(sle) -- GitLab