Author: danydb
Date: 2012-02-04 18:53:23 +0100 (Sat, 04 Feb 2012)
New Revision: 4749

Modified:
   phpcompta/tags/rel560_syndic/include/class_acc_operation.php
Log:
periode is computed

Modified: phpcompta/tags/rel560_syndic/include/class_acc_operation.php
===================================================================
--- phpcompta/tags/rel560_syndic/include/class_acc_operation.php        
2012-02-04 17:47:00 UTC (rev 4748)
+++ phpcompta/tags/rel560_syndic/include/class_acc_operation.php        
2012-02-04 17:53:23 UTC (rev 4749)
@@ -93,6 +93,10 @@
         {
             $this->type=($this->type=='d')?'c':'d';
         }
+
+               if ($this->periode == 0 || strlen(trim($this->periode))==0)
+                               $this->periode=$this->db->get_value('select 
find_periode($1)',array($this->date));
+
         $this->amount=abs($this->amount);
         $debit=($this->type=='c')?'false':'true';
         $this->desc=(isset($this->desc))?$this->desc:'';
@@ -194,7 +198,8 @@
             echo "Erreur : balance incorrecte :diff = $diff";
             return false;
         }
-
+               if ($this->periode == 0 || strlen(trim($this->periode))==0)
+                               $this->periode=$this->db->get_value('select 
find_periode($1)',array($this->date));
         $echeance=( isset( $this->echeance) && strlen(trim($this->echeance)) 
!= 0)?$this->echeance:null;
         if ( ! isset($this->mt) )
         {
@@ -468,7 +473,7 @@
     }
     /**
     *@brief retrieve data from jrnx and jrn
-    *@return return an object 
+    *@return return an object
     *@note
     *@see
     @code
@@ -562,7 +567,7 @@
 /**
  *@brief this class manage data from the JRNX and JRN
  * table
- *@note Data member are the column of the table 
+ *@note Data member are the column of the table
  */
 class Acc_Misc extends Acc_Detail
 {
@@ -588,7 +593,7 @@
 /**
  *@brief this class manage data from the QUANT_SOLD
  * table
- *@note Data member are the column of the table 
+ *@note Data member are the column of the table
  */
 class Acc_Sold extends Acc_Detail
 {
@@ -611,8 +616,8 @@
 /**
  *@brief this class manage data from the QUANT_PURCHASE
  * table
- *@note Data member are the column of the table 
- 
+ *@note Data member are the column of the table
+
  */
 class Acc_Purchase extends Acc_Detail
 {
@@ -636,7 +641,7 @@
 /**
  *@brief this class manage data from the QUANT_FIN
  * table
- *@note Data member are the column of the table 
+ *@note Data member are the column of the table
  */
 class Acc_Fin extends Acc_Detail
 {



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