fix: skip jvs against bank accounts
This commit is contained in:
parent
a1b95606b1
commit
f7b2380ec1
@ -345,21 +345,16 @@ def get_tds_docs_query(filters, bank_accounts, tds_accounts):
|
|||||||
|
|
||||||
if filters.get("party"):
|
if filters.get("party"):
|
||||||
party = [filters.get("party")]
|
party = [filters.get("party")]
|
||||||
query = query.where(
|
jv_condition = gle.against.isin(party) | (
|
||||||
((gle.account.isin(tds_accounts) & gle.against.isin(party)))
|
(gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party"))
|
||||||
| ((gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party")))
|
|
||||||
| gle.party.isin(party)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
party = frappe.get_all(filters.get("party_type"), pluck="name")
|
party = frappe.get_all(filters.get("party_type"), pluck="name")
|
||||||
query = query.where(
|
jv_condition = gle.against.isin(party) | (
|
||||||
((gle.account.isin(tds_accounts) & gle.against.isin(party)))
|
|
||||||
| (
|
|
||||||
(gle.voucher_type == "Journal Entry")
|
(gle.voucher_type == "Journal Entry")
|
||||||
& ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
|
& ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
|
||||||
)
|
)
|
||||||
| gle.party.isin(party)
|
query = query.where((gle.account.isin(tds_accounts) & jv_condition) | gle.party.isin(party))
|
||||||
)
|
|
||||||
return query
|
return query
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user