Skip to content

Commit

Permalink
Merge pull request #38770 from frappe/mergify/bp/version-14-hotfix/pr…
Browse files Browse the repository at this point in the history
…-38767

fix: skip JVs against bank accounts in tax report (#38767)
  • Loading branch information
deepeshgarg007 authored Dec 22, 2023
2 parents b254a72 + 98198d3 commit 5065582
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
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 5065582

Please sign in to comment.