From 2feeebb5fbe7972b8b638d65b54f441e5cc16b27 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Thu, 26 Dec 2024 17:18:39 +0530 Subject: [PATCH] fix: get item tax template based on posting date (cherry picked from commit 976e35d5472c1c8cae2b3f3a28dd4487e8ac577e) --- erpnext/stock/get_item_details.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index d5d492a2c93..17a8fe2cb6a 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -592,7 +592,10 @@ def _get_item_tax_template(args, taxes, out=None, for_validate=False): if tax.valid_from or tax.maximum_net_rate: # In purchase Invoice first preference will be given to supplier invoice date # if supplier date is not present then posting date - validation_date = args.get("bill_date") or args.get("transaction_date") + + validation_date = ( + args.get("bill_date") or args.get("posting_date") or args.get("transaction_date") + ) if getdate(tax.valid_from) <= getdate(validation_date) and is_within_valid_range(args, tax): taxes_with_validity.append(tax)