phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4814 - phpcompta/tags/rel601/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4814 - phpcompta/tags/rel601/include
Date: Tue, 24 Apr 2012 21:33:02 +0200 (CEST)

Author: danydb
Date: 2012-04-24 21:33:02 +0200 (Tue, 24 Apr 2012)
New Revision: 4814

Modified:
   phpcompta/tags/rel601/include/class_pre_operation.php
   phpcompta/tags/rel601/include/preod.inc.php
Log:
Fix bug predefined operation for misc ledger


Modified: phpcompta/tags/rel601/include/class_pre_operation.php
===================================================================
--- phpcompta/tags/rel601/include/class_pre_operation.php       2012-04-24 
18:58:20 UTC (rev 4813)
+++ phpcompta/tags/rel601/include/class_pre_operation.php       2012-04-24 
19:33:02 UTC (rev 4814)
@@ -63,8 +63,7 @@
     }
     function delete ()
     {
-        $sql="delete from op_predef where od_id=".$this->od_id.
-             " and od_direct ='".$this->od_direct."'";
+        $sql="delete from op_predef where od_id=".$this->od_id;
         $this->db->exec_sql($sql);
     }
     /*!\brief save the predef check first is the name is unique

Modified: phpcompta/tags/rel601/include/preod.inc.php
===================================================================
--- phpcompta/tags/rel601/include/preod.inc.php 2012-04-24 18:58:20 UTC (rev 
4813)
+++ phpcompta/tags/rel601/include/preod.inc.php 2012-04-24 19:33:02 UTC (rev 
4814)
@@ -64,17 +64,14 @@
 {
     $op=new Pre_operation($cn);
     $op->set_jrn($_GET['jrn']);
-    if ( isset($_GET['direct']))
+   $is_ods = $cn->get_value("select count(*)
+               from jrn_def where
+                       jrn_def_id=$1
+                       and jrn_def_type='ODS'", array($_GET['jrn']));
+       $op->od_direct = ($is_ods > 0) ? 't' : 'f';
+       $array = $op->get_list_ledger();
+       if (empty($array) == true)
     {
-        $op->od_direct='true';
-    }
-    else
-    {
-        $op->od_direct='false';
-    }
-    $array=$op->get_list_ledger();
-    if ( empty($array) == true )
-    {
         echo "Aucun enregistrement";
         exit();
     }



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