balance_sign = finsta03.findtext("S62_CD_INDIK").replace("C", "").replace( "D", "-") credit = finsta03.findtext("SUMA_KREDIT", "").replace(",", ".").replace("=", "") debet = finsta03.findtext("SUMA_DEBIT", "").replace(",", ".").replace("=", "") old_balance = old_balance_sign + old_balance balance = balance_sign + balance credit = credit debet = debet print unicode( render_template_head([ account_number_our, account_bank_code_our, number, date, balance, old_date, old_balance, credit, debet ])).encode('utf8') finsta05 = finsta03.findall("FINSTA05") for item in finsta05: ident = item.findtext("S28_POR_CISLO") account_number = item.findtext("PART_ACCNO", "") account_bank_code = item.findtext("PART_BANK_ID", "") const_symbol = item.findtext("S86_KONSTSYM", "") var_symbol = item.findtext("S86_VARSYMOUR", "") spec_symbol = item.findtext("S86_SPECSYMOUR", "") price = item.findtext("S61_CASTKA").replace("+", "").replace(",", ".") name = item.findtext("PART_ACC_ID") date = datetime.strptime(item.findtext("DPROCD"), "%d.%m.%Y").date().isoformat() code = item.findtext("S61_CD_INDIK")
if len(row) != 16: error('Bad number of columns, text in source is:\n' + ''.join(source_lines)) if first_time: first_time = False own_account_number = row[8].strip() own_account_bank_code = row[9].strip() number = "" date = "" balance = "" old_date = "" old_balance = "" credit = "" debet = "" print render_template_head([ own_account_number, own_account_bank_code, number, date, balance, old_date, old_balance, credit, debet ]) ident = row[15].strip() account_number = row[6].strip() bank_code = row[7].strip() const_symbol = row[11].strip() var_symbol = row[10].strip() spec_symbol = "" price = row[4].strip().replace(',', '.').replace(' ', '') currency = row[3] if currency != 'CZK': # transfers which are not in CZK are processed throught # raiffeisen TXT reports # we set price to zero here in order to import the payment # and be sure that it will not be processed by backend # till correct price in CZK is known
# we don't want to see this as error so just quit silently sys.exit(0) if len(row) != 16: error('Bad number of columns, text in source is:\n' + ''.join(source_lines)) if first_time: first_time = False own_account_number = row[8].strip() own_account_bank_code = row[9].strip() number = "" date = "" balance = "" old_date = "" old_balance = "" credit = "" debet = "" print render_template_head([own_account_number, own_account_bank_code, number, date, balance, old_date, old_balance, credit, debet]) ident = row[15].strip() account_number = row[6].strip() bank_code = row[7].strip() const_symbol = row[11].strip() var_symbol = row[10].strip() spec_symbol = "" price = row[4].strip().replace(',', '.').replace(' ', '') currency = row[3] if currency != 'CZK': # transfers which are not in CZK are processed throught # raiffeisen TXT reports # we set price to zero here in order to import the payment # and be sure that it will not be processed by backend # till correct price in CZK is known price = 0
'dateStart':"", 'openingBalance':"", 'dateEnd':"", 'closingBalance':"", 'credit':"", 'debet':""} for item in info: tag = parse_tag(item.tag)['tag'] if tag in ('dateStart', 'dateEnd'): info_data[tag] = get_isoformat_date(item.text) elif tag in info_data: info_data[tag] = item.text print unicode(render_template_head([info_data['accountId'], info_data['bankId'], info_data['idList'], info_data['dateEnd'], info_data['closingBalance'], info_data['dateStart'], info_data['openingBalance'], info_data['credit'], info_data['debet']])).encode('utf8') transaction_list = root.find(nsFio+"TransactionList") if transaction_list is not None: tag_ident = nsFio + "column_22" tag_account_number = nsFio + "column_2" tag_account_bank_code = nsFio + "column_3" tag_const_symbol = nsFio + "column_4" tag_var_symbol = nsFio + "column_5" tag_spec_symbol = nsFio + "column_6" tag_currency = nsFio + "column_14" tag_price = nsFio + "column_1" tag_name = nsFio + "column_10" tag_date = nsFio + "column_0" tag_memo = nsFio + "column_16"
old_balance = finsta03.findtext("S60_CASTKA").replace(",", ".") old_balance_sign = finsta03.findtext("S60_CD_INDIK").replace("C", "").replace("D", "-") date = datetime.strptime(finsta03.findtext("S62_DATUM"), "%d.%m.%Y").date().isoformat() balance = finsta03.findtext("S62_CASTKA").replace(",", ".") balance_sign = finsta03.findtext("S62_CD_INDIK").replace("C", "").replace("D", "-") credit = finsta03.findtext("SUMA_KREDIT", "").replace(",", ".").replace("=", "") debet = finsta03.findtext("SUMA_DEBIT", "").replace(",", ".").replace("=", "") old_balance = old_balance_sign + old_balance balance = balance_sign + balance credit = credit debet = debet print unicode(render_template_head([account_number_our, account_bank_code_our, number, date, balance, old_date, old_balance, credit, debet])).encode('utf8') finsta05 = finsta03.findall("FINSTA05") for item in finsta05: ident = item.findtext("S28_POR_CISLO") account_number = item.findtext("PART_ACCNO", "") account_bank_code = item.findtext("PART_BANK_ID", "") const_symbol = item.findtext("S86_KONSTSYM", "") var_symbol = item.findtext("S86_VARSYMOUR", "") spec_symbol = item.findtext("S86_SPECSYMOUR", "") price = item.findtext("S61_CASTKA").replace("+", "").replace(",", ".") name = item.findtext("PART_ACC_ID") date = datetime.strptime(item.findtext("DPROCD"), "%d.%m.%Y").date().isoformat() code = item.findtext("S61_CD_INDIK") memo = item.findtext("PART_ID1_1")[:64] crtime = ''