FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
Transfers_Controller Class Reference
Inheritance diagram for Transfers_Controller:
Controller

Public Member Functions

 __construct ()
 Constructor, only test if finance is enabled.
 index ()
 By default, it redirects user to day book - list of all double-entry transfers.
 show_all ($limit_results=50, $order_by= 'datetime', $order_by_direction= 'desc', $page_word=null, $page=1)
 It shows all double-entry transfers.
 show_by_account ($account_id=NULL, $limit_results=500, $order_by= 'datetime', $order_by_direction= 'desc', $page_word=null, $page=1)
 It shows transfers of credit account.
 show ($transfer_id=null)
 Function shows information of transfer including previous transfer if exists.
 add_from_account ($origin_account_id=null)
 Adds transfers from single origin account.
 add ()
 Function adds transfers from one arbitrary account to another arbitrary account.
 add_voip ($origin_account=NULL)
 Function adds VoIP transfers.
 edit ($transfer_id=NULL)
 Function edits double-entry transfers.
 deduct_member_fees ()
 Deducts fees of all members in one month.
 deduct_entrance_fees ()
 Function deducts entrance fees.
 deduct_device_fees ()
 Deducts repayments of devices.
 add_member_fee_payment_by_cash ($member_id=NULL, $amount=NULL)
 Function adds member fee payment by cash.
 payment_calculator ($account_id=NULL, $text=FALSE)
 Perform payment calculator.
 valid_calculator_item ($input=NULL)
 Callback function to validate form inputs from payment calulator.
 valid_amount_to_send ($input=NULL)
 Function validates amount of money to send from double-entry account.
 valid_amount ($input=NULL)
 Function validates amount of money in editing.
 valid_fee ($input=NULL)
 Function validates amount of money in editing.
 valid_months ($input=NULL)
 Function validates number of months in function deduct_fees.
 valid_default_fee ($input=NULL)
 Callback function to validate default fee.
- Public Member Functions inherited from Controller
 is_user_in_group ($aro_group_id, $aro_id)
 Checks if user is in ARO group.
 acl_check_view ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may view all $axo_value object in $axo_section else return false.
 acl_check_edit ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may edit all $axo_value object in $axo_section else return false.
 acl_check_new ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may add all $axo_value object in $axo_section else return false.
 acl_check_delete ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may delete all $axo_value object in $axo_section else return false.
 build_menu ()
 Build menu.
 url ()
 Return URL for controller and method.
 redirect ($uri=NULL, $id=NULL, $glue= '/')
 Redirects to uri according to attribute noredirect.

Static Public Member Functions

static worker_deduct_members_fees ($month, $year, $user_id)
 Deduct member fees in given year and month if not deducted already.
static worker_deduct_entrance_fees ($month, $year, $user_id)
 Deduct entrance fees.
static worker_deduct_devices_fees ($month, $year, $user_id)
 Deduct device fees.
- Static Public Member Functions inherited from Controller
static & instance ()
 Singleton instance of Controller.
static error ($message_type, $content=NULL)
 Function shows error of given message number.
static warning ($message_type, $content=NULL)
 Function shows warning of given message number.

Additional Inherited Members

- Public Attributes inherited from Controller
const ICON_ERROR = 1
const ICON_GOOD = 2
const ICON_HELP = 3
const ICON_INFO = 4
const ICON_WARNING = 5
 $arr
 $settings = NULL
 $popup = 0
 $dialog = 0
 $noredirect = FALSE
 $user_has_voip = 0
 $ip_address_span = ''
 $unread_user_mails = 0
 $count_of_unclosed_logged_errors = 0
 $devices_down_count = 0
 $user_favourites_pages = NULL
 $axo_doc_access = FALSE
- Protected Member Functions inherited from Controller
 is_preprocesor_enabled ()
 This methods defines whether the preprocessor of MY_Controller is loaded or not.
- Protected Attributes inherited from Controller
 $member_id
 $user_id
 $member_account_id = 1
 $session

Member Function Documentation

Transfers_Controller::add ( )

Function adds transfers from one arbitrary account to another arbitrary account.

Todo:
set of accounts choosen by account_attribute_id, must be done by ajax
Author
Jiri Svitak, Tomas Dulik
Parameters
integer$origin_account
Transfers_Controller::add_from_account (   $origin_account_id = null)

Adds transfers from single origin account.

