PDF editor: Add variables for purchase date (Z#23152887) (#4134)

* PDF editor: Add variables for purchase date (Z#23152887)

* Fix order and add time
This commit is contained in:
Raphael Michel
2024-05-07 09:48:05 +02:00
committed by GitHub
parent b8c0887f79
commit 7a63498333

View File

@@ -408,6 +408,30 @@ DEFAULT_VARIABLES = OrderedDict((
"TIME_FORMAT"
)
}),
("purchase_date", {
"label": _("Purchase date"),
"editor_sample": _("2017-05-31"),
"evaluate": lambda op, order, ev: date_format(
order.datetime.astimezone(ev.timezone),
"SHORT_DATE_FORMAT"
)
}),
("purchase_datetime", {
"label": _("Purchase date and time"),
"editor_sample": _("2017-05-31 19:00"),
"evaluate": lambda op, order, ev: date_format(
order.datetime.astimezone(ev.timezone),
"SHORT_DATETIME_FORMAT"
)
}),
("purchase_time", {
"label": _("Purchase time"),
"editor_sample": _("19:00"),
"evaluate": lambda op, order, ev: date_format(
order.datetime.astimezone(ev.timezone),
"TIME_FORMAT"
)
}),
("valid_from_date", {
"label": _("Validity start date"),
"editor_sample": _("2017-05-31"),