Skip to content

Commit

Permalink
fix: get item tax template based on posting date
Browse files Browse the repository at this point in the history
(cherry picked from commit 976e35d)
  • Loading branch information
ljain112 authored and ruthra-kumar committed Dec 30, 2024
1 parent f6a9051 commit 2feeebb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2feeebb

Please sign in to comment.