I am new to ERPNext.
I am trying to get a filter into my report script.
code as below
def print_something(filters):
start= filters.get(“start_date”)
print(“Start” , start)
conditions=get_conditions(filters)
query=frappe.db.sql(“”“select (sum(debit_in_account_currency)-sum(credit_in_account_currency)) AS Openingbalance
from tabGL Entry
where account = ‘SAMP’ “”” % conditions)
return query
def get_conditions(filters):
conditions = “”
if filters.get(“start_date”): conditions += “posting_date < %(start_date)s”
print(“condiitons” , conditions)
return conditions
Then I get this error- “all arguments converted during string formatting”.
Can someone guide me to correct this error? Thank you.