mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: date condition in tax rule
This commit is contained in:
@@ -163,10 +163,15 @@ def get_party_details(party, party_type, args=None):
|
|||||||
def get_tax_template(posting_date, args):
|
def get_tax_template(posting_date, args):
|
||||||
"""Get matching tax rule"""
|
"""Get matching tax rule"""
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
from_date = to_date = posting_date
|
||||||
|
if not posting_date:
|
||||||
|
from_date = "1900-01-01"
|
||||||
|
to_date = "4000-01-01"
|
||||||
|
|
||||||
conditions = [
|
conditions = [
|
||||||
"""(from_date is null or from_date <= '{0}')
|
"""(from_date is null or from_date <= '{0}')
|
||||||
and (to_date is null or to_date >= '{0}')""".format(
|
and (to_date is null or to_date >= '{1}')""".format(
|
||||||
posting_date
|
from_date, to_date
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user