fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6654] rental: wrong format fixed - clean up debuggin


From: Sigurd Nes
Subject: [Fmsystem-commits] [6654] rental: wrong format fixed - clean up debugging
Date: Wed, 08 Dec 2010 09:12:02 +0000

Revision: 6654
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6654
Author:   sigurdne
Date:     2010-12-08 09:12:02 +0000 (Wed, 08 Dec 2010)
Log Message:
-----------
rental: wrong format fixed - clean up debugging

Modified Paths:
--------------
    trunk/rental/inc/model/class.agresso_gl07.inc.php

Modified: trunk/rental/inc/model/class.agresso_gl07.inc.php
===================================================================
--- trunk/rental/inc/model/class.agresso_gl07.inc.php   2010-12-08 09:06:48 UTC 
(rev 6653)
+++ trunk/rental/inc/model/class.agresso_gl07.inc.php   2010-12-08 09:12:02 UTC 
(rev 6654)
@@ -266,19 +266,11 @@
        protected function get_formatted_amount($amount)
        {
                $amount = round($amount, 2) * 100;
-               if($amount <= 0)// && !abs($amount)===0) // Negative number , 
extra check for '-0' which proved to be a problem
+               if($amount <= 0) // Negative number , extra check for '-0' 
which proved to be a problem
                {
-                       $ret = '-' . sprintf("%019.19s", abs($amount)); // We 
have to have the sign at the start of the string
+                       return '-' . sprintf("%019.19s", abs($amount)); // We 
have to have the sign at the start of the string
                }
-               else
-               {
-                       $ret = sprintf("%020.20s", $amount);
-               }
-               if($ret == '000000000000000000-0')
-               {
-                       throw new Exception("get_formatted_amount returned 
'000000000000000000-0'");    
-               }
-               return $ret;
+               return sprintf("%020.20s", $amount);
        } 
        
 } 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]