Compare commits

...

7 Commits

Author SHA1 Message Date
Frappe PR Bot
17e00b397f chore(release): Bumped to Version 15.43.3
## [15.43.3](https://github.com/frappe/erpnext/compare/v15.43.2...v15.43.3) (2024-11-22)

### Bug Fixes

* patch ([#44191](https://github.com/frappe/erpnext/issues/44191)) ([5f752e2](5f752e29f9))
2024-11-22 09:19:30 +00:00
rohitwaghchaure
1261513ab2 Merge pull request #44280 from frappe/mergify/bp/version-15/pr-44275
fix: patch (backport #44191) (backport #44275)
2024-11-22 14:48:13 +05:30
rohitwaghchaure
5f752e29f9 fix: patch (#44191)
(cherry picked from commit 495528a758)
(cherry picked from commit 8b02402f62)
2024-11-22 06:48:01 +00:00
Frappe PR Bot
81f1f1f1bb chore(release): Bumped to Version 15.43.2
## [15.43.2](https://github.com/frappe/erpnext/compare/v15.43.1...v15.43.2) (2024-11-22)

### Bug Fixes

* include current invoice amount when tax_on_excess_amount is checked ([52e1551](52e1551c23))
2024-11-22 06:00:44 +00:00
ruthra kumar
16ffee9992 Merge pull request #44273 from frappe/mergify/bp/version-15/pr-44194
fix: include current invoice amount when tax_on_excess_amount is checked (backport #44194)
2024-11-22 11:29:29 +05:30
venkat102
2d284de426 test: add unit test for tax on excess amount
(cherry picked from commit 4820273595)
2024-11-22 05:38:25 +00:00
venkat102
52e1551c23 fix: include current invoice amount when tax_on_excess_amount is checked
(cherry picked from commit b74f2896cd)
2024-11-22 05:38:25 +00:00
4 changed files with 43 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import inspect
import frappe
from frappe.utils.user import is_website_user
__version__ = "15.43.1"
__version__ = "15.43.3"
def get_default_company(user=None):

View File

@@ -568,7 +568,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
tax_details.tax_on_excess_amount
):
supp_credit_amt = net_total - cumulative_threshold
supp_credit_amt = net_total + tax_withholding_net_total - cumulative_threshold
if ldc and is_valid_certificate(ldc, inv.get("posting_date") or inv.get("transaction_date"), 0):
tds_amount = get_lower_deduction_amount(

View File

@@ -167,6 +167,45 @@ class TestTaxWithholdingCategory(FrappeTestCase):
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_with_tax_on_excess_amount(self):
invoices = []
frappe.db.set_value("Supplier", "Test TDS Supplier3", "tax_withholding_category", "New TDS Category")
# Invoice with tax and without exceeding single and cumulative thresholds
for _ in range(2):
pi = create_purchase_invoice(supplier="Test TDS Supplier3", rate=10000, do_not_save=True)
pi.apply_tds = 1
pi.append(
"taxes",
{
"category": "Total",
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"tax_amount": 500,
"description": "Test",
"add_deduct_tax": "Add",
},
)
pi.save()
pi.submit()
invoices.append(pi)
# Third Invoice exceeds single threshold and not exceeding cumulative threshold
pi1 = create_purchase_invoice(supplier="Test TDS Supplier3", rate=20000)
pi1.apply_tds = 1
pi1.save()
pi1.submit()
invoices.append(pi1)
# Cumulative threshold is 10,000
# Threshold calculation should be only on the third invoice
self.assertTrue(len(pi1.taxes) > 0)
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_tcs(self):
frappe.db.set_value(
"Customer", "Test TCS Customer", "tax_withholding_category", "Cumulative Threshold TCS"

View File

@@ -38,7 +38,7 @@ def execute():
data = frappe.db.sql(
"""
SELECT
name, item_code, warehouse, voucher_type, voucher_no, posting_date, posting_time, company
name, item_code, warehouse, voucher_type, voucher_no, posting_date, posting_time, company, creation
FROM
`tabStock Ledger Entry`
WHERE
@@ -67,6 +67,7 @@ def execute():
"voucher_type": d.voucher_type,
"voucher_no": d.voucher_no,
"sle_id": d.name,
"creation": d.creation,
},
allow_negative_stock=True,
)