phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4724 - phpcompta/trunk/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4724 - phpcompta/trunk/include
Date: Fri, 20 Jan 2012 19:23:21 +0100 (CET)

Author: danydb
Date: 2012-01-20 19:23:20 +0100 (Fri, 20 Jan 2012)
New Revision: 4724

Modified:
   phpcompta/trunk/include/class_anc_grandlivre.php
   phpcompta/trunk/include/class_anc_operation.php
Log:

Bug anc : order date + filter date


Modified: phpcompta/trunk/include/class_anc_grandlivre.php
===================================================================
--- phpcompta/trunk/include/class_anc_grandlivre.php    2012-01-20 15:49:18 UTC 
(rev 4723)
+++ phpcompta/trunk/include/class_anc_grandlivre.php    2012-01-20 18:23:20 UTC 
(rev 4724)
@@ -28,6 +28,22 @@
 
 class Anc_GrandLivre extends Anc_Print
 {
+           function set_sql_filter()
+    {
+        $sql="";
+        $and=" and ";
+        if ( $this->from != "" )
+        {
+            $sql.="$and oa_date >= to_date('".$this->from."','DD.MM.YYYY')";
+        }
+        if ( $this->to != "" )
+        {
+            $sql.=" $and oa_date <= to_date('".$this->to."','DD.MM.YYYY')";
+        }
+
+        return $sql;
+
+    }
       /*!
      * \brief load the data from the database
      *
@@ -62,10 +78,9 @@
        from operation_analytique as B join poste_analytique using(po_id)
        left join jrnx using (j_id)
        left join jrn on  (j_grpt=jr_grpt_id)
-             where $pa_id_cond oa_amount <> 0.0  $cond_poste
-       order by po_name,oa_date ,qcode,j_poste");
+             where $pa_id_cond oa_amount <> 0.0  $cond_poste  $filter_date
+       order by po_name,to_date(oa_date,'DD.MM.YYYY') ,qcode,j_poste");
 
-
         return $array;
     }
 
@@ -92,8 +107,8 @@
        from operation_analytique as B join poste_analytique using(po_id)
        left join jrnx using (j_id)
        left join jrn on  (j_grpt=jr_grpt_id)
-             where $pa_id_cond oa_amount <> 0.0  $cond_poste
-       order by po_name,oa_date ,qcode,j_poste");
+             where $pa_id_cond oa_amount <> 0.0  $cond_poste $filter_date
+       order by po_name,to_date(oa_date,'DD.MM.YYYY') ,qcode,j_poste");
 
 
         return $array;

Modified: phpcompta/trunk/include/class_anc_operation.php
===================================================================
--- phpcompta/trunk/include/class_anc_operation.php     2012-01-20 15:49:18 UTC 
(rev 4723)
+++ phpcompta/trunk/include/class_anc_operation.php     2012-01-20 18:23:20 UTC 
(rev 4724)
@@ -154,7 +154,7 @@
        left join jrnx using (j_id)
        left join jrn on  (j_grpt=jr_grpt_id)
              where $pa_id_cond oa_amount <> 0.0 $cond $cond_poste
-       order by oa_date ,oa_group,oa_debit desc,oa_id";
+       order by jr_date,oa_group,oa_debit desc,oa_id";
 
         $RetSql=$this->db->exec_sql($sql);
 




reply via email to

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