dolibarr  9.0.0
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

◆ __construct()

AccountancyCategory::__construct (   $db)

Constructor.

Parameters
DoliDb$dbDatabase handler

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

Member Function Documentation

◆ create()

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

◆ delete()

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

◆ deleteCptCat()

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

◆ display()

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

◆ fetch()

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

◆ getAccountsWithNoCategory()

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

◆ getCats()

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

◆ getCatsCpts()

AccountancyCategory::getCatsCpts ( )

Function to know all category from accounting account.

Returns
array Result in table

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

◆ getCptBK()

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

◆ getCptsCat()

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

◆ getSumDebitCredit()

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

◆ update()

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

◆ updateAccAcc()

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


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