Commit ef2aec16 authored by Jérome Perrin's avatar Jérome Perrin

payroll: reimplement date formatting for printouts

See 4bb5d32e
parent 4bb5d32e
......@@ -73,13 +73,15 @@ def getCareerId(career_title):
preferred_date_order = context.getPortalObject().portal_preferences\
.getPreferredDateOrder() or 'ymd'
separator = '/'
def getOrderedDate(date):
if date is None:
return ''
pattern = separator.join(['%%%s' % s for s in list(preferred_date_order)])
pattern = pattern.replace('y', 'Y')
return date.strftime(pattern)
date_parts = {
'y': '%04d' % date.year(),
'm': '%02d' % date.month(),
'd': '%02d' % date.day(),
}
return '/'.join([date_parts[part] for part in preferred_date_order])
def getPaymentConditionText(order):
if order.getPaymentConditionPaymentEndOfMonth():
......
......@@ -100,13 +100,15 @@ year_to_date_total_employer_tax = paysheet.PaySheetTransaction_getYearToDateMove
preferred_date_order = portal.portal_preferences\
.getPreferredDateOrder() or 'ymd'
separator = '/'
def getOrderedDate(date):
if date is None:
return ''
pattern = separator.join(['%%%s' % s for s in list(preferred_date_order)])
pattern = pattern.replace('y', 'Y')
return date.strftime(pattern)
date_parts = {
'y': '%04d' % date.year(),
'm': '%02d' % date.month(),
'd': '%02d' % date.day(),
}
return '/'.join([date_parts[part] for part in preferred_date_order])
def getPaymentConditionText(paysheet):
date = ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment