fix: filter condition in item-wise purchase register
This commit is contained in:
@@ -289,7 +289,7 @@ def get_columns(additional_table_columns, filters):
|
|||||||
|
|
||||||
|
|
||||||
def apply_conditions(query, pi, pii, filters):
|
def apply_conditions(query, pi, pii, filters):
|
||||||
for opts in ("company", "supplier", "item_code", "mode_of_payment"):
|
for opts in ("company", "supplier", "mode_of_payment"):
|
||||||
if filters.get(opts):
|
if filters.get(opts):
|
||||||
query = query.where(pi[opts] == filters[opts])
|
query = query.where(pi[opts] == filters[opts])
|
||||||
|
|
||||||
@@ -299,6 +299,9 @@ def apply_conditions(query, pi, pii, filters):
|
|||||||
if filters.get("to_date"):
|
if filters.get("to_date"):
|
||||||
query = query.where(pi.posting_date <= filters.get("to_date"))
|
query = query.where(pi.posting_date <= filters.get("to_date"))
|
||||||
|
|
||||||
|
if filters.get("item_code"):
|
||||||
|
query = query.where(pii.item_code == filters.get("item_code"))
|
||||||
|
|
||||||
if filters.get("item_group"):
|
if filters.get("item_group"):
|
||||||
query = query.where(pii.item_group == filters.get("item_group"))
|
query = query.where(pii.item_group == filters.get("item_group"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user