Add a new field to Operations to permit a better export to qif
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
parent
5541107a7f
commit
9d900578a3
2 changed files with 3 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ __all__ = ['Boobank']
|
|||
|
||||
|
||||
class QifFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'date', 'label', 'amount')
|
||||
MANDATORY_FIELDS = ('id', 'date', 'label', 'amount', 'category')
|
||||
|
||||
count = 0
|
||||
|
||||
|
|
@ -43,6 +43,7 @@ class QifFormatter(IFormatter):
|
|||
result += u'D%s\n' % item['date'].strftime('%d/%m/%y')
|
||||
result += u'T%s\n' % item['amount']
|
||||
result += u'M%s\n' % item['label']
|
||||
result += u'N%s\n' % item['category']
|
||||
result += u'^\n'
|
||||
self.count += 1
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ class Operation(CapBaseObject):
|
|||
self.add_field('date', (basestring, datetime, date))
|
||||
self.add_field('label', unicode)
|
||||
self.add_field('amount', float)
|
||||
self.add_field('category', unicode)
|
||||
|
||||
def __repr__(self):
|
||||
return "<Operation date='%s' label='%s' amount=%s>" % (self.date,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue