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 a31d23934f890ae2e165c68cb7a9c2e989633011..60beca0d907b5b3de89a110fb155f25b4c4f1b81 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 frappe.utils.deprecations import deprecated from pypika import functions as fn @@ -77,18 +77,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 @@ -151,7 +151,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)