compte_ecriture,$rowsCGL->long_compte,$bdd); $libcompte=$dataCGL['lib']; $numerocompteCGL=$rowsCGL->compte_ecriture; if (!in_array($numerocompteCGL,$_SESSION['grandlivre']['numerocompte'])) { $result=GenererGrandLivre($exercice_id,$numerocompteCGL,$d1,$d2,$site_id,$bdd); $cumuls=GenererGrandLivreCumuls($exercice_id,$numerocompteCGL,$d1,$d2,$site_id,$bdd); $debitcdf=$cumuls['debitcdf']; $creditcdf=$cumuls['creditcdf']; $debitusd=$cumuls['debitusd']; $creditusd=$cumuls['creditusd']; $stotdebitcdf=0; $stotdebitusd=0; $stotcreditcdf=0; $stotcreditusd=0; $solde1=$cumuls['solde1']; $solde2=$cumuls['solde2']; $stotsolde1=$solde1; $stotsolde2=$solde2; array_push($_SESSION['grandlivre']['numerocompte'],$numerocompteCGL); array_push($_SESSION['grandlivre']['afficher'],'1'); array_push($_SESSION['grandlivre']['compte'],ucfirst($libcompte)); array_push($_SESSION['grandlivre']['date'],''); array_push($_SESSION['grandlivre']['reference'],''); array_push($_SESSION['grandlivre']['libelle'],''); array_push($_SESSION['grandlivre']['debitcdf'],''); array_push($_SESSION['grandlivre']['creditcdf'],''); array_push($_SESSION['grandlivre']['creditcdf'],''); array_push($_SESSION['grandlivre']['solde1'],''); array_push($_SESSION['grandlivre']['devise'],''); array_push($_SESSION['grandlivre']['cours'],''); array_push($_SESSION['grandlivre']['debitusd'],''); array_push($_SESSION['grandlivre']['creditusd'],''); array_push($_SESSION['grandlivre']['solde1'],''); array_push($_SESSION['grandlivre']['afficher'],'1'); array_push($_SESSION['grandlivre']['compte'],''); array_push($_SESSION['grandlivre']['date'],'Cumul antérieur'); array_push($_SESSION['grandlivre']['reference'],''); array_push($_SESSION['grandlivre']['libelle'],''); array_push($_SESSION['grandlivre']['debitcdf'],$debitcdf); array_push($_SESSION['grandlivre']['creditcdf'],$creditcdf); array_push($_SESSION['grandlivre']['solde1'],$solde1); array_push($_SESSION['grandlivre']['devise'],''); array_push($_SESSION['grandlivre']['cours'],''); array_push($_SESSION['grandlivre']['debitusd'],$debitusd); array_push($_SESSION['grandlivre']['creditusd'],$creditusd); array_push($_SESSION['grandlivre']['solde2'],$solde2); foreach ($result as $rows) { $data=INFOSFromAccountNumber($rows->compte_ecriture,$rows->long_compte,$bdd); $libcompte=$data['lib']; $numero=$rows->compte_ecriture; $debitcdf=0; $debitcdftxt=''; if($rows->debit>0){ $debitcdf=arrondir(montant_equivalent_bdd($rows->devise,$devisecdf,$rows->taux,$rows->debit)); $stotdebitcdf=$stotdebitcdf+$debitcdf; } $creditcdf=0; $creditcdftxt=''; if($rows->credit>0){ $creditcdf=arrondir(montant_equivalent_bdd($rows->devise,$devisecdf,$rows->taux,$rows->credit)); $stotcreditcdf=$stotcreditcdf+$creditcdf; } $debitusd=0; $debitusdtxt=''; if($rows->debit>0){ $debitusd=arrondir(montant_equivalent_bdd($rows->devise,$deviseusd,$rows->taux,$rows->debit)); $stotdebitusd=$stotdebitusd+$debitusd; } $creditusd=0; $creditusdtxt=''; if($rows->credit>0){ $creditusd=arrondir(montant_equivalent_bdd($rows->devise,$deviseusd,$rows->taux,$rows->credit)); $stotcreditusd=$stotcreditusd+$creditusd; } $solde1=$debitcdf-$creditcdf; $solde2=$debitusd-$creditusd; array_push($_SESSION['grandlivre']['afficher'],'0'); array_push($_SESSION['grandlivre']['compte'],''); array_push($_SESSION['grandlivre']['date'],dateAffiche($rows->dte)); array_push($_SESSION['grandlivre']['reference'],$rows->reference); array_push($_SESSION['grandlivre']['libelle'],ucfirst($rows->descriptjourn)); array_push($_SESSION['grandlivre']['debitcdf'],$debitcdftxt); array_push($_SESSION['grandlivre']['creditcdf'],$creditcdftxt); array_push($_SESSION['grandlivre']['solde1'],$solde1); array_push($_SESSION['grandlivre']['devise'],$devise); array_push($_SESSION['grandlivre']['cours'],$rows->taux); array_push($_SESSION['grandlivre']['debitusd'],$debitusdtxt); array_push($_SESSION['grandlivre']['creditusd'],$creditusdtxt); array_push($_SESSION['grandlivre']['solde2'],$solde2); } if($stotdebitcdf!=0&&$stotcreditcdf!=0&&$stotdebitusd!=0&&$stotcreditusd!=0){ array_push($_SESSION['grandlivre']['afficher'],'0'); array_push($_SESSION['grandlivre']['compte'],''); array_push($_SESSION['grandlivre']['date'],'Sous total'); array_push($_SESSION['grandlivre']['reference'],''); array_push($_SESSION['grandlivre']['libelle'],''); array_push($_SESSION['grandlivre']['debitcdf'],$stotdebitcdf); array_push($_SESSION['grandlivre']['creditcdf'],$stotcreditcdf); array_push($_SESSION['grandlivre']['solde1'],$stotsolde1); array_push($_SESSION['grandlivre']['compte'],''); array_push($_SESSION['grandlivre']['devise'],''); array_push($_SESSION['grandlivre']['cours'],''); array_push($_SESSION['grandlivre']['debitusd'],$stotdebitusd); array_push($_SESSION['grandlivre']['creditusd'],$stotcreditusd); array_push($_SESSION['grandlivre']['solde2'],$stotsolde2); } $totdebitcdf=$totdebitcdf+$stotdebitcdf; $totcreditcdf=$totcreditcdf+$stotcreditcdf; $totdebitusd=$totdebitusd+$stotdebitusd; $totcreditusd=$totcreditusd+$stotcreditusd; $totsolde1=$totsolde1+$stotsolde1; $totsolde2=$totsolde2+$stotsolde2; } } $_SESSION['totdebitcdf']=$totdebitcdf; $_SESSION['totcreditcdf']=$totcreditcdf; $_SESSION['totdebitusd']=$totdebitusd; $_SESSION['totcreditusd']=$totcreditusd; $_SESSION['totsolde1']=$totsolde1; $_SESSION['totsolde2']=$totsolde2; ?>
Date Ref. Libellé Débit Crédit Solde Dévise Cours Débit Crédit Solde
TOTAL