fix: TDS deduction via journal entry
This commit is contained in:
parent
0a6462e627
commit
36d0906ea2
@ -184,7 +184,9 @@ class JournalEntry(AccountsController):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
tax_withholding_details = get_party_tax_withholding_details(inv, self.tax_withholding_category)
|
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
|
||||||
|
inv, self.tax_withholding_category
|
||||||
|
)
|
||||||
|
|
||||||
if not tax_withholding_details:
|
if not tax_withholding_details:
|
||||||
return
|
return
|
||||||
|
|||||||
@ -344,23 +344,25 @@ def get_advance_vouchers(
|
|||||||
|
|
||||||
|
|
||||||
def get_taxes_deducted_on_advances_allocated(inv, tax_details):
|
def get_taxes_deducted_on_advances_allocated(inv, tax_details):
|
||||||
advances = [d.reference_name for d in inv.get("advances")]
|
|
||||||
tax_info = []
|
tax_info = []
|
||||||
|
|
||||||
if advances:
|
if inv.get("advances"):
|
||||||
pe = frappe.qb.DocType("Payment Entry").as_("pe")
|
advances = [d.reference_name for d in inv.get("advances")]
|
||||||
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
|
|
||||||
|
|
||||||
tax_info = (
|
if advances:
|
||||||
frappe.qb.from_(at)
|
pe = frappe.qb.DocType("Payment Entry").as_("pe")
|
||||||
.inner_join(pe)
|
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
|
||||||
.on(pe.name == at.parent)
|
|
||||||
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
|
tax_info = (
|
||||||
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
|
frappe.qb.from_(at)
|
||||||
.where(at.parent.isin(advances))
|
.inner_join(pe)
|
||||||
.where(at.account_head == tax_details.account_head)
|
.on(pe.name == at.parent)
|
||||||
.run(as_dict=True)
|
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
|
||||||
)
|
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
|
||||||
|
.where(at.parent.isin(advances))
|
||||||
|
.where(at.account_head == tax_details.account_head)
|
||||||
|
.run(as_dict=True)
|
||||||
|
)
|
||||||
|
|
||||||
return tax_info
|
return tax_info
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user