Author: danydb
Date: 2013-01-03 21:15:40 +0100 (Thu, 03 Jan 2013)
New Revision: 5170

Modified:
   phpcompta/tags/rel650/include/class_fiche.php
Log:
0000773: Bug sur fiches avec double postes comptables

Modified: phpcompta/tags/rel650/include/class_fiche.php
===================================================================
--- phpcompta/tags/rel650/include/class_fiche.php       2012-12-14 18:58:23 UTC 
(rev 5169)
+++ phpcompta/tags/rel650/include/class_fiche.php       2013-01-03 20:15:40 UTC 
(rev 5170)
@@ -780,7 +780,19 @@
 
                         if ( strlen(trim($v)) != 0)
                         {
-                                                       
$v=$this->cn->get_value("select format_account($1)",array($value));
+                                                       if( 
strpos($value,',')==0)
+                                                       {
+                                                               
$v=$this->cn->get_value("select format_account($1)",array($value));
+                                                       } else {
+                                                               $ac_array = 
explode(",", $value);
+                                                               if 
(count($ac_array) <> 2)
+                                                                       throw 
new Exception('Désolé, il y a trop de virgule dans le poste comptable ' . 
h($value));
+                                                               $part1 = 
$ac_array[0];
+                                                               $part2 = 
$ac_array[1];
+                                                               $part1 = 
$this->cn->get_value('select format_account($1)', array($part1));
+                                                               $part2 = 
$this->cn->get_value('select format_account($1)', array($part2));
+                                                               $v = $part1 . 
',' . $part2;
+                                                       }
                             $parameter=array($this->id,$v);
                         }
                         else



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

_______________________________________________
Phpcompta  est un logiciel libre de comptabilit&#233; en ligne 
(http://www.phpcompta.eu)
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev

Reply via email to