Procedural File: functions.php
Source Location: /include/functions.php
Page Details:
API functions
App. Programming Interface functions To use these function make sure you: - require_once SACC_PATH."/include/functions.php";
After calling most functions, if you receive a FALSE return value you can get the error number and string using SACCGetErrNo() and SACCGetErrMsg()
Tags:
Includes:
require_once(CDM_PATH."/include/functions.php") [line 56]
CDM API functions
SACCCreateAccount [line 178]
mixed SACCCreateAccount(
int $org_id, string $ac_nm, string $ac_tp, int $ac_prnt_id, string $ac_prps, string $ac_note, [string $currency = null])
|
|
Function: Create an account for an organisation
Tags:
Parameters
int |
$org_id |
Id of organisation |
string |
$ac_nm |
Name of account |
string |
$ac_tp |
Type of account one of SACC_ACTP_INCOME, SACC_ACTP_EXPENSE, SACC_ACTP_ASSET, SACC_ACTP_LIABILITY, SACC_ACTP_BANK, SACC_ACTP_SUPPLIER, SACC_ACTP_CUSTOMER, SACC_ACTP_EQUITY |
int |
$ac_prnt_id |
Account id of the parent to this account |
string |
$ac_prps |
Purpose of account |
string |
$ac_note |
Note on account |
string |
$currency |
Default Null. If null or not given then default SACC currency. If value is given then it should be from the set of CDM CURRENCY codes. |
SACCCreateOrg [line 124]
mixed SACCCreateOrg(
string $orgname, [string $currency = null])
|
|
Function: Create an organisation If $currency is null or not given then default SACC currency will be used
Tags:
Parameters
string |
$orgname |
Name of the organisation |
string |
$currency |
Currency code (see CDM currency codes) |
SACCFormatMoney [line 111]
string SACCFormatMoney(
numeric $amount)
|
|
Function: Return formatted string for display of money amount Uses number_format() as money_format doesn't work on MSWin based servers.
Parameters
SACCGetAccount [line 210]
mixed SACCGetAccount(
int $ac_id)
|
|
Function: Return account object associated with the account id
Tags:
Parameters
SACCGetControlAccount [line 229]
mixed SACCGetControlAccount(
int $org_id, string $ctrl_name)
|
|
Function: Returns the account associated with the specified control account
Tags:
Parameters
int |
$org_id |
Organisation identifier id |
string |
$ctrl_name |
Control account name. One of SACC_CNTL_.. constants defined in defines.php |
SACCGetErrMsg [line 97]
Function: Get last SACC error message
Tags:
SACCGetErrNo [line 86]
Function: Get last SACC error number
Tags:
SACCGetOrg [line 153]
mixed SACCGetOrg(
int $org_id)
|
|
Function: Get the organisation associated with $org_id org identifier
Tags:
Parameters
int |
$org_id |
Organisation ID |
SACCInitJournal [line 256]
mixed SACCInitJournal(
int $org_id, string $dt, [string $purpose = null])
|
|
Function: Initialise a Journal object Initialises (but does not create on the database), a journal object. You will want to call $journalObject->appendEntry() to add account entries to the journal before calling SACCSaveJournal to save the journal to the database.
Tags:
Parameters
int |
$org_id |
Organisation identifier |
string |
$dt |
Date of journal entry in YYYY-MM-DD format |
string |
$purpose |
Purpose of journal. Can be ommitted |
SACCSaveJournal [line 278]
boolean SACCSaveJournal(
object &$journal)
|
|
Function: Save a journal Safe save of a journal. If you use $journalObject->insert(), no balance checking is done. Use this function to check that the journal balances instead
Tags:
Parameters
object |
$journal |
SACCJournal object |
|