dolibarr  7.0.0-beta
Public Member Functions | List of all members
AccountancyCategory Class Reference

Class to manage categories of an accounting account. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 display ($id)
 Function to select all accounting accounts from an accounting category. More...
 
 getCptBK ($id)
 Function to select accounting category of an accounting account present in chart of accounts. More...
 
 getAccountsWithNoCategory ($id)
 Function to select accounting category of an accounting account present in chart of accounts. More...
 
 updateAccAcc ($id_cat, $cpts=array())
 Function to add an accounting account in an accounting category. More...
 
 deleteCptCat ($cpt_id)
 Function to delete an accounting account from an accounting category. More...
 
 getCatsCpts ()
 Function to know all category from accounting account. More...
 
 getResult ($cpt, $month, $date_start, $date_end, $sens, $thirdparty_code='nofilter')
 Function to show result of an accounting account from the ledger with a direction and a period. More...
 
 getCats ($categorytype=-1)
 Return list of personalized groups. More...
 
 getCptsCat ($cat_id, $predefinedgroupwhere='')
 Get all accounting account of a group. More...
 

Detailed Description

Class to manage categories of an accounting account.

Definition at line 31 of file accountancycategory.class.php.

Constructor & Destructor Documentation

AccountancyCategory::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 48 of file accountancycategory.class.php.

Member Function Documentation

AccountancyCategory::deleteCptCat (   $cpt_id)

Function to delete an accounting account from an accounting category.

Parameters
int$cpt_idId of accounting account
Returns
int <0 if KO, >0 if OK

Definition at line 243 of file accountancycategory.class.php.

References $resql, and dol_syslog().

AccountancyCategory::display (   $id)

Function to select all accounting accounts from an accounting category.

Parameters
int$idId
Returns
int <0 if KO, 0 if not found, >0 if OK

Definition at line 59 of file accountancycategory.class.php.

References $resql, and dol_syslog().

AccountancyCategory::getAccountsWithNoCategory (   $id)

Function to select accounting category of an accounting account present in chart of accounts.

Parameters
int$idId category
Returns
int <0 if KO, 0 if not found, >0 if OK

Definition at line 139 of file accountancycategory.class.php.

References $resql, and dol_syslog().

AccountancyCategory::getCats (   $categorytype = -1)

Return list of personalized groups.

Parameters
int$categorytype-1=All, 0=Only non computed groups, 1=Only computed groups
Returns
array Array of groups

Definition at line 389 of file accountancycategory.class.php.

References $resql, dol_print_error(), and dol_syslog().

AccountancyCategory::getCatsCpts ( )

Function to know all category from accounting account.

Returns
array Result in table

Definition at line 279 of file accountancycategory.class.php.

References $resql, dol_print_error(), and dol_syslog().

AccountancyCategory::getCptBK (   $id)

Function to select accounting category of an accounting account present in chart of accounts.

Parameters
int$idId category
Returns
int <0 if KO, 0 if not found, >0 if OK

Definition at line 92 of file accountancycategory.class.php.

References $resql, and dol_syslog().

AccountancyCategory::getCptsCat (   $cat_id,
  $predefinedgroupwhere = '' 
)

Get all accounting account of a group.

You must choose between first parameter (personalized group) or the second (free criteria filter)

Parameters
int$cat_idId if personalized accounting group/category
string$predefinedgroupwhereSql criteria filter to select accounting accounts
Returns
array Array of accounting accounts

Definition at line 513 of file accountancycategory.class.php.

References $resql, dol_print_error(), and dol_syslog().

AccountancyCategory::getResult (   $cpt,
  $month,
  $date_start,
  $date_end,
  $sens,
  $thirdparty_code = 'nofilter' 
)

Function to show result of an accounting account from the ledger with a direction and a period.

Parameters
int$cptId accounting account
string$monthSpecifig month - Can be empty
string$date_startDate start
string$date_endDate end
int$sensSens of the account: 0: credit - debit, 1: debit - credit
string$thirdparty_codeThirdparty code
Returns
integer Result in table

Definition at line 345 of file accountancycategory.class.php.

References $resql, and dol_syslog().

AccountancyCategory::updateAccAcc (   $id_cat,
  $cpts = array() 
)

Function to add an accounting account in an accounting category.

Parameters
int$id_catId category
array$cptslist of accounts array
Returns
int <0 if KO, >0 if OK

Definition at line 181 of file accountancycategory.class.php.

References $resql, dol_syslog(), and length_accountg().


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