Sometines the full code is not available. Display description instead
This commit is contained in:
parent
9c86b8f25b
commit
dfead7e925
1 changed files with 5 additions and 1 deletions
|
|
@ -213,10 +213,14 @@ class InvestmentFormatter(IFormatter):
|
|||
format_quantity = '%11.2f'
|
||||
if obj.quantity._isinteger():
|
||||
format_quantity = '%11d'
|
||||
if empty(obj.code) and not empty(obj.description):
|
||||
code = obj.description
|
||||
else:
|
||||
code = obj.code
|
||||
|
||||
return u' %s %s %s %s %s %s' % \
|
||||
(self.colored('%-30s' % label[:30], 'red'),
|
||||
self.colored('%-12s' % obj.code[:12], 'yellow') if not empty(obj.code) else ' ' * 12,
|
||||
self.colored('%-12s' % code[:12], 'yellow') if not empty(code) else ' ' * 12,
|
||||
self.colored(format_quantity % obj.quantity, 'yellow'),
|
||||
self.colored('%11.2f' % obj.unitvalue, 'yellow'),
|
||||
self.colored('%11.2f' % obj.valuation, 'yellow'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue