ISIN is a 12 letter word

This commit is contained in:
smurail 2014-10-23 14:48:41 +02:00
commit ad31e68143

View file

@ -199,7 +199,7 @@ class InvestmentFormatter(IFormatter):
def start_format(self, **kwargs): def start_format(self, **kwargs):
self.output(' Label Code Quantity Unit Value Valuation diff ') self.output(' Label Code Quantity Unit Value Valuation diff ')
self.output('-------------------------------+----------+------------+------------+------------+---------') self.output('-------------------------------+--------------+------------+------------+------------+---------')
def format_obj(self, obj, alias): def format_obj(self, obj, alias):
label = obj.label label = obj.label
@ -212,7 +212,7 @@ class InvestmentFormatter(IFormatter):
return u' %s %s %s %s %s %s' % \ return u' %s %s %s %s %s %s' % \
(self.colored('%-30s' % label[:30], 'red'), (self.colored('%-30s' % label[:30], 'red'),
self.colored('%-8s' % obj.code[:8], 'yellow') if not empty(obj.code) else ' ' * 8, self.colored('%-12s' % obj.code[:12], 'yellow') if not empty(obj.code) else ' ' * 12,
self.colored('%11.2f' % obj.quantity, 'yellow'), self.colored('%11.2f' % obj.quantity, 'yellow'),
self.colored('%11.2f' % obj.unitvalue, 'yellow'), self.colored('%11.2f' % obj.unitvalue, 'yellow'),
self.colored('%11.2f' % obj.valuation, 'yellow'), self.colored('%11.2f' % obj.valuation, 'yellow'),
@ -220,7 +220,7 @@ class InvestmentFormatter(IFormatter):
) )
def flush(self): def flush(self):
self.output(u'-------------------------------+----------+------------+------------+------------+---------') self.output(u'-------------------------------+--------------+------------+------------+------------+---------')
self.output(u' Total %s %s' % self.output(u' Total %s %s' %
(self.colored('%11.2f' % self.tot_valuation, 'yellow'), (self.colored('%11.2f' % self.tot_valuation, 'yellow'),
self.colored('%9.2f' % self.tot_diff, 'green' if self.tot_diff >=0 else 'red') self.colored('%9.2f' % self.tot_diff, 'green' if self.tot_diff >=0 else 'red')