Todo:
set of accounts choosen by account_attribute_id, must be done by ajax
Author
Jiri Svitak
Parameters
integer$origin_account_id
Transfers_Controller::add_member_fee_payment_by_cash (   $member_id = NULL,
  $amount = NULL 
)

Function adds member fee payment by cash.

Author
Jiri Svitak
Parameters
integer$member_id
Transfers_Controller::add_voip (   $origin_account = NULL)

Function adds VoIP transfers.

Author
Roman Sevcik
Parameters
integer$origin_account
Transfers_Controller::deduct_device_fees ( )

Deducts repayments of devices.

Special devices, like wifi clients can be sold by association. This mechanism enables repayments of these devices in case that member has not enough money to buy it immediately.

Todo:
dodelat
Author
Jiri Svitak
Transfers_Controller::deduct_entrance_fees ( )

Function deducts entrance fees.

This fee is deducted only one once to each member. It checks each member if his fee was deducted, and if it is not, then the fee is deducted.

Author
Michal Kliment
Transfers_Controller::deduct_member_fees ( )

Deducts fees of all members in one month.

If deduct transfer for one month and account is found, then it is ignored and skipped.

Author
Jiri Svitak
Returns
unknown_type
Transfers_Controller::edit (   $transfer_id = NULL)

Function edits double-entry transfers.

They should not be edited. Wrong transfer should be solved by new transfer.

Author
Jiri Svitak
Parameters
integer$transfer_id
Transfers_Controller::index ( )

By default, it redirects user to day book - list of all double-entry transfers.

Author
Jiri Svitak
Returns
unknown_type
Transfers_Controller::payment_calculator (   $account_id = NULL,
  $text = FALSE 
)

Perform payment calculator.

Author
Michal Kliment
Parameters
type$account_id
type$text
Transfers_Controller::show (   $transfer_id = null)

Function shows information of transfer including previous transfer if exists.

Author
Jiri Svitak
Parameters
integer$transfer_id
Transfers_Controller::show_all (   $limit_results = 50,
  $order_by = 'datetime',
  $order_by_direction = 'desc',
  $page_word = null,
  $page = 1 
)

It shows all double-entry transfers.

They are shown in day book.

Author
Jiri Svitak
Parameters
integer$limit_results
string$order_by
string$order_by_direction
Transfers_Controller::show_by_account (   $account_id = NULL,
  $limit_results = 500,
  $order_by = 'datetime',
  $order_by_direction = 'desc',
  $page_word = null,
  $page = 1 
)

It shows transfers of credit account.

Author
Jiri Svitak
Parameters
integer$account_id
Returns
unknown_type
Parameters
integer$limit_results
string$order_by
string$order_by_direction
Transfers_Controller::valid_amount (   $input = NULL)

Function validates amount of money in editing.

Parameters
object$input
Transfers_Controller::valid_amount_to_send (   $input = NULL)

Function validates amount of money to send from double-entry account.

Parameters
object$input
Transfers_Controller::valid_calculator_item (   $input = NULL)

Callback function to validate form inputs from payment calulator.

Author
Michal Kliment
Parameters
type$input
Transfers_Controller::valid_default_fee (   $input = NULL)

Callback function to validate default fee.

Author
Michal Kliment
Parameters
object$input
Transfers_Controller::valid_fee (   $input = NULL)

Function validates amount of money in editing.

Parameters
object$input
Transfers_Controller::valid_months (   $input = NULL)

Function validates number of months in function deduct_fees.

Parameters
object$input
static Transfers_Controller::worker_deduct_devices_fees (   $month,
  $year,
  $user_id 
)
static

Deduct device fees.

Author
Michal Kliment
Parameters
integer$user_idWho is deducting
Returns
integer Created transfers count
Exceptions
ExceptionOn any error
static Transfers_Controller::worker_deduct_entrance_fees (   $month,
  $year,
  $user_id 
)
static

Deduct entrance fees.

Author
Jiri Svitak, Ondrej Fibich
Parameters
integer$user_idWho is deducting
integer$dateDate of deduction [optional - default NOW]
Returns
integer Created transfers count
Exceptions
ExceptionOn any error
static Transfers_Controller::worker_deduct_members_fees (   $month,
  $year,
  $user_id 
)
static

Deduct member fees in given year and month if not deducted already.

Author
Jiri Svitak, Ondrej Fibich
Parameters
integer$monthMonth of deduction
integer$yearYear of deduction
integer$user_idWho is deducting
Returns
integer Created transfers count
Exceptions
ExceptionOn any error

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