FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
Account_Model Class Reference
Inheritance diagram for Account_Model:
ORM

Public Member Functions

 __construct ($id=NULL)
 Contruct of app, shutdown action logs by default.
 get_accounts ($limit_from=0, $limit_results=20, $order_by= 'id', $order_by_direction= 'asc', $filter_sql= '', $date_sql= '', $group=4)
 It gets double-entry accounts of given group.
 get_accounts_count ($filter_sql= '', $group=4)
 It gets count of double-entry accounts of given group.
 get_some_doubleentry_account_names ($origin=null, $account_attribute_id=null)
 Function gets some double-entry accounts.
 select_some_list ($origin=NULL, $account_attribute_id=NULL)
 Select some double entry accounts for select.
 get_account_balance ($account_id)
 It gets balance of account.
 get_accounts_to_deduct ($date)
 Returns all accounts to deduct fee in date.
 get_accounts_to_deduct_entrance_fees ($deduct_date)
 Function gets all members to deduct entrance fees.
 get_amount_of_entrance_fees ($account_id)
 Gets amount of deducted entrance fees of member's credit account.
 get_account_to_recalculate_entrance_fees ($account_id)
 Gets information about one credit account, used for recounting entrance fee with or without instalment.
 delete_deduct_transfers_of_account ($account_id)
 Function deletes member fee deducting transfers of given account.
 delete_entrance_deduct_transfers_of_account ($account_id)
 Function deletes entrance fee deducting transfers of given account.
 delete_device_deduct_transfers_of_account ($account_id)
 Function deletes device fee deducting transfers of given account.
 get_accounts_to_deduct_device_fees ($deduct_date)
 Finds accounts of members who have at least one device to repay.
 get_amount_of_device_fees ($account_id)
 Gets actually repaied amount of prices of all member's devices.
 get_devices_of_account ($account_id)
 Gets list of devices with repayments.
 recalculate_account_balances ()
 Recalculates all account balances.
 recalculate_account_balance_of_account ($account_id)
 Recalculates account balance of single account.
 get_comments ()
 Get comment of this object.
 get_account_by_account_attribute_and_member ($account_attribute_id, $member_id)
 Returns account by given attribute and member.
 get_account_by_attribute ($account_attribute_id)
 Gets account by account attribute ID.
 select_list_without_types ($account_attribute_id)
 Select list of accounts without accounts whose attribute IDs are in passed argument.

Static Public Member Functions

static create ($attribute_id, $name, $member_id)
 This function creates new record in the table "accounts".

Public Attributes

const ACCOUNTING_SYSTEM = 1
 Accounting system.
const CREDIT = 2
 Credit subaccounts grop.
const PROJECT = 3
 Project subaccounts group.
const OTHER = 4
 Other accounts group.

Protected Attributes

 $has_many = array('transfers','variable_symbols')
 $belongs_to = array('member', 'account_attribute', 'comments_thread')
 $has_and_belongs_to_many = array('bank_accounts')

Constructor & Destructor Documentation

Account_Model::__construct (   $id = NULL)

Contruct of app, shutdown action logs by default.

Parameters
type$id

Member Function Documentation

static Account_Model::create (   $attribute_id,
  $name,
  $member_id 
)
static

This function creates new record in the table "accounts".

Author
Tomas Dulik
Parameters
ineteger$attribute_id
string$name
integer$member_id
Returns
Account_Model new object containing the new record model
Account_Model::delete_deduct_transfers_of_account (   $account_id)

Function deletes member fee deducting transfers of given account.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
integer Count of deleted transfers
Exceptions
ExceptionOn error
Account_Model::delete_device_deduct_transfers_of_account (   $account_id)

Function deletes device fee deducting transfers of given account.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
integer Count of deleted transfers
Exceptions
ExceptionOn error
Account_Model::delete_entrance_deduct_transfers_of_account (   $account_id)

