accounts
index
/mnt/disk2/workspace/fruitybanking/accounts.py

 
Modules
       
db
html
locale
transactions

 
Classes
       
Account
Accounts

 
class Account
    Account DTO
 
  Data and other attributes defined here:
balance = 0
code = ''
description = ''
id = 0
reconciledtotal = 0
type = 0

 
class Accounts
    The UI class
 
  Methods defined here:
add(self)
Page to allow adding of a new account
delete(self, id)
Mark an account as deleted and return to the account list
edit(self, id)
Page to allow editing of an existing account.
index(self)
Index page of root.accounts - produces a list of all
accounts with their codes, descriptions and balances
with links to edit each account and view its transactions.
new(self, code, description, type)
Page to create a new account
reconcile(self, id)
Mark all transactions on an account as reconciled upto today's date.
update(self, id, code, type, description)
Page to update an account and then return to
the index page and the accounts list.

 
Functions
       
createAccount(accountObj)
Creates a new account record and returns
the id value of the newly created account.
deleteAccount(id)
Marks the given account as deleted
getAccountBalance(id)
Returns the balance for the given account id and
based on the account type.
getAccountBalanceToDate(id, todate)
Returns the balance for a given account upto (but not including) a certain date
(todate is expected in UNIX form)
getAccountByCode(code)
Returns an account object for the given account code
getAccountById(id)
Returns an account object for the given account id
getAccountTypeForID(type)
Returns the account type text for a given id
getAccountTypesAsHTML(selected=-1)
Returns HTML options representing the available account
types. Optionally, you can pass the id of the selected item
getAccountsAsHTML(selected=-1)
Returns HTML options representing the available
accounts. Optionally, you can pass the id of the
selected account.
getAllAccounts()
Returns a list of populated account objects from the
database (and updates their balances at the same time).
getReconciled(id)
Returns the reconciled balance for the given account id and
based on the account type.
number_format(num, places=2)
totalBalanceForPeriod(dateto, accounttype)
Returns a list of lists up to a given date and account
type containing account codes and balances
totalForPeriod(datefrom, dateto, accounttype, deposits=False)
Returns a list of lists for a given period and account type.
[ [ accountcode, value ],  [ accountcode, value ] ]
If deposits is True, only includes transactions
with the account appearing in the DestinationAccountID
updateAccount(accountObj)
Updates an existing account.

 
Data
        accounttypes = ((0, 'Bank'), (1, 'Credit Card'), (2, 'Loan'), (3, 'Expense'), (4, 'Income'), (5, 'Pension'), (6, 'Shares'), (10, 'Asset'), (11, 'Liability'))