SACC
[ class tree: SACC ] [ index: SACC ] [ all elements ]

Procedural File: functions.php

Source Location: /include/functions.php



Page Details:

API functions

App. Programming Interface functions To use these function make sure you:

  1. 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:

version:  1
copyright:  2005 Ashley Kitson, UK
author:  Ashley Kitson http://xoobs.net


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:

return:  SACCAccount object else false if unable to create account


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.
[ Top ]



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:

return:  SACCOrg Object else FALSE if unable to create organisation


Parameters

string   $orgname   Name of the organisation
string   $currency   Currency code (see CDM currency codes)
[ Top ]



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

numeric   $amount  
[ Top ]



SACCGetAccount [line 210]

mixed SACCGetAccount( int $ac_id)

Function: Return account object associated with the account id



Tags:

return:  SACCAccount Object else FALSE if error


Parameters

int   $ac_id   Account ID
[ Top ]



SACCGetControlAccount [line 229]

mixed SACCGetControlAccount( int $org_id, string $ctrl_name)

Function: Returns the account associated with the specified control account



Tags:

return:  SACCAccount object else False


Parameters

int   $org_id   Organisation identifier id
string   $ctrl_name   Control account name. One of SACC_CNTL_.. constants defined in defines.php
[ Top ]



SACCGetErrMsg [line 97]

string SACCGetErrMsg( )

Function: Get last SACC error message



Tags:

global:  array $_SESSION: User session


[ Top ]



SACCGetErrNo [line 86]

int SACCGetErrNo( )

Function: Get last SACC error number



Tags:

global:  array $_SESSION: User session


[ Top ]



SACCGetOrg [line 153]

mixed SACCGetOrg( int $org_id)

Function: Get the organisation associated with $org_id org identifier



Tags:

return:  SACCOrg object else FALSE on error


Parameters

int   $org_id   Organisation ID
[ Top ]



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:

return:  SACCJournal object on success else False


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
[ Top ]



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:

return:  TRUE if Journal balances and is saved else FALSE


Parameters

object   $journal   SACCJournal object
[ Top ]



Documentation generated on Thu, 23 Feb 2006 13:06:03 +0000 by phpDocumentor 1.3.0RC3