/[phpcompta]/phpcompta/include/impress_inc.php
ViewVC logotype

Diff of /phpcompta/include/impress_inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by sparkyx, Wed Jun 22 20:28:07 2005 UTC revision 1.17 by sparkyx, Thu Jun 30 19:25:44 2005 UTC
# Line 140  function ImpHtml($p_array,$p_cn) Line 140  function ImpHtml($p_array,$p_cn)
140      if ($Max==0) return $ret="";      if ($Max==0) return $ret="";
141      for ($i=0;$i<$Max;$i++) {      for ($i=0;$i<$Max;$i++) {
142        $l_line=pg_fetch_array($Res,$i);        $l_line=pg_fetch_array($Res,$i);
143        $col=ParseFormula($p_cn,        $col=GetFormulaValue($p_cn,
144                     $l_line['fo_label'],                     $l_line['fo_label'],
145                     $l_line['fo_formula'],$cond);                     $l_line['fo_formula'],$cond);
146        echo "<div>";        echo "<div>";
# Line 705  function GetRappel($p_cn,$p_jrnx_id,$p_j Line 705  function GetRappel($p_cn,$p_jrnx_id,$p_j
705        
706  }  }
707  /* function ParseFormula  /* function ParseFormula
708     * Purpose Parse a formula
709     *
710     * parm :
711     *      - $p_cn connexion
712     *      - $p_label
713     *      - $p_formula
714     * gen :
715     *      - none
716     * return:
717     *      - array
718     *
719     */
720    function ParseFormula($p_cn,$p_label,$p_formula,$p_cond) {
721      while (ereg("(\[[0-9]*%*\])",$p_formula,$e) == true) {
722        include_once("class_poste.php");
723        // remove the [ ]
724        $x=$e;
725        $e[0]=str_replace ("[","",$e[0]);
726        $e[0]=str_replace ("]","",$e[0]);
727        // Get sum of account
728        $P=new poste($p_cn,$e[0]);
729        $i=$P->GetSolde($p_cond);
730        $p_formula=str_replace($x,$i,$p_formula);
731      }
732      $p_formula="\$result=".$p_formula.";";
733      echo_debug(__FILE__,__LINE__, $p_formula);
734    
735      eval("$p_formula");
736      $aret=array('desc'=>$p_label,
737                  'montant'=>$result);
738      return $aret;
739    }
740    /* function GetFormulaValue
741   * Purpose : Parse the formula contained in the fo_formula   * Purpose : Parse the formula contained in the fo_formula
742   *           field and return a array containing all the columns   *           field and return a array containing all the columns
743   *   *
# Line 718  function GetRappel($p_cn,$p_jrnx_id,$p_j Line 751  function GetRappel($p_cn,$p_jrnx_id,$p_j
751   *      - array   *      - array
752   *   *
753   */   */
754  function ParseFormula($p_cn,$p_label,$p_formula,$p_cond)  function GetFormulaValue($p_cn,$p_label,$p_formula,$p_cond)
755  {  {
756    $aret=array();    $aret=array();
757    $l_debit=0;    $l_debit=0;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26