Function deletes entrance fee deducting transfers of given account.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
integer Count of deleted transfers
Exceptions
ExceptionOn error
Account_Model::get_account_balance (   $account_id)

It gets balance of account.

It subtracts all outbound transfers from all incoming transfers.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
float
Account_Model::get_account_by_account_attribute_and_member (   $account_attribute_id,
  $member_id 
)

Returns account by given attribute and member.

Author
Michal Kliment
Parameters
integer$account_attribute_id
integer$member_id
Returns
Account_Model
Account_Model::get_account_by_attribute (   $account_attribute_id)

Gets account by account attribute ID.

Creates new instance.

Parameters
integer$account_attribute_id
Returns
Account_Model
Account_Model::get_account_to_recalculate_entrance_fees (   $account_id)

Gets information about one credit account, used for recounting entrance fee with or without instalment.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
Mysql_Result
Account_Model::get_accounts (   $limit_from = 0,
  $limit_results = 20,
  $order_by = 'id',
  $order_by_direction = 'asc',
  $filter_sql = '',
  $date_sql = '',
  $group = 4 
)

It gets double-entry accounts of given group.

Groups are all credit, all project and other accounts of association.

Author
Jiri Svitak
Returns
Mysql_Result
Account_Model::get_accounts_count (   $filter_sql = '',
  $group = 4 
)

It gets count of double-entry accounts of given group.

Author
Jiri Svitak
Returns
Mysql_Result
Account_Model::get_accounts_to_deduct (   $date)

Returns all accounts to deduct fee in date.

Author
Michal Kliment
Parameters
string$date
Returns
Mysql_Result object
Account_Model::get_accounts_to_deduct_device_fees (   $deduct_date)

Finds accounts of members who have at least one device to repay.

Author
Jiri Svitak
Returns
Mysql_Result
Account_Model::get_accounts_to_deduct_entrance_fees (   $deduct_date)

Function gets all members to deduct entrance fees.

Author
Jiri Svitak
Returns
Mysql_Result
Account_Model::get_amount_of_device_fees (   $account_id)

Gets actually repaied amount of prices of all member's devices.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
integer
Account_Model::get_amount_of_entrance_fees (   $account_id)

Gets amount of deducted entrance fees of member's credit account.

Used for deducting entrance fees with instalment.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
integer
Account_Model::get_comments ( )

Get comment of this object.

Returns
string
Account_Model::get_devices_of_account (   $account_id)

Gets list of devices with repayments.

Devices are ordered ascending by their buy date.

Author
Jiri Svitak
Parameters
unknown_type$account_id
Returns
Mysql_Result
Account_Model::get_some_doubleentry_account_names (   $origin = null,
  $account_attribute_id = null 
)

Function gets some double-entry accounts.

Used in dropdown to select destination account.

Parameters
integer$origin
integer$account_attribute_id
Returns
Mysql_Result
Account_Model::recalculate_account_balance_of_account (   $account_id)

Recalculates account balance of single account.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
boolean
Account_Model::recalculate_account_balances ( )

Recalculates all account balances.

Author
Jiri Svitak
Returns
array[integer]
Account_Model::select_list_without_types (   $account_attribute_id)

Select list of accounts without accounts whose attribute IDs are in passed argument.

Parameters
int | array$account_attribute_id
Account_Model::select_some_list (   $origin = NULL,
  $account_attribute_id = NULL 
)

Select some double entry accounts for select.

If origin is supplied than account with origin ID is not in list. If account attribute ID is supplied than only account with given attribute ID are listed.

Author
Ondřej Fibich fibic.nosp@m.h@fr.nosp@m.eenet.nosp@m.is.o.nosp@m.rg
Parameters
integer$originoptional origin account ID to be ignored
type$account_attribute_idoptional account attribute ID for filter
Returns
array associative array with account ID as key and text reprezentation of account as value (name, ID, attribute ID, owner member ID)

The documentation for this class was generated from the following file: