mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-04 05:58:27 +00:00
Merge pull request #50671 from frappe/mergify/bp/version-15-hotfix/pr-50667
fix: pricing rule was ignoring time validity (backport #50667)
This commit is contained in:
@@ -243,10 +243,13 @@ def get_other_conditions(conditions, values, args):
|
|||||||
if group_condition:
|
if group_condition:
|
||||||
conditions += " and " + group_condition
|
conditions += " and " + group_condition
|
||||||
|
|
||||||
if args.get("transaction_date"):
|
date = args.get("transaction_date") or frappe.get_value(
|
||||||
|
args.get("doctype"), args.get("name"), "posting_date"
|
||||||
|
)
|
||||||
|
if date:
|
||||||
conditions += """ and %(transaction_date)s between ifnull(`tabPricing Rule`.valid_from, '2000-01-01')
|
conditions += """ and %(transaction_date)s between ifnull(`tabPricing Rule`.valid_from, '2000-01-01')
|
||||||
and ifnull(`tabPricing Rule`.valid_upto, '2500-12-31')"""
|
and ifnull(`tabPricing Rule`.valid_upto, '2500-12-31')"""
|
||||||
values["transaction_date"] = args.get("transaction_date")
|
values["transaction_date"] = date
|
||||||
|
|
||||||
if args.get("doctype") in [
|
if args.get("doctype") in [
|
||||||
"Quotation",
|
"Quotation",
|
||||||
|
|||||||
Reference in New Issue
Block a user