use float value for cost field
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3600 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
12c6855630
commit
8a3d934f53
1 changed files with 11 additions and 3 deletions
|
@ -110,6 +110,14 @@ class BaseView(SchemaBaseView):
|
|||
def isMultiDay(self, service):
|
||||
return time.localtime(service.start)[2] != time.localtime(service.end)[2]
|
||||
|
||||
def getCost(self, service=None):
|
||||
if service is None:
|
||||
service = self.context
|
||||
value = service.getCost()
|
||||
if value:
|
||||
return ('%.2f Euro' % float(value)).replace('.', ',')
|
||||
return u''
|
||||
|
||||
|
||||
class ServiceManagerView(BaseView):
|
||||
|
||||
|
@ -252,7 +260,7 @@ class CheckoutView(ServiceManagerView):
|
|||
number=reg.number,
|
||||
numberWaiting=reg.numberWaiting,
|
||||
externalId=service.externalId or '',
|
||||
cost=service.cost or '',
|
||||
cost=self.getCost(service),
|
||||
serviceObject=service))
|
||||
return result
|
||||
|
||||
|
@ -310,7 +318,7 @@ class CheckoutView(ServiceManagerView):
|
|||
'Uhrzeit: ' + info['fromToTime'],
|
||||
locationInfo]
|
||||
if info['cost']:
|
||||
lineData.append('Kostenbeitrag: %s,00 Euro' % info['cost'])
|
||||
lineData.append('Kostenbeitrag: %s' % info['cost'])
|
||||
if info['externalId']:
|
||||
lineData.append('Code: %s' % info['externalId'])
|
||||
if info['serviceObject'].allowRegWithNumber and info['number']:
|
||||
|
@ -362,7 +370,7 @@ class CheckoutView(ServiceManagerView):
|
|||
result = []
|
||||
waitingHeader = costHeader = externalIdHeader = ''
|
||||
waitingRow = '<td width="5%%">%i</td>'
|
||||
costRow = '<td>%s,00 Euro</td>'
|
||||
costRow = '<td>%s</td>'
|
||||
externalIdRow = '<td>%s</td>'
|
||||
if self.hasWaiting:
|
||||
waitingHeader = '<th width="5%%">Warteliste</th>'
|
||||
|
|
Loading…
Add table
Reference in a new issue