diff --git a/addons/l10n_be_coda/wizard/account_coda_import.py b/addons/l10n_be_coda/wizard/account_coda_import.py index 0bde26e1f44..2286caf8f68 100644 --- a/addons/l10n_be_coda/wizard/account_coda_import.py +++ b/addons/l10n_be_coda/wizard/account_coda_import.py @@ -45,7 +45,6 @@ class account_coda_import(osv.osv_memory): if context is None: context = {} if batch: - print codafile = str(codafile) codafilename = codafilename else: @@ -54,7 +53,7 @@ class account_coda_import(osv.osv_memory): codafile = data.coda_data codafilename = data.coda_fname except: - raise osv.except_osv(_('Error!'), _('Wizard in incorrect state. Please hit the Cancel button!')) + raise osv.except_osv(_('Error'), _('Wizard in incorrect state. Please hit the Cancel button')) return {} recordlist = unicode(base64.decodestring(codafile), 'windows-1252', 'strict').split('\n') statements = [] @@ -67,7 +66,7 @@ class account_coda_import(osv.osv_memory): statements.append(statement) statement['version'] = line[127] if statement['version'] not in ['1', '2']: - raise osv.except_osv(_('Error R001!'), _('CODA V%s statements are not supported, please contact your bank!') % statement['version']) + raise osv.except_osv(_('Error') + 'R001', _('CODA V%s statements are not supported, please contact your bank') % statement['version']) statement['globalisation_stack'] = [] statement['lines'] = [] statement['date'] = time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT, time.strptime(rmspaces(line[5:11]), '%d%m%y')) @@ -75,21 +74,31 @@ class account_coda_import(osv.osv_memory): elif line[0] == '1': #Statement details if statement['version'] == '1': - statement['accountNumber'] = rmspaces(line[5:17]) + statement['acc_number'] = rmspaces(line[5:17]) statement['currency'] = rmspaces(line[18:21]) elif statement['version'] == '2': if line[1] == '0': # Belgian bank account BBAN structure - statement['accountNumber'] = rmspaces(line[5:17]) + statement['acc_number'] = rmspaces(line[5:17]) statement['currency'] = rmspaces(line[18:21]) elif line[1] == '1': # foreign bank account BBAN structure - raise osv.except_osv(_('Error R1001!'), _('Foreign bank accounts with BBAN structure are not supported !')) + raise osv.except_osv(_('Error') + 'R1001', _('Foreign bank accounts with BBAN structure are not supported ')) elif line[1] == '2': # Belgian bank account IBAN structure - statement['accountNumber'] = rmspaces(line[5:21]) + statement['acc_number'] = rmspaces(line[5:21]) statement['currency'] = rmspaces(line[39:42]) elif line[1] == '3': # foreign bank account IBAN structure - raise osv.except_osv(_('Error R1002!'), _('Foreign bank accounts with IBAN structure are not supported !')) + raise osv.except_osv(_('Error') + 'R1002', _('Foreign bank accounts with IBAN structure are not supported ')) else: # Something else, not supported - raise osv.except_osv(_('Error R1003!'), _('Unsupported bank account structure !')) + raise osv.except_osv(_('Error') + 'R1003', _('Unsupported bank account structure ')) + ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', statement['acc_number'])]) + not_found_except = osv.except_osv(_('Error') + 'R1004', _("No matching CODA Bank Account Configuration record found. Please check if the 'Bank Account Number' and 'Currency' fields of your configuration record match with '%s' and '%s'.") % (statement['acc_number'], statement['currency'])) + if ids and len(ids) > 0: + bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, ids) + for bank_acc in bank_accs: + statement['journal_id'] = bank_acc.journal_id + if (statement['journal_id'].currency and statement['journal_id'].currency.name != statement['currency']) and (not statement['journal_id'].currency and statement['journal_id'].company_id.currency_id.name != statement['currency']): + raise not_found_except + else: + raise not_found_except statement['description'] = rmspaces(line[90:125]) statement['balance_start'] = float(rmspaces(line[43:58])) / 1000 statement['balance_start_date'] = time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT, time.strptime(rmspaces(line[58:64]), '%d%m%y')) @@ -112,16 +121,12 @@ class account_coda_import(osv.osv_memory): statementLine['amount'] = - statementLine['amount'] statementLine['transaction_type'] = line[53] if statementLine['transaction_type'] not in transaction_types: - raise osv.except_osv(_('Error R2001!'), _('The File contains an invalid CODA Transaction Type : %s!') % statementLine['transaction_type']) + raise osv.except_osv(_('Error') + 'R2001', _('The File contains an invalid CODA Transaction Type : %s') % statementLine['transaction_type']) statementLine['transactionDate'] = time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT, time.strptime(rmspaces(line[47:53]), '%d%m%y')) statementLine['transaction_family'] = rmspaces(line[54:56]) - #TODO Handling severals transactions Family statementLine['transaction_code'] = rmspaces(line[56:58]) - #TODO Handling severals transactions code statementLine['transaction_category'] = rmspaces(line[58:61]) - #TODO Handling severals transactions category statementLine['communication'] = rmspaces(line[62:115]) - #TODO Handling structured communication statementLine['entryDate'] = rmspaces(line[115:121]) statementLine['type'] = 'normal' statementLine['globalisation'] = int(line[124]) @@ -138,13 +143,13 @@ class account_coda_import(osv.osv_memory): statement['lines'].append(statementLine) elif line[1] == '2': if statement['lines'][-1]['ref'][0:4] != line[2:6]: - raise osv.except_osv(_('Error R2004!'), _('CODA parsing error on movement data record 2.2, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) + raise osv.except_osv(_('Error') + 'R2004', _('CODA parsing error on movement data record 2.2, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) statement['lines'][-1]['communication'] += rmspaces(line[10:63]) statement['lines'][-1]['payment_reference'] = rmspaces(line[63:98]) statement['lines'][-1]['counterparty_bic'] = rmspaces(line[98:109]) elif line[1] == '3': if statement['lines'][-1]['ref'][0:4] != line[2:6]: - raise osv.except_osv(_('Error R2005!'), _('CODA parsing error on movement data record 2.3, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) + raise osv.except_osv(_('Error') + 'R2005', _('CODA parsing error on movement data record 2.3, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) if statement['version'] == '1': statement['lines'][-1]['counterpartyNumber'] = rmspaces(line[10:22]) statement['lines'][-1]['counterpartyName'] = rmspaces(line[47:125]) @@ -160,7 +165,7 @@ class account_coda_import(osv.osv_memory): statement['lines'][-1]['communication'] += rmspaces(line[82:125]) else: # movement data record 2.x (x != 1,2,3) - raise osv.except_osv(_('Error R2009!'), _('\nMovement data records of type 2.%s are not supported !') % line[1]) + raise osv.except_osv(_('Error') + 'R2006', _('\nMovement data records of type 2.%s are not supported ') % line[1]) elif line[0] == '3': if line[1] == '1': infoLine = {} @@ -179,11 +184,11 @@ class account_coda_import(osv.osv_memory): statement['lines'].append(infoLine) elif line[1] == '2': if infoLine['ref'] != rmspaces(line[2:10]): - raise osv.except_osv(_('Error R3004!'), _('CODA parsing error on information data record 3.2, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) + raise osv.except_osv(_('Error') + 'R3004', _('CODA parsing error on information data record 3.2, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) statement['lines'][-1]['communication'] += rmspaces(line[10:100]) elif line[1] == '3': if infoLine['ref'] != rmspaces(line[2:10]): - raise osv.except_osv(_('Error R3005!'), _('CODA parsing error on information data record 3.3, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) + raise osv.except_osv(_('Error') + 'R3005', _('CODA parsing error on information data record 3.3, seq nr %s! Please report this issue via your OpenERP support channel.') % line[2:10]) statement['lines'][-1]['communication'] += rmspaces(line[10:100]) elif line[0] == '4': comm_line = {} @@ -207,7 +212,7 @@ class account_coda_import(osv.osv_memory): else: period_id = self.pool.get('account.period').search(cr, uid, [('date_start', '<=', statement['date']), ('date_stop', '>=', statement['date'])]) if not period_id and len(period_id) == 0: - raise osv.except_osv(_('Error R0002!'), _("The CODA Statement New Balance date doesn't fall within a defined Accounting Period! Please create the Accounting Period for date %s.") % statement['balance_end_realDate']) + raise osv.except_osv(_('Error') + 'R0002', _("The CODA Statement New Balance date doesn't fall within a defined Accounting Period! Please create the Accounting Period for date %s.") % statement['balance_end_realDate']) statement['period_id'] = period_id[0] elif line[0] == '9': statement['balanceMin'] = float(rmspaces(line[22:37])) / 1000 @@ -215,16 +220,13 @@ class account_coda_import(osv.osv_memory): if not statement['balance_end_real']: statement['balance_end_real'] = statement['balance_start'] + statement['balancePlus'] - statement['balanceMin'] for i, statement in enumerate(statements): - # print '---STATEMENT #' + str(i) + '---' - print statement data = { 'name': '[' + statement['date'] + ']' + statement['description'], 'date': statement['date'], - 'journal_id': 18, + 'journal_id': statement['journal_id'].id, 'period_id': statement['period_id'], 'balance_start': statement['balance_start'], 'balance_end_real': statement['balance_end_real'], - 'account_id': 1 } statement['id'] = self.pool.get('account.bank.statement').create(cr, uid, data, context=context) for line in statement['lines']: @@ -264,7 +266,7 @@ class account_coda_import(osv.osv_memory): if 'counterpartyNumber' in line and line['counterpartyNumber']: ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', str(line['counterpartyNumber']))]) if ids and len(ids) > 0: - partner_id = self.pool.get('res.partner.bank').browse(cr, uid, ids[0],context=context).partner_id.id + partner_id = self.pool.get('res.partner.bank').browse(cr, uid, ids[0], context=context).partner_id.id else: partner_id = None @@ -275,7 +277,7 @@ class account_coda_import(osv.osv_memory): 'amount': line['amount'], # 'type': '', 'partner_id': partner_id, - 'account_id': 1, + 'account_id': 1, # TODO 'statement_id': statement['id'], # 'analytic_account_id': '', # 'move_ids': '', @@ -287,449 +289,449 @@ class account_coda_import(osv.osv_memory): account_coda_import() transaction_types = { - "0": ["", _("Simple amount without detailed data; e.g. : an individual credit transfer [free of charges].")], - "1": ["", _("Amount as totalised by the customer; e.g. a file regrouping payments of wages or payments made to suppliers or a file regrouping collections for which the customer is ]debited or credited with one single amount. As a matter of principle, this type is also used when no detailed data is following [type 5].")], - "5": ["1", _("Detail of 1. Standard procedure is no detailing. However, the customer may ask for detailed data to be included into his file after the overall record [type 1].")], - "2": ["", _("Amount as totalised by the bank; e.g. : the total amount of a series of credit transfers with a structured communication As a matter of principle, this type will also be used when no detailed data [type 6 or 7] is following.")], - "6": ["2", _("Detail of 2. Simple amount without detailed data. Normally, data of this kind comes after type 2. The customer may ask for a separate file containing the detailed data. In that case, one will speak of a ‘separate application’. The records in a separate application keep type 6.")], - "7": ["2", _("Detail of 2. Simple account with detailed data The records in a separate application keep type 7.")], - "9": ["7", _("Detail of 7. The records in a separate application keep type 9.")], - "3": ["", _("Simple amount with detailed data; e.g. in case of charges for cross-border credit transfers.")], - "8": ["3", _("Detail of 3.")], + "0": ["", "Simple amount without detailed data; e.g. : an individual credit transfer [free of charges]."], + "1": ["", "Amount as totalised by the customer; e.g. a file regrouping payments of wages or payments made to suppliers or a file regrouping collections for which the customer is ]debited or credited with one single amount. As a matter of principle, this type is also used when no detailed data is following [type 5]."], + "5": ["1", "Detail of 1. Standard procedure is no detailing. However, the customer may ask for detailed data to be included into his file after the overall record [type 1]."], + "2": ["", "Amount as totalised by the bank; e.g. : the total amount of a series of credit transfers with a structured communication As a matter of principle, this type will also be used when no detailed data [type 6 or 7] is following."], + "6": ["2", "Detail of 2. Simple amount without detailed data. Normally, data of this kind comes after type 2. The customer may ask for a separate file containing the detailed data. In that case, one will speak of a ‘separate application’. The records in a separate application keep type 6."], + "7": ["2", "Detail of 2. Simple account with detailed data The records in a separate application keep type 7."], + "9": ["7", "Detail of 7. The records in a separate application keep type 9."], + "3": ["", "Simple amount with detailed data; e.g. in case of charges for cross-border credit transfers."], + "8": ["3", "Detail of 3."], } transaction_codes = { - "00": [_("Undefined transactions"), { - "89": _("Cancellation of a transaction"), - "87": _("Costs refunded"), - "85": _("Correction"), - "83": _("Value correction"), - "39": _("Cancellation of a transaction"), - "37": _("Costs"), - "35": _("Correction"), - "33": _("Value correction"), - "00": _("Undefined transaction") + "00": ["Undefined transactions", { + "89": "Cancellation of a transaction", + "87": "Costs refunded", + "85": "Correction", + "83": "Value correction", + "39": "Cancellation of a transaction", + "37": "Costs", + "35": "Correction", + "33": "Value correction", + "00": "Undefined transaction", }], - "01": [_("Domestic or local SEPA credit transfers"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "66": _("Financial centralization"), - "64": _("Transfer to your account"), - "62": _("Unpaid postal order"), - "60": _("Non-presented circular cheque"), - "54": _("Unexecutable transfer order"), - "52": _("Payment in your favour"), - "51": _("Transfer in your favour – initiated by the bank"), - "50": _("Transfer in your favour"), - "49": _("Cancellation or correction"), - "39": _("Your issue circular cheque"), - "37": _("Costs"), - "17": _("Financial centralisation"), - "15": _("Balance due insurance premium"), - "13": _("Transfer from your account"), - "11": _("Your semi-standing order – payment to employees"), - "09": _("Your semi-standing order"), - "07": _("Collective transfer"), - "05": _("Payment of wages etc."), - "03": _("Standing order"), - "02": _("Individual transfer order initiated by the bank"), - "01": _("Individual transfer order]"), + "01": ["Domestic or local SEPA credit transfers", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "66": "Financial centralization", + "64": "Transfer to your account", + "62": "Unpaid postal order", + "60": "Non-presented circular cheque", + "54": "Unexecutable transfer order", + "52": "Payment in your favour", + "51": "Transfer in your favour – initiated by the bank", + "50": "Transfer in your favour", + "49": "Cancellation or correction", + "39": "Your issue circular cheque", + "37": "Costs", + "17": "Financial centralisation", + "15": "Balance due insurance premium", + "13": "Transfer from your account", + "11": "Your semi-standing order – payment to employees", + "09": "Your semi-standing order", + "07": "Collective transfer", + "05": "Payment of wages etc.", + "03": "Standing order", + "02": "Individual transfer order initiated by the bank", + "01": "Individual transfer order", }], - "03": [_("Cheques"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of cheque-related costs"), - "68": _("Credit of a payment via electronic purse"), - "66": _("Remittance of cheque by your branch - credit under usual reserve"), - "64": _("Reversal of settlement of credit card"), - "63": _("Second credit of unpaid cheque"), - "62": _("Reversal of cheque"), - "60": _("Reversal of voucher"), - "58": _("Remittance of cheques, vouchers, etc. credit after collection"), - "56": _("Non-presented certified cheques"), - "52": _("First credit of cheques, vouchers, luncheon vouchers, postal orders, credit under usual reserve"), - "50": _("Credit of a payment via terminal"), - "49": _("Cancellation or correction"), - "39": _("Provisionally unpaid due to other reason than manual presentation"), - "38": _("Provisionally unpaid"), - "37": _("Cheque-related costs"), - "35": _("Cash advance"), - "19": _("Settlement of credit cards"), - "17": _("Your certified cheque"), - "15": _("Your purchase bank cheque"), - "13": _("Eurocheque written out abroad"), - "11": _("Department store cheque"), - "09": _("Unpaid voucher"), - "07": _("Definitely unpaid cheque"), - "05": _("Payment of voucher"), - "03": _("Your purchase by payment card"), - "01": _("Payment of your cheque"), + "03": ["Cheques", { + "99": "Cancellation or correction", + "87": "Reimbursement of cheque-related costs", + "68": "Credit of a payment via electronic purse", + "66": "Remittance of cheque by your branch - credit under usual reserve", + "64": "Reversal of settlement of credit card", + "63": "Second credit of unpaid cheque", + "62": "Reversal of cheque", + "60": "Reversal of voucher", + "58": "Remittance of cheques, vouchers, etc. credit after collection", + "56": "Non-presented certified cheques", + "52": "First credit of cheques, vouchers, luncheon vouchers, postal orders, credit under usual reserve", + "50": "Credit of a payment via terminal", + "49": "Cancellation or correction", + "39": "Provisionally unpaid due to other reason than manual presentation", + "38": "Provisionally unpaid", + "37": "Cheque-related costs", + "35": "Cash advance", + "19": "Settlement of credit cards", + "17": "Your certified cheque", + "15": "Your purchase bank cheque", + "13": "Eurocheque written out abroad", + "11": "Department store cheque", + "09": "Unpaid voucher", + "07": "Definitely unpaid cheque", + "05": "Payment of voucher", + "03": "Your purchase by payment card", + "01": "Payment of your cheque", }], - "04": [_("Cards"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "68": _("Credit after Proton payments"), - "55": _("Income from payments by GSM"), - "53": _("Cash deposit at an ATM"), - "52": _("Loading GSM cards"), - "51": _("Unloading Proton"), - "50": _("Credit after a payment at a terminal"), - "49": _("Cancellation or correction"), - "37": _("Costs"), - "08": _("Payment by means of a payment card outside the Eurozone"), - "07": _("Payment by GSM"), - "06": _("Payment with tank card"), - "05": _("Loading Proton"), - "04": _("Cash withdrawal from an ATM"), - "03": _("Settlement credit cards"), - "02": _("Payment by means of a payment card within the Eurozone"), - "01": _("Loading a GSM card"), + "04": ["Cards", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "68": "Credit after Proton payments", + "55": "Income from payments by GSM", + "53": "Cash deposit at an ATM", + "52": "Loading GSM cards", + "51": "Unloading Proton", + "50": "Credit after a payment at a terminal", + "49": "Cancellation or correction", + "37": "Costs", + "08": "Payment by means of a payment card outside the Eurozone", + "07": "Payment by GSM", + "06": "Payment with tank card", + "05": "Loading Proton", + "04": "Cash withdrawal from an ATM", + "03": "Settlement credit cards", + "02": "Payment by means of a payment card within the Eurozone", + "01": "Loading a GSM card", }], - "05": [_("Direct debit"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "58": _("Reversal"), - "56": _("Unexecutable reimbursement"), - "54": _("Reimbursement"), - "52": _("Credit under usual reserve"), - "50": _("Credit after collection"), - "49": _("Cancellation or correction"), - "37": _("Costs"), - "05": _("Reimbursement"), - "03": _("Unpaid debt"), - "01": _("Payment"), + "05": ["Direct debit", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "58": "Reversal", + "56": "Unexecutable reimbursement", + "54": "Reimbursement", + "52": "Credit under usual reserve", + "50": "Credit after collection", + "49": "Cancellation or correction", + "37": "Costs", + "05": "Reimbursement", + "03": "Unpaid debt", + "01": "Payment", }], - "07": [_("Domestic commercial paper"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "86": _("Payment after cession"), - "64": _("Warrant"), - "58": _("Remittance of supplier's bill without guarantee"), - "56": _("Remittance of supplier's bill with guarantee"), - "54": _("Remittance of commercial paper for discount"), - "52": _("Remittance of commercial paper - credit under usual reserve"), - "50": _("Remittance of commercial paper - credit after collection"), - "49": _("Cancellation or correction"), - "39": _("Return of an irregular bill of exchange"), - "37": _("Costs related to commercial paper"), - "14": _("Warrant fallen due"), - "12": _("Safe custody"), - "10": _("Renewal of agreed maturity date"), - "09": _("Agio on supplier's bill"), - "08": _("Payment in advance"), - "07": _("Unpaid commercial paper"), - "06": _("Extension of maturity date"), - "05": _("Commercial paper claimed back"), - "03": _("Payment receipt card"), - "01": _("Payment commercial paper"), + "07": ["Domestic commercial paper", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "86": "Payment after cession", + "64": "Warrant", + "58": "Remittance of supplier's bill without guarantee", + "56": "Remittance of supplier's bill with guarantee", + "54": "Remittance of commercial paper for discount", + "52": "Remittance of commercial paper - credit under usual reserve", + "50": "Remittance of commercial paper - credit after collection", + "49": "Cancellation or correction", + "39": "Return of an irregular bill of exchange", + "37": "Costs related to commercial paper", + "14": "Warrant fallen due", + "12": "Safe custody", + "10": "Renewal of agreed maturity date", + "09": "Agio on supplier's bill", + "08": "Payment in advance", + "07": "Unpaid commercial paper", + "06": "Extension of maturity date", + "05": "Commercial paper claimed back", + "03": "Payment receipt card", + "01": "Payment commercial paper", }], - "09": [_("Counter transactions"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "70": _("Sale of traveller’s cheque"), - "68": _("Difference in payment"), - "66": _("Repurchase of petrol coupons"), - "64": _("Your winning lottery ticket"), - "62": _("Sale of gold/pieces under usual reserve"), - "60": _("Sale of foreign bank notes"), - "58": _("Payment by your branch/agents"), - "56": _("Reserve"), - "54": _("Your payment ATM"), - "52": _("Payment night safe"), - "50": _("Cash payment"), - "49": _("Cancellation or correction"), - "37": _("Costs"), - "25": _("Purchase of traveller’s cheque"), - "21": _("Cash withdrawal on card (PROTON)"), - "19": _("Difference in payment"), - "17": _("Purchase of fiscal stamps"), - "15": _("Your purchase of lottery tickets"), - "13": _("Cash withdrawal by your branch or agents"), - "11": _("Your purchase of luncheon vouchers"), - "09": _("Purchase of petrol coupons"), - "07": _("Purchase of gold/pieces"), - "05": _("Purchase of foreign bank notes"), - "03": _("Cash withdrawal by card (ATM)"), - "01": _("Cash withdrawal"), + "09": ["Counter transactions", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "70": "Sale of traveller’s cheque", + "68": "Difference in payment", + "66": "Repurchase of petrol coupons", + "64": "Your winning lottery ticket", + "62": "Sale of gold/pieces under usual reserve", + "60": "Sale of foreign bank notes", + "58": "Payment by your branch/agents", + "56": "Reserve", + "54": "Your payment ATM", + "52": "Payment night safe", + "50": "Cash payment", + "49": "Cancellation or correction", + "37": "Costs", + "25": "Purchase of traveller’s cheque", + "21": "Cash withdrawal on card (PROTON)", + "19": "Difference in payment", + "17": "Purchase of fiscal stamps", + "15": "Your purchase of lottery tickets", + "13": "Cash withdrawal by your branch or agents", + "11": "Your purchase of luncheon vouchers", + "09": "Purchase of petrol coupons", + "07": "Purchase of gold/pieces", + "05": "Purchase of foreign bank notes", + "03": "Cash withdrawal by card (ATM)", + "01": "Cash withdrawal", }], - "11": [_("Securities"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "70": _("Settlement of securities"), - "68": _("Compensation for missing coupon"), - "66": _("Retrocession of issue commission"), - "64": _("Your issue"), - "62": _("Interim interest on subscription"), - "58": _("Repayable securities from a deposit or delivered at the counter - credit under usual reserve"), - "56": _("Reserve"), - "52": _("Payment of coupons from a deposit or settlement of coupons delivered over the counter - credit under usual reserve"), - "51": _("Tender"), - "50": _("Sale of securities"), - "49": _("Cancellation or correction"), - "37": _("Costs"), - "19": _("Regularisation costs"), - "17": _("Management fee"), - "15": _("Interim interest on subscription"), - "13": _("Your repurchase of issue"), - "11": _("Payable coupons/repayable securities"), - "09": _("Settlement of securities"), - "06": _("Share option plan – exercising an option"), - "05": _("Partial payment subscription"), - "04": _("Issues"), - "03": _("Subscription to securities"), - "02": _("Tenders"), - "01": _("Purchase of securities"), + "11": ["Securities", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "70": "Settlement of securities", + "68": "Compensation for missing coupon", + "66": "Retrocession of issue commission", + "64": "Your issue", + "62": "Interim interest on subscription", + "58": "Repayable securities from a deposit or delivered at the counter - credit under usual reserve", + "56": "Reserve", + "52": "Payment of coupons from a deposit or settlement of coupons delivered over the counter - credit under usual reserve", + "51": "Tender", + "50": "Sale of securities", + "49": "Cancellation or correction", + "37": "Costs", + "19": "Regularisation costs", + "17": "Management fee", + "15": "Interim interest on subscription", + "13": "Your repurchase of issue", + "11": "Payable coupons/repayable securities", + "09": "Settlement of securities", + "06": "Share option plan – exercising an option", + "05": "Partial payment subscription", + "04": "Issues", + "03": "Subscription to securities", + "02": "Tenders", + "01": "Purchase of securities", }], - "13": [_("Credit"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "70": _("Settlement of discount bank acceptance"), - "68": _("Documentary export credits"), - "62": _("Term loan"), - "60": _("Settlement of mortgage loan"), - "56": _("Subsidy"), - "55": _("Fixed advance – interest only"), - "54": _("Fixed advance – capital and interest"), - "50": _("Settlement of instalment credit"), - "49": _("Cancellation or correction"), - "37": _("Credit-related costs"), - "21": _("Other credit applications"), - "19": _("Documentary import credits"), - "15": _("Your repayment hire-purchase and similar claims"), - "13": _("Settlement of bank acceptances"), - "11": _("Your repayment mortgage loan"), - "07": _("Your repayment instalment credits"), - "05": _("Settlement of fixed advance"), - "02": _("Long-term loan"), - "01": _("Short-term loan"), + "13": ["Credit", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "70": "Settlement of discount bank acceptance", + "68": "Documentary export credits", + "62": "Term loan", + "60": "Settlement of mortgage loan", + "56": "Subsidy", + "55": "Fixed advance – interest only", + "54": "Fixed advance – capital and interest", + "50": "Settlement of instalment credit", + "49": "Cancellation or correction", + "37": "Credit-related costs", + "21": "Other credit applications", + "19": "Documentary import credits", + "15": "Your repayment hire-purchase and similar claims", + "13": "Settlement of bank acceptances", + "11": "Your repayment mortgage loan", + "07": "Your repayment instalment credits", + "05": "Settlement of fixed advance", + "02": "Long-term loan", + "01": "Short-term loan", }], - "30": [_("Various transactions"), { - "99": _("Cancellation or correction"), - "89": _("Undefined transaction"), - "87": _("Reimbursement of costs"), - "83": _("Value (date) correction"), - "55": _("Interest term investment"), - "54": _("Capital and/or interest term investment"), - "52": _("Forward sale of foreign exchange"), - "50": _("Spot sale of foreign exchange"), - "49": _("Cancellation or correction"), - "39": _("Undefined transaction"), - "37": _("Costs"), - "33": _("Value (date) correction"), - "05": _("Capital and/or interest term investment"), - "03": _("Forward purchase of foreign exchange"), - "01": _("Spot purchase of foreign exchange"), + "30": ["Various transactions", { + "99": "Cancellation or correction", + "89": "Undefined transaction", + "87": "Reimbursement of costs", + "83": "Value (date) correction", + "55": "Interest term investment", + "54": "Capital and/or interest term investment", + "52": "Forward sale of foreign exchange", + "50": "Spot sale of foreign exchange", + "49": "Cancellation or correction", + "39": "Undefined transaction", + "37": "Costs", + "33": "Value (date) correction", + "05": "Capital and/or interest term investment", + "03": "Forward purchase of foreign exchange", + "01": "Spot purchase of foreign exchange", }], - "35": [_("Closing (periodical settlements for interest, costs,…)"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "50": _("Closing"), - "49": _("Cancellation or correction"), - "37": _("Costs"), - "01": _("Closing"), + "35": ["Closing (periodical settlements for interest, costs,…)", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "50": "Closing", + "49": "Cancellation or correction", + "37": "Costs", + "01": "Closing", }], - "41": [_("International credit transfers - non-SEPA credit transfers"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "66": _("Financial centralisation (credit)"), - "64": _("Transfer to your account"), - "50": _("Transfer"), - "49": _("Cancellation or correction"), - "38": _("Costs relating to incoming foreign and non-SEPA transfers"), - "37": _("Costs relating to outgoing foreign transfers and non-SEPA transfers"), - "17": _("Financial centralisation (debit)"), - "13": _("Transfer from your account"), - "07": _("Collective transfers"), - "05": _("Collective payments of wages"), - "03": _("Standing order"), - "01": _("Transfer"), + "41": ["International credit transfers - non-SEPA credit transfers", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "66": "Financial centralisation (credit)", + "64": "Transfer to your account", + "50": "Transfer", + "49": "Cancellation or correction", + "38": "Costs relating to incoming foreign and non-SEPA transfers", + "37": "Costs relating to outgoing foreign transfers and non-SEPA transfers", + "17": "Financial centralisation (debit)", + "13": "Transfer from your account", + "07": "Collective transfers", + "05": "Collective payments of wages", + "03": "Standing order", + "01": "Transfer", }], - "43": [_("Foreign cheques"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "70": _("Purchase of traveller’s cheque"), - "62": _("Reversal of cheques"), - "58": _("Remittance of foreign cheque credit after collection"), - "52": _("Remittance of foreign cheque credit under usual reserve"), - "49": _("Cancellation or correction"), - "37": _("Costs relating to payment of foreign cheques"), - "15": _("Purchase of an international bank cheque"), - "07": _("Unpaid foreign cheque"), - "01": _("Payment of a foreign cheque"), + "43": ["Foreign cheques", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "70": "Purchase of traveller’s cheque", + "62": "Reversal of cheques", + "58": "Remittance of foreign cheque credit after collection", + "52": "Remittance of foreign cheque credit under usual reserve", + "49": "Cancellation or correction", + "37": "Costs relating to payment of foreign cheques", + "15": "Purchase of an international bank cheque", + "07": "Unpaid foreign cheque", + "01": "Payment of a foreign cheque", }], - "47": [_("Foreign commercial paper"), { - "99": _("Cancellation or correction"), - "87": _("Reimbursement of costs"), - "64": _("Warrant"), - "62": _("Remittance of documents abroad - credit after collection"), - "60": _("Remittance of documents abroad - credit under usual reserve"), - "58": _("Idem without guarantee"), - "56": _("Remittance of guaranteed foreign supplier's bill"), - "54": _("Discount abroad"), - "52": _("Remittance of foreign bill credit under usual reserve"), - "50": _("Remittance of foreign bill credit after collection"), - "49": _("Cancellation or correction"), - "37": _("Costs relating to the payment of a foreign bill"), - "14": _("Warrant fallen due"), - "13": _("Discount foreign supplier's bills"), - "11": _("Payment documents abroad"), - "07": _("Unpaid foreign bill"), - "06": _("Extension"), - "05": _("Bill claimed back"), - "01": _("Payment of foreign bill"), + "47": ["Foreign commercial paper", { + "99": "Cancellation or correction", + "87": "Reimbursement of costs", + "64": "Warrant", + "62": "Remittance of documents abroad - credit after collection", + "60": "Remittance of documents abroad - credit under usual reserve", + "58": "Idem without guarantee", + "56": "Remittance of guaranteed foreign supplier's bill", + "54": "Discount abroad", + "52": "Remittance of foreign bill credit under usual reserve", + "50": "Remittance of foreign bill credit after collection", + "49": "Cancellation or correction", + "37": "Costs relating to the payment of a foreign bill", + "14": "Warrant fallen due", + "13": "Discount foreign supplier's bills", + "11": "Payment documents abroad", + "07": "Unpaid foreign bill", + "06": "Extension", + "05": "Bill claimed back", + "01": "Payment of foreign bill", }], - "49": [_("Foreign counter transactions"), {"03": _("ATM withdrawal")}], - "80": [_("Separately charged costs and provisions"), { - "01": _("Guarantee card charges"), - "02": _("Costs relating to electronic output"), - "03": _("Payment card charges"), - "04": _("Costs for holding a documentary cash credit"), - "05": _("Card charges"), - "06": _("Damage relating to bills and cheques"), - "07": _("Insurance costs"), - "08": _("Registering compensation for savings accounts"), - "09": _("Postage"), - "10": _("Purchase of Smartcard"), - "11": _("Costs for the safe custody of correspondence"), - "12": _("Costs for opening a bank guarantee"), - "13": _("Renting of safes"), - "14": _("Handling costs instalment credit"), - "15": _("Night safe"), - "16": _("Bank confirmation to revisor or accountant"), - "17": _("Charge for safe custody"), - "18": _("Trade information"), - "19": _("Special charge for safe custody"), - "20": _("Drawing up a certificate"), - "21": _("Pay-packet charges"), - "22": _("Management/custody"), - "23": _("Research costs"), - "24": _("Participation in and management of interest refund system"), - "25": _("Renting of direct debit box"), - "26": _("Travel insurance premium"), - "27": _("Subscription fee"), - "29": _("Information charges"), - "31": _("Writ service fee"), - "33": _("Miscellaneous fees and commissions"), - "35": _("Costs"), - "37": _("Access right to database"), - "39": _("Surety fee"), - "41": _("Research costs"), - "43": _("Printing of forms"), - "45": _("Documentary credit charges"), - "47": _("Charging fees for transactions"), - "49": _("Cancellation or correction"), - "99": _("Cancellation or correction"), + "49": ["Foreign counter transactions", {"03": "ATM withdrawal"}], + "80": ["Separately charged costs and provisions", { + "01": "Guarantee card charges", + "02": "Costs relating to electronic output", + "03": "Payment card charges", + "04": "Costs for holding a documentary cash credit", + "05": "Card charges", + "06": "Damage relating to bills and cheques", + "07": "Insurance costs", + "08": "Registering compensation for savings accounts", + "09": "Postage", + "10": "Purchase of Smartcard", + "11": "Costs for the safe custody of correspondence", + "12": "Costs for opening a bank guarantee", + "13": "Renting of safes", + "14": "Handling costs instalment credit", + "15": "Night safe", + "16": "Bank confirmation to revisor or accountant", + "17": "Charge for safe custody", + "18": "Trade information", + "19": "Special charge for safe custody", + "20": "Drawing up a certificate", + "21": "Pay-packet charges", + "22": "Management/custody", + "23": "Research costs", + "24": "Participation in and management of interest refund system", + "25": "Renting of direct debit box", + "26": "Travel insurance premium", + "27": "Subscription fee", + "29": "Information charges", + "31": "Writ service fee", + "33": "Miscellaneous fees and commissions", + "35": "Costs", + "37": "Access right to database", + "39": "Surety fee", + "41": "Research costs", + "43": "Printing of forms", + "45": "Documentary credit charges", + "47": "Charging fees for transactions", + "49": "Cancellation or correction", + "99": "Cancellation or correction", }], } transaction_categories = { - "000": _("Net amount"), - "001": _("Interest received"), - "002": _("Interest paid"), - "003": _("Credit commission"), - "004": _("Postage"), - "005": _("Renting of letterbox"), - "006": _("Various fees/commissions"), - "007": _("Access right to database"), - "008": _("Information charges"), - "009": _("Travelling expenses"), - "010": _("Writ service fee"), - "011": _("VAT"), - "012": _("Exchange commission"), - "013": _("Payment commission"), - "014": _("Collection commission"), - "015": _("Correspondent charges"), - "016": _("BLIW/IBLC dues"), - "017": _("Research costs"), - "018": _("Tental guarantee charges"), - "019": _("Tax on physical delivery"), - "020": _("Costs of physical delivery"), - "021": _("Costs for drawing up a bank cheque"), - "022": _("Priority costs"), - "023": _("Exercising fee"), - "024": _("Growth premium"), - "025": _("Individual entry for exchange charges"), - "026": _("Handling commission"), - "027": _("Charges for unpaid bills"), - "028": _("Fidelity premium"), - "029": _("Protest charges"), - "030": _("Account insurance"), - "031": _("Charges foreign cheque"), - "032": _("Drawing up a circular cheque"), - "033": _("Charges for a foreign bill"), - "034": _("Reinvestment fee"), - "035": _("Charges foreign documentary bill"), - "036": _("Costs relating to a refused cheque"), - "037": _("Commission for handling charges"), - "039": _("Telecommunications"), - "041": _("Credit card costs"), - "042": _("Payment card costs"), - "043": _("Insurance costs"), - "045": _("Handling costs"), - "047": _("Charges extension bill"), - "049": _("Fiscal stamps/stamp duty"), - "050": _("Capital term investment"), - "051": _("Withholding tax"), - "052": _("Residence state tax"), - "053": _("Printing of forms"), - "055": _("Repayment loan or credit capital"), - "057": _("Interest subsidy"), - "058": _("Capital premium"), - "059": _("Default interest"), - "061": _("Charging fees for transactions"), - "063": _("Rounding differences"), - "065": _("Interest payment advice"), - "066": _("Fixed loan advance - reimbursement"), - "067": _("Fixed loan advance - extension"), - "068": _("Countervalue of an entry"), - "069": _("Forward arbitrage contracts : sum to be supplied by customer"), - "070": _("Forward arbitrage contracts : sum to be supplied by bank"), - "071": _("Fixed loan advance - availability"), - "072": _("Countervalue of commission to third party"), - "073": _("Costs of ATM abroad"), - "074": _("Mailing costs"), - "100": _("Gross amount"), - "200": _("Overall documentary credit charges"), - "201": _("Advice notice commission"), - "202": _("Advising commission | Additional advising commission"), - "203": _("Confirmation fee | Additional confirmation fee | Commitment fee | Flat fee | Confirmation reservation commission | Additional reservation commission"), - "204": _("Amendment fee"), - "205": _("Documentary payment commission | Document commission | Drawdown fee | Negotiation fee"), - "206": _("Surety fee/payment under reserve"), - "207": _("Non-conformity fee"), - "208": _("Commitment fee deferred payment"), - "209": _("Transfer commission"), - "210": _("Commitment fee"), - "211": _("Credit arrangement fee | Additional credit arrangement fee"), - "212": _("Warehousing fee"), - "213": _("Financing fee"), - "214": _("Issue commission (delivery order)"), - "400": _("Acceptance fee"), - "401": _("Visa charges"), - "402": _("Certification costs"), - "403": _("Minimum discount rate"), - "404": _("Discount commission"), - "405": _("Bill guarantee commission"), - "406": _("Collection charges"), - "407": _("Costs Article 45"), - "408": _("Cover commission"), - "409": _("Safe deposit charges"), - "410": _("Reclamation charges"), - "411": _("Fixed collection charge"), - "412": _("Advice of expiry charges"), - "413": _("Acceptance charges"), - "414": _("Regularisation charges"), - "415": _("Surety fee"), - "416": _("Charges for the deposit of security"), - "418": _("Endorsement commission"), - "419": _("Bank service fee"), - "420": _("Retention charges"), - "425": _("Foreign broker's commission"), - "426": _("Belgian broker's commission"), - "427": _("Belgian Stock Exchange tax"), - "428": _("Interest accrued"), - "429": _("Foreign Stock Exchange tax"), - "430": _("Recovery of foreign tax"), - "431": _("Delivery of a copy"), + "000": "Net amount", + "001": "Interest received", + "002": "Interest paid", + "003": "Credit commission", + "004": "Postage", + "005": "Renting of letterbox", + "006": "Various fees/commissions", + "007": "Access right to database", + "008": "Information charges", + "009": "Travelling expenses", + "010": "Writ service fee", + "011": "VAT", + "012": "Exchange commission", + "013": "Payment commission", + "014": "Collection commission", + "015": "Correspondent charges", + "016": "BLIW/IBLC dues", + "017": "Research costs", + "018": "Tental guarantee charges", + "019": "Tax on physical delivery", + "020": "Costs of physical delivery", + "021": "Costs for drawing up a bank cheque", + "022": "Priority costs", + "023": "Exercising fee", + "024": "Growth premium", + "025": "Individual entry for exchange charges", + "026": "Handling commission", + "027": "Charges for unpaid bills", + "028": "Fidelity premium", + "029": "Protest charges", + "030": "Account insurance", + "031": "Charges foreign cheque", + "032": "Drawing up a circular cheque", + "033": "Charges for a foreign bill", + "034": "Reinvestment fee", + "035": "Charges foreign documentary bill", + "036": "Costs relating to a refused cheque", + "037": "Commission for handling charges", + "039": "Telecommunications", + "041": "Credit card costs", + "042": "Payment card costs", + "043": "Insurance costs", + "045": "Handling costs", + "047": "Charges extension bill", + "049": "Fiscal stamps/stamp duty", + "050": "Capital term investment", + "051": "Withholding tax", + "052": "Residence state tax", + "053": "Printing of forms", + "055": "Repayment loan or credit capital", + "057": "Interest subsidy", + "058": "Capital premium", + "059": "Default interest", + "061": "Charging fees for transactions", + "063": "Rounding differences", + "065": "Interest payment advice", + "066": "Fixed loan advance - reimbursement", + "067": "Fixed loan advance - extension", + "068": "Countervalue of an entry", + "069": "Forward arbitrage contracts : sum to be supplied by customer", + "070": "Forward arbitrage contracts : sum to be supplied by bank", + "071": "Fixed loan advance - availability", + "072": "Countervalue of commission to third party", + "073": "Costs of ATM abroad", + "074": "Mailing costs", + "100": "Gross amount", + "200": "Overall documentary credit charges", + "201": "Advice notice commission", + "202": "Advising commission | Additional advising commission", + "203": "Confirmation fee | Additional confirmation fee | Commitment fee | Flat fee | Confirmation reservation commission | Additional reservation commission", + "204": "Amendment fee", + "205": "Documentary payment commission | Document commission | Drawdown fee | Negotiation fee", + "206": "Surety fee/payment under reserve", + "207": "Non-conformity fee", + "208": "Commitment fee deferred payment", + "209": "Transfer commission", + "210": "Commitment fee", + "211": "Credit arrangement fee | Additional credit arrangement fee", + "212": "Warehousing fee", + "213": "Financing fee", + "214": "Issue commission (delivery order)", + "400": "Acceptance fee", + "401": "Visa charges", + "402": "Certification costs", + "403": "Minimum discount rate", + "404": "Discount commission", + "405": "Bill guarantee commission", + "406": "Collection charges", + "407": "Costs Article 45", + "408": "Cover commission", + "409": "Safe deposit charges", + "410": "Reclamation charges", + "411": "Fixed collection charge", + "412": "Advice of expiry charges", + "413": "Acceptance charges", + "414": "Regularisation charges", + "415": "Surety fee", + "416": "Charges for the deposit of security", + "418": "Endorsement commission", + "419": "Bank service fee", + "420": "Retention charges", + "425": "Foreign broker's commission", + "426": "Belgian broker's commission", + "427": "Belgian Stock Exchange tax", + "428": "Interest accrued", + "429": "Foreign Stock Exchange tax", + "430": "Recovery of foreign tax", + "431": "Delivery of a copy", }