phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5053 - phpcompta/tags/rel650/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5053 - phpcompta/tags/rel650/include
Date: Sat, 30 Jun 2012 14:16:40 +0200 (CEST)

Author: danydb
Date: 2012-06-30 14:16:40 +0200 (Sat, 30 Jun 2012)
New Revision: 5053

Modified:
   phpcompta/tags/rel650/include/class_impress.php
   phpcompta/tags/rel650/include/impress_rapport.inc.php
Log:
Rapport BUG avec les postes comptables alphanum?\195?\169riques

Modified: phpcompta/tags/rel650/include/class_impress.php
===================================================================
--- phpcompta/tags/rel650/include/class_impress.php     2012-06-30 12:14:10 UTC 
(rev 5052)
+++ phpcompta/tags/rel650/include/class_impress.php     2012-06-30 12:16:40 UTC 
(rev 5053)
@@ -60,8 +60,7 @@
 
         include_once("class_acc_account_ledger.php");
 
-        //    while (@ereg("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) == true)
-        while (preg_match_all("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) == true)
+        while (preg_match_all("(\[[0-9]*[A-Z]*%*c*d*s*\])",$p_formula,$e) == 
true)
           {
 
             // remove the [ ]
@@ -69,17 +68,17 @@
             foreach ($x as $line)
               {
                 $compute='all';
-                if ( strpos($line,'D') != 0 )
+                if ( strpos($line,'d') != 0 )
                   $compute='deb';
-                if ( strpos($line,'C') != 0 )
+                if ( strpos($line,'c') != 0 )
                   $compute='cred';
-                if ( strpos($line,'S') != 0 )
+                if ( strpos($line,'s') != 0 )
                   $compute='signed';
                 $line=str_replace ("[","",$line);
                 $line=str_replace ("]","",$line);
-                $line=str_replace ("D","",$line);
-                $line=str_replace ("C","",$line);
-                $line=str_replace ("S","",$line);
+                $line=str_replace ("d","",$line);
+                $line=str_replace ("c","",$line);
+                $line=str_replace ("s","",$line);
                 // If there is a FROM clause we must recompute
                 // the time cond
 
@@ -159,7 +158,6 @@
         if ( $p_eval == true)
         {
             $p_formula="\$result=".$p_formula.";";
-
             eval("$p_formula");
 
             while (preg_match("/\[([0-9]+)([Tt]*)\]/",trim($p_label),$e) == 1)
@@ -213,20 +211,30 @@
         // eat Space
         $p_string=str_replace(" ","",$p_string);
         // Remove D/C/S
-        $p_string=str_replace("C","",$p_string);
-        $p_string=str_replace("D","",$p_string);
-        $p_string=str_replace("S","",$p_string);
+        $p_string=str_replace("c","",$p_string);
+        $p_string=str_replace("d","",$p_string);
+        $p_string=str_replace("s","",$p_string);
         // Remove T,t
-        $p_string=str_replace("T","",$p_string);
         $p_string=str_replace("t","",$p_string);
 
-        if ( @ereg 
("^(\\$[a-zA-Z]*[0-9]*=){0,1}((\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})+ 
*([+-\*/])* 
*(\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})*)*(([+-\*/])*\\$([a-zA-Z])+[0-9]*([+-\*/])*)*
 *( *FROM=[0-9][0-0].20[0-9][0-9]){0,1}$",$p_string) == false)
+               // remove date
+               $p_string=  preg_replace("/FROM*=*[0-9]+/", "", $p_string);
+
+               // remove account
+               $p_string=  preg_replace("/\[[0-9]*[A-Z]*%*\]/", "", $p_string);
+
+               $p_string=  preg_replace("/\+|-|\/\*/", "", $p_string);
+               
//********************************************************************************************************************
+               // If the string is empty then formula should be good
+               //
+               
//********************************************************************************************************************
+               if ($p_string == '')
         {
-            return false;
+            return true;
         }
         else
         {
-            return true;
+            return false;
         }
     }
      /**

Modified: phpcompta/tags/rel650/include/impress_rapport.inc.php
===================================================================
--- phpcompta/tags/rel650/include/impress_rapport.inc.php       2012-06-30 
12:14:10 UTC (rev 5052)
+++ phpcompta/tags/rel650/include/impress_rapport.inc.php       2012-06-30 
12:16:40 UTC (rev 5053)
@@ -273,7 +273,7 @@
 
         echo "<TR $class>".
         "<TD>".h($op['desc'])."</TD>".
-        "<TD align=\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>".
+        "<TD align=\"right\">".nbm($op['montant'])."</TD>".
         "</TR>";
     }
     echo "</table>";



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