Esempio n. 1
0
 def __init__(self, id):
     self.head = Block()
     self.head.seq = -1
     self.head.add_trans(Transaction(id, id, 10))
     self.tail = self.head
     self.id = id
     self.buffer = []
Esempio n. 2
0
    def buildKiwibankList(data):
        dateMatch = '[0-9].+-[0-9].+-.+'

        transactions = []
        for idx, row in data.iterrows():
            if re.search(dateMatch, row['Date']):
                description = row['Memo/Description']
                displayName = KiwibankHelper.formatDescription(description)
                date = row['Date']
                debit = row['Amount (debit)'] or None
                credit = row['Amount (credit)'] or None
                newTransaction = Transaction(displayName, debit, credit, date,
                                             description)
                transactions.append(newTransaction)
        return transactions
Esempio n. 3
0
 def buildAnzList(data):
     transactions = []
     for idx, row in data.iterrows():
         name = AnzHelper.getAnzTransactionName(row)
         displayName = name if len(name) < 35 else (name[:32] + '...')
         if 'Processed Date' in row:
             timestamp = row['Processed Date']
             date = '{}-{}-{}'.format(timestamp.day, timestamp.month, timestamp.year)
         else:
             date = row['Date'].replace('/', '-')
         amount = row['Amount']
         credit = amount if amount > 0 else None
         debit = abs(amount) if amount <= 0 else None
         newTransaction = Transaction(displayName, debit, credit, date, name)
         transactions.append(newTransaction)
     return transactions