dolibarr 19.0.4
|
Class to manage categories of an accounting account. More...
Public Member Functions | |
__construct ($db) | |
Constructor. | |
create ($user, $notrigger=0) | |
Create object into database. | |
fetch ($id, $code='', $label='') | |
Load object in memory from database. | |
update ($user=null, $notrigger=0) | |
Update object into database. | |
delete ($user, $notrigger=0) | |
Delete object in database. | |
display ($id) | |
Function to select into ->lines_display all accounting accounts for a given custom accounting group. | |
getAccountsWithNoCategory ($id) | |
Function to fill ->lines_cptbk with accounting account (defined in chart of account) and not yet into a custom group. | |
updateAccAcc ($id_cat, $cpts=array()) | |
Function to add an accounting account in an accounting category. | |
deleteCptCat ($cpt_id) | |
Function to delete an accounting account from an accounting category. | |
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. | |
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) | |
Return list of custom groups. | |
getCptsCat ($cat_id, $predefinedgroupwhere='') | |
Get all accounting account of a given custom group (or a list of custom groups). | |
Class to manage categories of an accounting account.
Definition at line 32 of file accountancycategory.class.php.
AccountancyCategory::__construct | ( | $db | ) |
Constructor.
DoliDb | $db | Database handler |
Definition at line 145 of file accountancycategory.class.php.
AccountancyCategory::create | ( | $user, | |
$notrigger = 0 ) |
Create object into database.
Definition at line 158 of file accountancycategory.class.php.
References dol_syslog(), position, and rowid.
AccountancyCategory::delete | ( | $user, | |
$notrigger = 0 ) |
Delete object in database.
Definition at line 399 of file accountancycategory.class.php.
References dol_syslog().
AccountancyCategory::deleteCptCat | ( | $cpt_id | ) |
Function to delete an accounting account from an accounting category.
int | $cpt_id | Id of accounting account |
Definition at line 587 of file accountancycategory.class.php.
References dol_syslog().
AccountancyCategory::display | ( | $id | ) |
Function to select into ->lines_display all accounting accounts for a given custom accounting group.
int | $id | Id |
Definition at line 437 of file accountancycategory.class.php.
References dol_syslog().
AccountancyCategory::fetch | ( | $id, | |
$code = '', | |||
$label = '' ) |
Load object in memory from database.
int | $id | Id object |
string | $code | Code |
string | $label | Label |
Definition at line 258 of file accountancycategory.class.php.
References dol_syslog(), and position.
AccountancyCategory::getAccountsWithNoCategory | ( | $id | ) |
Function to fill ->lines_cptbk with accounting account (defined in chart of account) and not yet into a custom group.
int | $id | Id of category to know which account to exclude |
Definition at line 472 of file accountancycategory.class.php.
References dol_syslog(), and getDolGlobalInt().
AccountancyCategory::getCats | ( | $categorytype = -1, | |
$active = 1 ) |
Return list of custom groups.
For list + detail of accounting account, see getCatsCpt()
int | $categorytype | -1=All, 0=Only non computed groups, 1=Only computed groups |
int | $active | 1= active, 0=not active |
Definition at line 779 of file accountancycategory.class.php.
References dol_print_error(), and dol_syslog().
AccountancyCategory::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)
int | $catid | Custom group ID |
Definition at line 716 of file accountancycategory.class.php.
References dol_syslog().
AccountancyCategory::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)
int | $cat_id | Id if personalized accounting group/category |
string | $predefinedgroupwhere | Sql criteria filter to select accounting accounts. This value must be sanitized and not come from an input of a user. Example: "pcg_type = 'EXPENSE' AND fk_pcg_version = 'xx'" Example: "fk_accounting_category = 99" |
Definition at line 843 of file accountancycategory.class.php.
References dol_getIdFromCode(), dol_print_error(), dol_syslog(), and getDolGlobalInt().
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.
int | array | $cpt | Accounting account or array of accounting account |
string | $date_start | Date start |
string | $date_end | Date end |
int | $sens | Sens of the account: 0: credit - debit (use this by default), 1: debit - credit |
string | $thirdparty_code | Thirdparty code |
int | $month | Specifig month - Can be empty |
int | $year | Specifig year - Can be empty |
Definition at line 631 of file accountancycategory.class.php.
References dol_get_first_day(), dol_get_last_day(), and dol_syslog().
AccountancyCategory::update | ( | $user = null, | |
$notrigger = 0 ) |
Update object into database.
Definition at line 317 of file accountancycategory.class.php.
References dol_syslog(), and position.
AccountancyCategory::updateAccAcc | ( | $id_cat, | |
$cpts = array() ) |
Function to add an accounting account in an accounting category.
int | $id_cat | Id category |
array | $cpts | list of accounts array |
Definition at line 516 of file accountancycategory.class.php.
References dol_syslog(), getDolGlobalInt(), and length_accountg().