Пример #1
0
 def map_account_keys(self, ac):
     ret = {}
     ret['ac_no'] = ac[u'Account Number']
     ret['bank'] = self.__bank__
     ret['id'] = genid(ret)
     ret['balance'] = float(ac[u'Available Balance'])
     return ret
Пример #2
0
	def map_account_keys(self,ac):
		ret = {}
		ret['ac_no']=ac[u'Account Number']
		ret['bank'] = self.__bank__
		ret['id'] = genid(ret)
		ret['balance']=float(ac[u'Available Balance'])
		return ret
Пример #3
0
 def map_transaction_keys(self, txn, ac_id):
     ret = {}
     ret['ac_id'] = ac_id
     ret['ref_no'] = txn[u'Cheque/Ref No']
     ret['narration'] = txn[u'Narration']
     ret['bal'] = txn[u'Balance']
     ret['date'] = dateutil.parser.parse(txn[u'Transaction Date']).date()
     if u'Withdrawal' in txn.keys():
         ret['t_type'] = 'd'
         ret['amount'] = float(txn[u'Withdrawal'])
     else:
         ret['t_type'] = 'c'
         ret['amount'] = float(txn[u'Deposit'])
     ret['id'] = genid(ret)
     return ret
Пример #4
0
	def map_transaction_keys(self,txn,ac_id):
		ret = {}
		ret['ac_id'] = ac_id
		ret['ref_no'] = txn[u'Cheque/Ref No']
		ret['narration']=txn[u'Narration']
		ret['bal']=txn[u'Balance']
		ret['date']=dateutil.parser.parse(txn[u'Transaction Date']).date()
		if u'Withdrawal' in txn.keys():
			ret['t_type']='d'
			ret['amount']=float(txn[u'Withdrawal'])
		else:
			ret['t_type']='c'
			ret['amount']=float(txn[u'Deposit'])
		ret['id'] = genid(ret)
		return ret
Пример #5
0
 def get_account_statement(self, ac_no, st_type, from_date, to_date):
     self.state = "out"
     self.br.select_form('frm_menu_accounts_SIN')
     self.br.submit()
     self.br.select_form('frmTxn')
     self.br.form.set_all_readonly(False)
     self.br.form['fldAcctNo'] = ac_no + '++'
     self.br.form['fldNbrStmt'] = '20'
     self.br.form['fldTxnType'] = 'A'
     self.br.form['radTxnType'] = ['C']
     if st_type != 'mini':
         self.br.form['fldFromDate'] = from_date.strftime("%d%%2F%m%%2F%Y")
         self.br.form['fldToDate'] = to_date.strftime("%d%%2F%m%%2F%Y")
     self.br.submit()
     html = self.br.response().read()
     self.ret_to_menu()
     txns = self.parse_account_statement(html)
     ac_id = genid({'acno': ac_no, 'bank': self.__bank__})
     txns = [self.map_transaction_keys(x, ac_id) for x in txns]
     txns = [self.process_txn(x) for x in txns]
     return txns
Пример #6
0
	def get_account_statement(self,ac_no,st_type,from_date, to_date):
		self.state = "out"
		self.br.select_form('frm_menu_accounts_SIN')
		self.br.submit()
		self.br.select_form('frmTxn')
		self.br.form.set_all_readonly(False)
		self.br.form['fldAcctNo']=ac_no+'++'
		self.br.form['fldNbrStmt']='20'
		self.br.form['fldTxnType'] = 'A'
		self.br.form['radTxnType'] = ['C']
		if st_type!='mini':
			self.br.form['fldFromDate']=from_date.strftime("%d%%2F%m%%2F%Y")
			self.br.form['fldToDate']=to_date.strftime("%d%%2F%m%%2F%Y")
		self.br.submit()
		html = self.br.response().read();
		self.ret_to_menu()
		txns = self.parse_account_statement(html)
		ac_id = genid({'acno': ac_no, 'bank' : self.__bank__ })
		txns = [self.map_transaction_keys(x,ac_id) for x in txns]
		txns = [self.process_txn(x) for x in txns]
		return txns