dolibarr 21.0.0-beta
accounting.lib.php File Reference

( ) More...

Go to the source code of this file.

Functions

 is_empty ($var, $allow_false=false, $allow_ws=false)
 Check if a value is empty with some options.
 
 accounting_prepare_head (AccountingAccount $object)
 Prepare array with list of tabs.
 
 clean_account ($account)
 Return accounting account without zero on the right.
 
 length_accountg ($account)
 Return General accounting account with defined length (used for product and miscellaneous)
 
 length_accounta ($accounta)
 Return Auxiliary accounting account of thirdparties with defined length.
 
 journalHead ($nom, $variant, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='', $moreoptions=array())
 Show header of a page used to transfer/dispatch data in accounting.
 
 getDefaultDatesForTransfer ()
 Return Default dates for transfer based on periodicity option in accountancy setup.
 
 getCurrentPeriodOfFiscalYear ($db, $conf, $from_time=null, $gm='tzserver', $withenddateonly=1)
 Get current period of fiscal year?
 

Detailed Description

( )

Library of accountancy functions

Definition in file accounting.lib.php.

Function Documentation

◆ accounting_prepare_head()

accounting_prepare_head ( AccountingAccount $object)

Prepare array with list of tabs.

Parameters
AccountingAccount$objectAccounting account
Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 53 of file accounting.lib.php.

References $conf, $object, and complete_head_from_modules().

◆ clean_account()

clean_account ( $account)

Return accounting account without zero on the right.

Parameters
string$accountAccounting account
Returns
string String without zero on the right

Definition at line 82 of file accounting.lib.php.

◆ getCurrentPeriodOfFiscalYear()

getCurrentPeriodOfFiscalYear ( $db,
$conf,
$from_time = null,
$gm = 'tzserver',
$withenddateonly = 1 )

Get current period of fiscal year?

Parameters
DoliDB$dbDatabase handler
Conf$confConfig
?int$from_time[=null] Get current time or set time to find fiscal period
'tzserver'|'gmt'$gm 'gmt' => we return GMT timestamp (recommended), 'tzserver' => we return in the PHP server timezone
int$withenddateonlyDo not return period if end date is not defined
Returns
array{date_start:int,date_end:int} Period of fiscal year : [date_start, date_end]

Definition at line 353 of file accounting.lib.php.

References dol_get_last_day(), dol_get_last_hour(), dol_getdate(), dol_mktime(), dol_now(), and getDolGlobalInt().

Referenced by Asset\calculationDepreciation(), and Accountancy\exportData().

◆ getDefaultDatesForTransfer()

getDefaultDatesForTransfer ( )

Return Default dates for transfer based on periodicity option in accountancy setup.

Returns
array{date_start:int,date_end:int,pastmonthyear:int,pastmonth:int} Dates of periodicity by default

Definition at line 282 of file accounting.lib.php.

References $conf, dol_get_last_day(), dol_mktime(), dol_now(), dol_print_date(), and getDolGlobalInt().

◆ is_empty()

is_empty ( $var,
$allow_false = false,
$allow_ws = false )

Check if a value is empty with some options.

Author
Michael - https://www.php.net/manual/fr/function.empty.php#90767
Parameters
?mixed$varValue to test
boolean$allow_falseSetting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default.
boolean$allow_wsSetting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default.
Returns
boolean True of False

Definition at line 39 of file accounting.lib.php.

Referenced by journalHead(), length_accounta(), and length_accountg().

◆ journalHead()

journalHead ( $nom,
$variant,
$period,
$periodlink,
$description,
$builddate,
$exportlink = '',
$moreparam = array(),
$calcmode = '',
$varlink = '',
$moreoptions = array() )

Show header of a page used to transfer/dispatch data in accounting.

Parameters
string$nomName of report
string$variantLink for alternate report
string$periodPeriod of report
string$periodlinkLink to switch period
string$descriptionDescription
integer$builddateDate of generation
string$exportlinkLink for export or ''
array<string,mixed>$moreparam Array with list of params to add into hidden fields of form
string$calcmodeCalculation mode
string$varlinkAdd a variable into the address of the page
array<string,mixed>$moreoptions Array with list of params to add to table
Returns
void

Definition at line 183 of file accounting.lib.php.

References dol_get_fiche_end(), dol_get_fiche_head(), and is_empty().

◆ length_accounta()

◆ length_accountg()