dolibarr  13.0.2
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...
 
 create ($user, $notrigger=0)
 Create object into database. More...
 
 fetch ($id, $code= '', $label= '')
 Load object in memory from database. More...
 
 update ($user=null, $notrigger=0)
 Update object into database. More...
 
 delete ($user, $notrigger=0)
 Delete object in database. 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...
 
 getSumDebitCredit ($cpt, $date_start, $date_end, $sens, $thirdparty_code= 'nofilter', $month=0, $year=0)
 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 that are active. 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 32 of file accountancycategory.class.php.

Constructor & Destructor Documentation

AccountancyCategory::__construct (   $db)

Constructor.

Parameters
DoliDb$dbDatabase handler

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

References db.

Member Function Documentation

AccountancyCategory::create (   $user,
  $notrigger = 0 
)

Create object into database.

Parameters
User$userUser that create
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int <0 if KO, Id of created object if OK

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

References $resql, code, db, dol_syslog(), and rowid.

AccountancyCategory::delete (   $user,
  $notrigger = 0 
)

Delete object in database.

Parameters
User$userUser that delete
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int <0 if KO, >0 if OK

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

References $resql, db, and dol_syslog().

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 584 of file accountancycategory.class.php.

References $resql, db, and dol_syslog().

array Lines 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 384 of file accountancycategory.class.php.

References $resql, db, and dol_syslog().

AccountancyCategory::fetch (   $id,
  $code = '',
  $label = '' 
)

Load object in memory from database.

Parameters
int$idId object
string$codeCode
string$labelLabel
Returns
int <0 if KO, >0 if OK

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

References $resql, code, db, and dol_syslog().

AccountancyCategory::getAccountsWithNoCategory (   $id)

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

Parameters
int$idId of category to know which account to exclude
Returns
int <0 if KO, 0 if not found, >0 if OK

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

References $resql, db, and dol_syslog().

AccountancyCategory::getCats (   $categorytype = -1)

Return list of personalized groups that are active.

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

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

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

AccountancyCategory::getCatsCpts ( )

Function to know all category from accounting account.

Returns
array|integer Result in table (array), -1 if KO

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

References $resql, db, 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 420 of file accountancycategory.class.php.

References $resql, db, 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|int Array of accounting accounts or -1 if error

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

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

AccountancyCategory::getSumDebitCredit (   $cpt,
  $date_start,
  $date_end,
  $sens,
  $thirdparty_code = 'nofilter',
  $month = 0,
  $year = 0 
)

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

Parameters
int | array$cptAccounting account or array of accounting account
string$date_startDate start
string$date_endDate end
int$sensSens of the account: 0: credit - debit (use this by default), 1: debit - credit
string$thirdparty_codeThirdparty code
int$monthSpecifig month - Can be empty
int$yearSpecifig year - Can be empty
Returns
integer <0 if KO, >= 0 if OK

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

References $resql, db, dol_get_first_day(), dol_get_last_day(), and dol_syslog().

AccountancyCategory::update (   $user = null,
  $notrigger = 0 
)

Update object into database.

Parameters
User$userUser that modify
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int <0 if KO, >0 if OK

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

References $resql, code, db, 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 513 of file accountancycategory.class.php.

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


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