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 fa13bef66f4114c86806d878cfb5fcfa61d2e903..21c289742dcb0e85d57857a2d8c3443817fe0504 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)