AccountancyCategory
class AccountancyCategory (View source)
Class to manage categories of an accounting account
Properties
| DoliDB | $db | ||
| string | $error | ||
| string[] | $errors | ||
| string | $element | ||
| string | $table_element | ||
| int deprecated | $rowid | ||
| int | $id | ||
| ?string | $code | ||
| ?string | $label | ||
| ?string | $range_account | ||
| ?int | $sens | ||
| ?int | $category_type | ||
| ?string | $formula | ||
| ?int | $position | ||
| ?int | $fk_country | ||
| ?int | $active | ||
| object[] | $lines_cptbk | ||
| object[] | $lines_display | ||
| mixed | $sdc | ||
| array<string, float> | $sdcpermonth | ||
| array<string, float> | $sdcperaccount |
Methods
Constructor
Create object into database
Load object in memory from database
Update object into database
Function to select into ->lines_display all accounting accounts for a given custom accounting group
Function to fill ->lines_cptbk with accounting account (defined in chart of account) and not yet into a custom group
Function to add an accounting account in an accounting category
Function to delete an accounting account from an accounting category
Function to set the property ->sdc (and ->sdcperaccount) that is the result of an accounting account from the ledger with a direction and a period
Function to get an array of all active custom groups (llx_c_accunting_categories) with their accounts from the chart of account (ll_accounting_acount)
Return list of custom groups.
Get all accounting account of a given custom group (or a list of custom groups).
Details
__construct($db)
Constructor
@param DoliDB $db Database handler
create($user, int $notrigger = 0)
Create object into database
@param User $user User that create
fetch($id, string $code = '', $label = '')
Load object in memory from database
@param int $id Id object
update($user = null, int $notrigger = 0)
Update object into database
@param User $user User that modify
delete(User $user, $notrigger = 0)
Delete object in database
int
display(int $id)
Function to select into ->lines_display all accounting accounts for a given custom accounting group
int
getAccountsWithNoCategory(int $id)
Function to fill ->lines_cptbk with accounting account (defined in chart of account) and not yet into a custom group
int
updateAccAcc(int $id_cat, array<string, ?string> $cpts = array())
Function to add an accounting account in an accounting category
int
deleteCptCat(int $cpt_id)
Function to delete an accounting account from an accounting category
int
getSumDebitCredit(int|array<?string> $cpt, int $date_start, int $date_end, int<0, 1> $sens, string $thirdparty_code = 'nofilter', int $month = 0, int $year = 0)
Function to set the property ->sdc (and ->sdcperaccount) that is the result of an accounting account from the ledger with a direction and a period
getCatsCpts($catid = 0)
Function to get an array of all active custom groups (llx_c_accunting_categories) with their accounts from the chart of account (ll_accounting_acount)
getCats($categorytype = -1, $active = 1, $id_report = 1)
Return list of custom groups.
For list + detail of accounting account, see getCatsCpt()
getCptsCat($cat_id, $predefinedgroupwhere = '')
Get all accounting account of a given custom group (or a list of custom groups).
You must choose between first parameter (personalized group) or the second (free criteria filter)