Author: danydb
Date: 2012-07-15 11:14:27 +0200 (Sun, 15 Jul 2012)
New Revision: 5068

Modified:
   phpcompta/tags/rel650/include/class_exercice.php
Log:
New function : select exercice with end & start date


Modified: phpcompta/tags/rel650/include/class_exercice.php
===================================================================
--- phpcompta/tags/rel650/include/class_exercice.php    2012-07-10 10:34:55 UTC 
(rev 5067)
+++ phpcompta/tags/rel650/include/class_exercice.php    2012-07-15 09:14:27 UTC 
(rev 5068)
@@ -21,7 +21,7 @@
 // Copyright Author Dany De Bontridder [email protected]
 
 /*!\file
- * \brief about the accountant exercice 
+ * \brief about the accountant exercice
  */
 require_once('class_database.php');
 require_once('class_iselect.php');
@@ -56,4 +56,23 @@
      $iselect->javascript=$js;
      return $iselect;
    }
+   /**
+    *Show a ISelect with the different exercices, display start and end date
+    *@param $name of the iselect
+    *@param $selected the selected year  (default = '')
+    *@param $js javascript (default = '')
+    *@return ISelect object
+    */
+   function select_date($name,$selected='',$js='')
+   {
+     $iselect=new ISelect($name);
+     $iselect->value=$this->cn->make_array("select distinct p_exercice,to_char 
(min(p_start),'DD.MM.YY')
+                                                                               
                                                         ||' - '
+                                                                               
                                                         ||to_char 
(max(p_end),'DD.MM.YY')
+                                                                               
        from parm_periode
+                                                                               
        group by p_exercice order by 1");
+     $iselect->selected=$selected;
+     $iselect->javascript=$js;
+     return $iselect;
+   }
 }



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

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

Reply via email to