phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4722 - in phpcompta/trunk/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r4722 - in phpcompta/trunk/include: . template
Date: Wed, 18 Jan 2012 16:31:47 +0100 (CET)

Author: danydb
Date: 2012-01-18 16:31:47 +0100 (Wed, 18 Jan 2012)
New Revision: 4722

Modified:
   phpcompta/trunk/include/class_anticipation.php
   phpcompta/trunk/include/template/forecast-detail.php
   phpcompta/trunk/include/template/forecast_result.php
Log:
#511 : utilisation de formule dans les pr?\195?\169visions

Modified: phpcompta/trunk/include/class_anticipation.php
===================================================================
--- phpcompta/trunk/include/class_anticipation.php      2012-01-18 15:31:31 UTC 
(rev 4721)
+++ phpcompta/trunk/include/class_anticipation.php      2012-01-18 15:31:47 UTC 
(rev 4722)
@@ -36,6 +36,8 @@
 require_once 'class_fiche.php';
 require_once 'class_acc_account_ledger.php';
 require_once 'class_periode.php';
+require_once 'class_impress.php';
+
 class Anticipation
 {
     /* example private $variable=array("val1"=>1,"val2"=>"Seconde 
valeur","val3"=>0); */
@@ -137,10 +139,12 @@
                                         where p_start >= (select p_start from 
parm_periode where p_id=$start)
                                          and p_end <= (select p_end from 
parm_periode where p_id=$end)
                                         order by p_start;");
+       $error=array();
         for($j=0;$j<count($aCat);$j++)
         {
             $aItem[$j]=$this->cn->get_array('select 
fi_card,fi_account,fi_text,fi_amount,fi_debit from forecast_item where fc_id=$1 
 and fi_pid=0 order by fi_order ',array($aCat[$j]['fc_id']));
             $aPerMonth[$j]=$this->cn->get_array('select 
fi_pid,fi_card,fi_account,fi_text,fi_amount,fi_debit from forecast_item where 
fc_id=$1 and fi_pid !=0 order by fi_order ',array($aCat[$j]['fc_id']));
+
             /* compute the real amount for periode */
             for($k=0;$k<count($aItem[$j]);$k++)
             {
@@ -151,15 +155,19 @@
                     {
                         $fiche->id=$aItem[$j][$k]['fi_card'];
                         $amount=$fiche->get_solde_detail("j_tech_per = 
".$aPeriode[$l]['p_id']);
+                       if ($aItem[$j][$k]['fi_debit']=='C' && 
$amount['debit']>$amount['credit'])  $amount['solde']=$amount["solde"]*(-1);
+                       if ($aItem[$j][$k]['fi_debit']=='D' && 
$amount['debit']<$amount['credit'])  $amount['solde']=$amount["solde"]*(-1);
 
                     }
                     else
                     {
                         $poste->id=$aItem[$j][$k]['fi_account'];
-                        $amount=$poste->get_solde_detail("j_tech_per= 
".$aPeriode[$l]['p_id']);
+                       
$aresult=Impress::parse_formula($this->cn,"OK",$poste->id,$aPeriode[$l]['p_id'],$aPeriode[$l]['p_id']);
+                        $tmp_label=$aresult['desc'];
+                       $amount['solde']=$aresult['montant'];
+
+                       if ( $tmp_label != 'OK') $error[]="<li> 
".$aItem[$j][$k]['fi_text'].$poste->id.'</li>';
                     }
-                    if ($aItem[$j][$k]['fi_debit']=='C' && 
$amount['debit']>$amount['credit'])  $amount['solde']=$amount["solde"]*(-1);
-                    if ($aItem[$j][$k]['fi_debit']=='D' && 
$amount['debit']<$amount['credit'])  $amount['solde']=$amount["solde"]*(-1);
                     $aReal[$j][$k][$l]=$amount['solde'];
                 }
             }
@@ -367,8 +375,12 @@
             /* Accounting*/
             $account=new IPoste('an_cat_acc'.$i);
             $account->set_attribute('ipopup','ipop_account');
-            $account->set_attribute('label','an_label'.$i);
+           //            $account->set_attribute('label','an_label'.$i);
             $account->set_attribute('account','an_cat_acc'.$i);
+           $account->set_attribute('bracket',1);
+           $account->set_attribute('no_overwrite',1);
+           $account->set_attribute('noquery',1);
+           $account->css_size="85%";
             
$account->value=(isset($value[$i]["fi_account"]))?$value[$i]["fi_account"]:"";
             $aCat[$i]['account']=$account->input();
             /*Quick Code */

Modified: phpcompta/trunk/include/template/forecast-detail.php
===================================================================
--- phpcompta/trunk/include/template/forecast-detail.php        2012-01-18 
15:31:31 UTC (rev 4721)
+++ phpcompta/trunk/include/template/forecast-detail.php        2012-01-18 
15:31:47 UTC (rev 4722)
@@ -5,8 +5,8 @@
 <table id="fortable">
 <tr>
 <th><?php echo _('Catégorie');?></th>
-<th><?php echo _('Poste Comptable');?></th>
-<th><?php echo _('QuickCode');?></th>
+<th style="width:40%"><?php echo _('Formules');?></th>
+<th><?php echo _('ou QuickCode');?></th>
 <th><?php echo _('Libellé');?></th>
 <th><?php echo _('Montant');?></th>
 <th><?php echo _('Débit ou Crédit');?></th>

Modified: phpcompta/trunk/include/template/forecast_result.php
===================================================================
--- phpcompta/trunk/include/template/forecast_result.php        2012-01-18 
15:31:31 UTC (rev 4721)
+++ phpcompta/trunk/include/template/forecast_result.php        2012-01-18 
15:31:47 UTC (rev 4722)
@@ -166,3 +166,18 @@
 
 
 <?php endfor;?>
+<? if ( ! empty ($error) ) : ?>
+<div class="error">
+Désolé il y a des formules incorrectes 
+<ul style="list-style-type:none">
+
+   <? $last="";?>
+   <? for ($i=0;$i<count($error);$i++) : ?>
+<?
+   if ( $last != $error[$i] ) {  echo h($error[$i]); }
+$last=$error[$i];
+endfor;
+?>
+</ul>
+</div>
+<? endif; ?>
\ No newline at end of file




reply via email to

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