mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
New: Accountancy add a function to remove all zero at the right of the account.
Thanks to Florian
This commit is contained in:
@@ -99,24 +99,10 @@ function accounting_prepare_head(AccountingAccount $object)
|
||||
*/
|
||||
function clean_account($account)
|
||||
{
|
||||
global $conf;
|
||||
$account = rtrim($account,"0");
|
||||
|
||||
// Clean parameters
|
||||
$i = strlen($account);
|
||||
|
||||
if ($i >= 1) {
|
||||
if (substr($account, -1) == 0) {
|
||||
while ( $i >= 1 ) {
|
||||
$account = substr($account, $i);
|
||||
|
||||
$i --;
|
||||
}
|
||||
return $account;
|
||||
}
|
||||
} else {
|
||||
return $account;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return general accounting account with defined length
|
||||
|
||||
Reference in New Issue
Block a user