Browse Source

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

Thanks to Florian
aspangaro 9 years ago
parent
commit
c1e77daeb1
1 changed files with 3 additions and 17 deletions
  1. 3 17
      htdocs/core/lib/accounting.lib.php

+ 3 - 17
htdocs/core/lib/accounting.lib.php

@@ -99,23 +99,9 @@ function accounting_prepare_head(AccountingAccount $object)
  */
 function clean_account($account)
 {
-	global $conf;
-
-	// 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;
-	}
+	$account = rtrim($account,"0");
+	
+	return $account;
 }
 
 /**