def read_sparda_ethik(self,infile,is_sparda=True): blz = None baccount_no = None r = 0 if is_sparda else 1 for row in utils.get_csv('iso-8859-4',infile,replacenl=is_sparda): if not row: continue if row[0]=='BLZ:': blz = int(row[1]) continue if row[0]=='Konto:': baccount_no = int(row[1]) continue date = utils.convert_date4(row[0]) if not date: continue if row[9+r]=='Anfangssaldo': self.sbal = utils.read_float(row[11+r],row[12+r]) continue if row[9+r]=='Endsaldo': self.ebal = utils.read_float(row[11+r],row[12+r]) continue be = BankStatementEntry(self) be.posting_date = date be.purpose = row[8+r] be.partner = row[3+r] be.partner_iban = row[5+r] be.amount = utils.read_float(row[11+r],row[12+r]) be.cleanup() self.entries.append(be) if blz and baccount_no: self.iban = utils.iban_de(blz,baccount_no)
def get_baccount(cls,infile): blz = None baccount_no = None iban = None for row in utils.get_csv('iso-8859-4',infile): if not row: continue if row[0]=='BLZ:': blz = int(row[1]) continue if row[0]=='Konto:': baccount_no = int(row[1]) continue if row[0][0:2]=='DE': iban = row[0] break if blz and baccount_no: iban = utils.iban_de(blz,baccount_no) break if iban and iban in BankAccount.baccounts_by_iban: return (BankAccount.baccounts_by_iban[iban],iban) else: return (None,iban)