fix: Rate from LDC in TDS reports (#33699)
This commit is contained in:
parent
e68c4e2aa8
commit
db9beb3cdd
@ -259,9 +259,7 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
|
|||||||
if tax_deducted:
|
if tax_deducted:
|
||||||
net_total = inv.tax_withholding_net_total
|
net_total = inv.tax_withholding_net_total
|
||||||
if ldc:
|
if ldc:
|
||||||
tax_amount = get_tds_amount_from_ldc(
|
tax_amount = get_tds_amount_from_ldc(ldc, parties, tax_details, posting_date, net_total)
|
||||||
ldc, parties, pan_no, tax_details, posting_date, net_total
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
|
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
|
||||||
|
|
||||||
@ -538,7 +536,7 @@ def get_invoice_total_without_tcs(inv, tax_details):
|
|||||||
return inv.grand_total - tcs_tax_row_amount
|
return inv.grand_total - tcs_tax_row_amount
|
||||||
|
|
||||||
|
|
||||||
def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net_total):
|
def get_tds_amount_from_ldc(ldc, parties, tax_details, posting_date, net_total):
|
||||||
tds_amount = 0
|
tds_amount = 0
|
||||||
limit_consumed = frappe.db.get_value(
|
limit_consumed = frappe.db.get_value(
|
||||||
"Purchase Invoice",
|
"Purchase Invoice",
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.utils import flt
|
||||||
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
@ -65,6 +66,12 @@ def get_result(
|
|||||||
else:
|
else:
|
||||||
total_amount_credited += entry.credit
|
total_amount_credited += entry.credit
|
||||||
|
|
||||||
|
## Check if ldc is applied and show rate as per ldc
|
||||||
|
actual_rate = (tds_deducted / total_amount_credited) * 100
|
||||||
|
|
||||||
|
if flt(actual_rate) < flt(rate):
|
||||||
|
rate = actual_rate
|
||||||
|
|
||||||
if tds_deducted:
|
if tds_deducted:
|
||||||
row = {
|
row = {
|
||||||
"pan"
|
"pan"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user