phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r601 - trunk/rapport_avance/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r601 - trunk/rapport_avance/include
Date: Sun, 8 Dec 2013 21:45:04 +0100 (CET)

Author: danydb
Date: 2013-12-08 21:45:04 +0100 (Sun, 08 Dec 2013)
New Revision: 601

Modified:
   trunk/rapport_avance/include/class_rapav_listing_formula.php
Log:
protect againt division by zero

Modified: trunk/rapport_avance/include/class_rapav_listing_formula.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_formula.php        
2013-12-08 20:41:46 UTC (rev 600)
+++ trunk/rapport_avance/include/class_rapav_listing_formula.php        
2013-12-08 20:45:04 UTC (rev 601)
@@ -428,7 +428,12 @@
                                 ', array($this->detail->lc_id, 
$search,$this->fiche->f_id));
             $formula = str_replace($piece, $value, $formula);
         }
-        eval('$amount = ' . $formula . ';');
+        if ( strpos("1".$formula,"/0.0000") != 0)
+        {
+            $amount=0;
+        } else {
+            eval('$amount = ' . $formula . ';');
+        }
         //
         $this->detail->ld_value_numeric= $amount;
     }



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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