New: Accountancy add a function to remove all zero at the right of the account.

Thanks to Florian
This commit is contained in:
aspangaro
2015-12-15 20:48:06 +01:00
parent 687370071b
commit c1e77daeb1

View File

@@ -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