phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4091 - phpcompta/trunk/include
Date: Sat, 14 May 2011 07:04:50 +0200 (CEST)

Author: danydb
Date: 2011-05-14 07:04:50 +0200 (Sat, 14 May 2011)
New Revision: 4091

Modified:
   phpcompta/trunk/include/class_acc_ledger_fin.php
Log:
0000259: Compta analytique -> financier

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_fin.php    2011-05-14 00:36:59 UTC 
(rev 4090)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php    2011-05-14 05:04:50 UTC 
(rev 4091)
@@ -390,6 +390,7 @@
         bcscale(2);
         extract ($p_array);
         $pPeriode=new Periode($this->db);
+       $owner=new Own($this->db);
         if ($this->check_periode() == true)
         {
             $pPeriode->p_id=$periode;
@@ -470,6 +471,19 @@
         $r.="<th>Commentaire</TH>";
         $r.="<th>Montant</TH>";
         $r.='<th colspan="2"> Op. Concern&eacute;e(s)</th>';
+
+       /* if we use the AC */
+        if ($owner->MY_ANALYTIC!='nu')
+        {
+            $anc=new Anc_Plan($this->db);
+            $a_anc=$anc->get_list();
+            $x=count($a_anc);
+            /* set the width of the col */
+            $r.='<th colspan="'.$x.'">'._('Compt. Analytique').'</th>';
+
+            /* add hidden variables pa[] to hold the value of pa_id */
+            $r.=Anc_Plan::hidden($a_anc);
+        }
         $r.="</TR>";
         // Parse each " tiers"
         $tot_amount=0;
@@ -507,6 +521,21 @@
             $r.='<td>';
             $r.=${"e_concerned".$i};
             $r.='</td>';
+            // encode the pa
+            if ( $owner->MY_ANALYTIC!='nu' && 
preg_match("/^[6,7]/",$fTiers->strAttribut(ATTR_DEF_ACCOUNT))==1 ) // use of AA
+            {
+                // show form
+                $anc_op=new Anc_Operation($this->db);
+                $null=($owner->MY_ANALYTIC=='op')?1:0;
+                $r.='<td>';
+                $p_mode=1;
+                $p_array['pa_id']=$a_anc;
+                /* op is the operation it contains either a sequence or a 
jrnx.j_id */
+                $r.=HtmlInput::hidden('op[]=',$i);
+                
$r.=$anc_op->display_form_plan($p_array,$null,$p_mode,$i,$tiers_amount);
+                $r.='</td>';
+            }
+
             $r.='</TR>';
         }
         $r.="</TABLE>";
@@ -567,7 +596,7 @@
         $bank_id=$this->get_bank();
         $fBank=new Fiche($this->db,$bank_id);
         $e_bank_account=$fBank->strAttribut(ATTR_DEF_QUICKCODE);
-
+       $owner=new Own($this->db);
         // Get the saldo
         $pPeriode=new Periode($this->db);
         if ( $this->check_periode() == true )
@@ -660,7 +689,7 @@
                 }
                 $acc_operation->periode=$tperiode;
                 $acc_operation->qcode=${"e_other".$i};
-                $acc_operation->insert_jrnx();
+                $j_id=$acc_operation->insert_jrnx();
 
                 $acc_operation=new Acc_Operation($this->db);
                 $acc_operation->date=$e_date;
@@ -760,6 +789,19 @@
                  */
                
$this->insert_quant_fin($fBank->id,$jr_id,$fPoste->id,${"e_other$i"."_amount"});
 
+                if ( $owner->MY_ANALYTIC != "nu" )
+                {
+                    // for each item, insert into operation_analytique */
+                    $op=new Anc_Operation($this->db);
+                   $op->oa_group=$this->db->get_next_seq("s_oa_group"); /* for 
analytic */
+                    $op->j_id=$j_id;
+                    $op->oa_date=$e_date;
+                    $op->oa_debit=($amount < 0 )?'t':'f';
+                    $op->oa_description=FormatString($comment);
+                    $op->save_form_plan($_POST,$i,$j_id);
+                }
+                
+
                 $this->update_internal_code($internal);
 
 




reply via email to

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