Skip to content

Commit

Permalink
Merge pull request #38767 from GursheenK/skip-bank-jvs-in-tax-report
Browse files Browse the repository at this point in the history
fix: skip JVs against bank accounts in tax report
  • Loading branch information
GursheenK authored Dec 15, 2023
2 parents a1b9560 + f7b2380 commit 41ae2a2
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,16 @@ def get_tds_docs_query(filters, bank_accounts, tds_accounts):

if filters.get("party"):
party = [filters.get("party")]
query = query.where(
((gle.account.isin(tds_accounts) & gle.against.isin(party)))
| ((gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party")))
| gle.party.isin(party)
jv_condition = gle.against.isin(party) | (
(gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party"))
)
else:
party = frappe.get_all(filters.get("party_type"), pluck="name")
query = query.where(
((gle.account.isin(tds_accounts) & gle.against.isin(party)))
| (
(gle.voucher_type == "Journal Entry")
& ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
)
| gle.party.isin(party)
jv_condition = gle.against.isin(party) | (
(gle.voucher_type == "Journal Entry")
& ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
)
query = query.where((gle.account.isin(tds_accounts) & jv_condition) | gle.party.isin(party))
return query


Expand Down

0 comments on commit 41ae2a2

Please sign in to comment.