mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 15:32:14 +00:00
fix: Show itemised TDS breakup based on Apply TDS checkbox on item level
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
"col_break1",
|
"col_break1",
|
||||||
"account_head",
|
"account_head",
|
||||||
"description",
|
"description",
|
||||||
|
"is_tax_withholding_account",
|
||||||
"section_break_10",
|
"section_break_10",
|
||||||
"rate",
|
"rate",
|
||||||
"accounting_dimensions_section",
|
"accounting_dimensions_section",
|
||||||
@@ -225,15 +226,23 @@
|
|||||||
"label": "Account Currency",
|
"label": "Account Currency",
|
||||||
"options": "Currency",
|
"options": "Currency",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "is_tax_withholding_account",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Is Tax Withholding Account",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-01-14 10:04:36.618240",
|
"modified": "2024-04-08 19:51:36.678551",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Taxes and Charges",
|
"name": "Purchase Taxes and Charges",
|
||||||
|
"naming_rule": "Random",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class PurchaseTaxesandCharges(Document):
|
|||||||
description: DF.SmallText
|
description: DF.SmallText
|
||||||
included_in_paid_amount: DF.Check
|
included_in_paid_amount: DF.Check
|
||||||
included_in_print_rate: DF.Check
|
included_in_print_rate: DF.Check
|
||||||
|
is_tax_withholding_account: DF.Check
|
||||||
item_wise_tax_detail: DF.Code | None
|
item_wise_tax_detail: DF.Code | None
|
||||||
parent: DF.Data
|
parent: DF.Data
|
||||||
parentfield: DF.Data
|
parentfield: DF.Data
|
||||||
|
|||||||
@@ -146,7 +146,12 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
|
|||||||
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
|
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
|
||||||
|
|
||||||
cost_center = get_cost_center(inv)
|
cost_center = get_cost_center(inv)
|
||||||
tax_row.update({"cost_center": cost_center})
|
tax_row.update(
|
||||||
|
{
|
||||||
|
"cost_center": cost_center,
|
||||||
|
"is_tax_withholding_account": 1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if inv.doctype == "Purchase Invoice":
|
if inv.doctype == "Purchase Invoice":
|
||||||
return tax_row, tax_deducted_on_advances, voucher_wise_amount
|
return tax_row, tax_deducted_on_advances, voucher_wise_amount
|
||||||
|
|||||||
@@ -466,7 +466,16 @@ class calculate_taxes_and_totals:
|
|||||||
if tax.charge_type == "Actual":
|
if tax.charge_type == "Actual":
|
||||||
# distribute the tax amount proportionally to each item row
|
# distribute the tax amount proportionally to each item row
|
||||||
actual = flt(tax.tax_amount, tax.precision("tax_amount"))
|
actual = flt(tax.tax_amount, tax.precision("tax_amount"))
|
||||||
current_tax_amount = item.net_amount * actual / self.doc.net_total if self.doc.net_total else 0.0
|
|
||||||
|
if tax.get("is_tax_withholding_account") and item.meta.get_field("apply_tds"):
|
||||||
|
if not item.get("apply_tds") or not self.doc.tax_withholding_net_total:
|
||||||
|
current_tax_amount = 0.0
|
||||||
|
else:
|
||||||
|
current_tax_amount = item.net_amount * actual / self.doc.tax_withholding_net_total
|
||||||
|
else:
|
||||||
|
current_tax_amount = (
|
||||||
|
item.net_amount * actual / self.doc.net_total if self.doc.net_total else 0.0
|
||||||
|
)
|
||||||
|
|
||||||
elif tax.charge_type == "On Net Total":
|
elif tax.charge_type == "On Net Total":
|
||||||
current_tax_amount = (tax_rate / 100.0) * item.net_amount
|
current_tax_amount = (tax_rate / 100.0) * item.net_amount
|
||||||
|
|||||||
@@ -58,6 +58,8 @@
|
|||||||
"column_break_27",
|
"column_break_27",
|
||||||
"total",
|
"total",
|
||||||
"net_total",
|
"net_total",
|
||||||
|
"tax_withholding_net_total",
|
||||||
|
"base_tax_withholding_net_total",
|
||||||
"taxes_charges_section",
|
"taxes_charges_section",
|
||||||
"tax_category",
|
"tax_category",
|
||||||
"taxes_and_charges",
|
"taxes_and_charges",
|
||||||
@@ -1246,13 +1248,31 @@
|
|||||||
"label": "Subcontracting Receipt",
|
"label": "Subcontracting Receipt",
|
||||||
"options": "Subcontracting Receipt",
|
"options": "Subcontracting Receipt",
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "tax_withholding_net_total",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Tax Withholding Net Total",
|
||||||
|
"no_copy": 1,
|
||||||
|
"options": "currency",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "base_tax_withholding_net_total",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Base Tax Withholding Net Total",
|
||||||
|
"no_copy": 1,
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-truck",
|
"icon": "fa fa-truck",
|
||||||
"idx": 261,
|
"idx": 261,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-03-20 16:05:31.713453",
|
"modified": "2024-04-08 20:23:03.699201",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt",
|
"name": "Purchase Receipt",
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class PurchaseReceipt(BuyingController):
|
|||||||
base_net_total: DF.Currency
|
base_net_total: DF.Currency
|
||||||
base_rounded_total: DF.Currency
|
base_rounded_total: DF.Currency
|
||||||
base_rounding_adjustment: DF.Currency
|
base_rounding_adjustment: DF.Currency
|
||||||
|
base_tax_withholding_net_total: DF.Currency
|
||||||
base_taxes_and_charges_added: DF.Currency
|
base_taxes_and_charges_added: DF.Currency
|
||||||
base_taxes_and_charges_deducted: DF.Currency
|
base_taxes_and_charges_deducted: DF.Currency
|
||||||
base_total: DF.Currency
|
base_total: DF.Currency
|
||||||
@@ -120,6 +121,7 @@ class PurchaseReceipt(BuyingController):
|
|||||||
supplier_name: DF.Data | None
|
supplier_name: DF.Data | None
|
||||||
supplier_warehouse: DF.Link | None
|
supplier_warehouse: DF.Link | None
|
||||||
tax_category: DF.Link | None
|
tax_category: DF.Link | None
|
||||||
|
tax_withholding_net_total: DF.Currency
|
||||||
taxes: DF.Table[PurchaseTaxesandCharges]
|
taxes: DF.Table[PurchaseTaxesandCharges]
|
||||||
taxes_and_charges: DF.Link | None
|
taxes_and_charges: DF.Link | None
|
||||||
taxes_and_charges_added: DF.Currency
|
taxes_and_charges_added: DF.Currency
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
"pricing_rules",
|
"pricing_rules",
|
||||||
"stock_uom_rate",
|
"stock_uom_rate",
|
||||||
"is_free_item",
|
"is_free_item",
|
||||||
|
"apply_tds",
|
||||||
"section_break_29",
|
"section_break_29",
|
||||||
"net_rate",
|
"net_rate",
|
||||||
"net_amount",
|
"net_amount",
|
||||||
@@ -1107,12 +1108,20 @@
|
|||||||
"fieldname": "use_serial_batch_fields",
|
"fieldname": "use_serial_batch_fields",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Use Serial No / Batch Fields"
|
"label": "Use Serial No / Batch Fields"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "apply_tds",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Apply TDS",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-02-04 11:48:06.653771",
|
"modified": "2024-04-08 20:00:16.278292",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt Item",
|
"name": "Purchase Receipt Item",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class PurchaseReceiptItem(Document):
|
|||||||
|
|
||||||
allow_zero_valuation_rate: DF.Check
|
allow_zero_valuation_rate: DF.Check
|
||||||
amount: DF.Currency
|
amount: DF.Currency
|
||||||
|
apply_tds: DF.Check
|
||||||
asset_category: DF.Link | None
|
asset_category: DF.Link | None
|
||||||
asset_location: DF.Link | None
|
asset_location: DF.Link | None
|
||||||
barcode: DF.Data | None
|
barcode: DF.Data | None
|
||||||
|
|||||||
Reference in New Issue
Block a user