Public Member Functions | |
__construct ($id=NULL) | |
Contruct of app, shutdown action logs by default. | |
get_all_transfers ($limit_from=0, $limit_results=20, $order_by= 'id', $order_by_direction= 'desc', $filter_sql= '', $filter_name_sql= '') | |
Function gets all double-entry transfer. | |
count_all_transfers ($filter_sql= '', $filter_name_sql= '') | |
Function counts all transfers. | |
get_transfers ($account_id=null, $limit_from=0, $limit_results=20, $order_by= 't.id', $order_by_direction= 'ASC', $filter_sql= '', $filter_array=NULL) | |
Function gets all money transfers of double-entry account. | |
count_transfers ($account_id=null, $filter_sql= '', $filter_array=NULL) | |
Function gets all money transfers of double-entry account. | |
get_transfer ($trans_id=null) | |
Function gets information of specified transfer. | |
get_dependent_transfers ($transfer_id) | |
Function gets dependent transfers of transfer that is member fee payment. | |
get_entrance_fee_transfers_of_account ($account_id) | |
Gets "entrance fee" transfers of given account. | |
get_last_entrance_fee_transfer_datetime_of_account ($account_id) | |
Returns datetime of last entrance fee transfer of account. | |
count_entrance_fee_transfers_of_account ($account_id) | |
Count total amount of entrance fee transfers of account. | |
get_device_fee_transfers_of_account_and_date ($ca, $date) | |
Used for deduction of device repayments. | |
sum_device_fee_transfers_of_account ($account_id) | |
Sums transfers of device fees of account. | |
get_all_monthly_amounts_of_incoming_member_payment () | |
Gets all monthly amounts of incoming member payment for stats. | |
get_grouped_monthly_member_fees () | |
Gets amount of all member fees grouped by month for stats. | |
find_last_transfer_datetime_by_type ($type) | |
Gets datime of last transfer by type. | |
get_last_transfer_datetime_of_account ($account_id) | |
Get datetime of last transfer of account. |
Static Public Member Functions | |
static | insert_transfer ($origin_id, $destination_id, $previous_transfer_id, $member_id, $user_id, $type, $datetime, $creation_datetime, $text, $amount) |
Creates transfer. | |
static | edit_transfer ($id, $text, $amount) |
Edits transfers safely with change of dependent account balance. | |
static | delete_transfer ($id=null) |
Safely deletes transfer. | |
static | insert_transfer_for_work_approve ($member_id, $amount) |
Public Attributes | |
const | DEDUCT_MEMBER_FEE = 1 |
Special type of transfer: deduct member fee. | |
const | DEDUCT_ENTRANCE_FEE = 2 |
Special type of transfer: deduct entrance fee. | |
const | DEDUCT_VOIP_UNNACCOUNTED_FEE = 3 |
Special type of transfer: deduct voip_unnaccounted fee. | |
const | DEDUCT_VOIP_ACCOUNTED_FEE = 4 |
Special type of transfer: deduct voip_accounted fee. | |
const | DEDUCT_DEVICE_FEE = 5 |
Special type of transfer: deduct device fee. | |
const | OUTER_TRANSFERS = 1 |
Group of transfers: outer. | |
const | INNER_TRANSFERS = 2 |
Group of transfers: inner. | |
const | INBOUND_AND_OUTBOUND = 1 |
Inbound ans outbound type of transfers. | |
const | INBOUND = 2 |
Inbound type of transfers. | |
const | OUTBOUND = 3 |
Unbound type of transfers. |
Protected Attributes | |
$belongs_to | |
$has_many = array('job_reports') |
Transfer_Model::__construct | ( | $id = NULL | ) |
Contruct of app, shutdown action logs by default.
type | $id |
Transfer_Model::count_all_transfers | ( | $filter_sql = '' , |
|
$filter_name_sql = '' |
|||
) |
Function counts all transfers.
Used in day book.
Transfer_Model::count_entrance_fee_transfers_of_account | ( | $account_id | ) |
Count total amount of entrance fee transfers of account.
type | $account_id |
Transfer_Model::count_transfers | ( | $account_id = null , |
|
$filter_sql = '' , |
|||
$filter_array = NULL |
|||
) |
Function gets all money transfers of double-entry account.
$account_id | |
$limit_from | |
$limit_results | |
$order_by | |
$order_by_direction |
|
static |
Safely deletes transfer.
integer | $id |
Kohana_Databse_Exception |
|
static |
Edits transfers safely with change of dependent account balance.
integer | $id | |
string | $text | |
double | $amount |
Kohana_Databse_Exception |
Transfer_Model::find_last_transfer_datetime_by_type | ( | $type | ) |
Gets datime of last transfer by type.
integer | $type |
Transfer_Model::get_all_monthly_amounts_of_incoming_member_payment | ( | ) |
Gets all monthly amounts of incoming member payment for stats.
Transfer_Model::get_all_transfers | ( | $limit_from = 0 , |
|
$limit_results = 20 , |
|||
$order_by = 'id' , |
|||
$order_by_direction = 'desc' , |
|||
$filter_sql = '' , |
|||
$filter_name_sql = '' |
|||
) |
Function gets all double-entry transfer.
They are shown in day book.
integer | $limit_from | |
integer | $limit_results | |
string | $order_by | |
string | $order_by_direction | |
array | $filter_values |
Transfer_Model::get_dependent_transfers | ( | $transfer_id | ) |
Function gets dependent transfers of transfer that is member fee payment.
$transfer_id |
Transfer_Model::get_device_fee_transfers_of_account_and_date | ( | $ca, | |
$date | |||
) |
Used for deduction of device repayments.
object | $ca | |
string | $date |
Transfer_Model::get_entrance_fee_transfers_of_account | ( | $account_id | ) |
Gets "entrance fee" transfers of given account.
integer | $account_id |
Transfer_Model::get_grouped_monthly_member_fees | ( | ) |
Gets amount of all member fees grouped by month for stats.
Transfer_Model::get_last_entrance_fee_transfer_datetime_of_account | ( | $account_id | ) |
Returns datetime of last entrance fee transfer of account.
type | $account_id |
Transfer_Model::get_last_transfer_datetime_of_account | ( | $account_id | ) |
Get datetime of last transfer of account.
type | $account_id |
Transfer_Model::get_transfer | ( | $trans_id = null | ) |
Function gets information of specified transfer.
integer | $trans_id |
Transfer_Model::get_transfers | ( | $account_id = null , |
|
$limit_from = 0 , |
|||
$limit_results = 20 , |
|||
$order_by = 't.id' , |
|||
$order_by_direction = 'ASC' , |
|||
$filter_sql = '' , |
|||
$filter_array = NULL |
|||
) |
Function gets all money transfers of double-entry account.
$account_id | |
$limit_from | |
$limit_results | |
$order_by | |
$order_by_direction |
|
static |
Creates transfer.
integer | $origin_id | origin account id |
integer | $destination_id | destination account id |
integer | $previous_transfer_id | previous transfer id, useful for transfer groups |
integer | $member_id | transaction owner id |
integer | $user_id | id of user who added transfer |
integer | $type | type of transfer, see Transfer_Model |
string | $datetime | accounting datetime of transfer |
string | $creation_datetime | datetime of transfer creation |
string | $text | transfer text |
double | $amount | amount of transfer |
Kohana_Databse_Exception | when failed transfer insert, origin or destination account update |
Transfer_Model::sum_device_fee_transfers_of_account | ( | $account_id | ) |
Sums transfers of device fees of account.
type | $account_id |
|
protected |