noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 03/04: Task #1042 - Amélioration VERIFBIL VE


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/04: Task #1042 - Amélioration VERIFBIL VERIFBIL : ajout des postes sans fiches
Date: Sat, 15 Nov 2014 17:46:54 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 57af7542d5c4c5eb508798036757e9e77545f8e6
Author: Dany De Bontridder <address@hidden>
Date:   Sat Nov 15 18:44:26 2014 +0100

    Task #1042 - Amélioration VERIFBIL
    VERIFBIL : ajout des postes sans fiches
---
 include/verif_bilan.inc.php |  124 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 98 insertions(+), 26 deletions(-)

diff --git a/include/verif_bilan.inc.php b/include/verif_bilan.inc.php
index f45a6cf..a411072 100644
--- a/include/verif_bilan.inc.php
+++ b/include/verif_bilan.inc.php
@@ -34,25 +34,14 @@ $exercice=$g_user->get_exercice();
 echo '<div class="content">';
 
 $sql_year=" and j_tech_per in (select p_id from parm_periode where 
p_exercice='".$g_user->get_exercice()."')";
-echo '<fieldset><legend>'._('Vérification des journaux').'</legend>';
-echo '<ol>';
-$deb=$cn->get_value("select sum (j_montant) from jrnx where j_debit='t' 
$sql_year ");
-$cred=$cn->get_value("select sum (j_montant) from jrnx where j_debit='f' 
$sql_year ");
-
-if ( $cred == $deb )
-{
-    $result =$g_succeed;
-}
-else
-{
-    $result = $g_failed;
-}
-
-printf ('<li>'._("Solde Grand Livre : debit %f credit %f 
%s").'</li>',$deb,$cred,$result);
+echo '<div class="fieldset"><h1 class="legend">'._('Vérification des 
journaux').'</h1>';
 
 $sql="select jrn_def_id,jrn_def_name from jrn_def";
 $res=$cn->exec_sql($sql);
 $jrn=Database::fetch_all($res);
+echo '<table class="result">';
+echo tr(th(_('Journal')).th(_('Débit'),' 
style="display:right"').th(_("Crédit"),' 
style="display:right"').th(_("Différence"),' style="display:right"').th(''));
+$ix=0;
 foreach ($jrn as $l)
 {
     $id=$l['jrn_def_id'];
@@ -68,30 +57,46 @@ else
 {
     $result = $g_failed;
 }
+    $class=($ix%2==0)?'odd':"even";
+    print 
tr(td($name).td(nbm($deb),'class="num"').td(nbm($cred),'class="num"').td(nbm($result),'class="num"').td($result),"class=\"$class\"");
+    $ix++;
 
-    printf ('<li>'._("Journal %s Solde   : debit %f credit %f 
%s").'</li>',$name,$deb,$cred,$result);
+}
+
+$deb=$cn->get_value("select sum (j_montant) from jrnx where j_debit='t' 
$sql_year ");
+$cred=$cn->get_value("select sum (j_montant) from jrnx where j_debit='f' 
$sql_year ");
 
+if ( $cred == $deb )
+{
+    $result =$g_succeed;
+}
+else
+{
+    $result = $g_failed;
 }
-echo '</ol>';
+$class=($ix%2==0)?'odd':"even";
+print tr(td(_('Grand livre')).td(nbm($deb),' class="num"').td(nbm($cred),' 
class="num"').td(nbm($result),' class="num"')
+        .td($result),"class=\"$class\"");
 
-echo '</fieldset>';
-echo '<fieldset><legend>'._('Vérification des comptes').'</legend>';
+echo '</table>';
+echo '</div>';
+echo '<hr>';
+echo '<div class="fieldset"><h1 class="legend">'._('Vérification des 
comptes').'</h1>';
 $bilan=new Acc_Bilan($cn);
 $periode=new Periode($cn);
 list ($start_periode,$end_periode)=$periode->get_limit($exercice);
 $bilan->from=$start_periode->p_id;
 $bilan->to=$end_periode->p_id;
 $bilan->verify();
-echo '</fieldset>';
 echo '</div>';
 ?>
 <hr>
-<fieldset>
-    <legend>
-        <?php echo _("Vérification fiche").'</legend>';?>
-    </legend>
+<div class="fieldset">
+    <h1 class="legend">
+        <?php echo _("Vérification des fiches").'</legend>';?>
+    </h1>
     <h2>
-        <?php echo _('Fiche avec plusieurs postes comptables');?>
+        <?php echo _('Fiches ayant changé de poste comptable');?>
     </h2>
     <?php
     $sql_year_target=" target.j_tech_per in (select p_id from parm_periode 
where p_exercice='".$g_user->get_exercice()."')";
@@ -108,6 +113,8 @@ echo '</div>';
     $sql_poste="select distinct j_poste,pcm_lib from jrnx join tmp_pcmn on 
(pcm_val=j_poste) where j_qcode =$1 $sql_year";
     $a_qcode=$cn->get_array($sql_qcode);
     $res=$cn->prepare('get_poste',$sql_poste);
+    echo _("Résultat");
+    if (count($a_qcode) == 0) { echo " OK $g_succeed";}  else { echo " 
"._('Attention ').$g_failed;}
     ?>
     <ol>
     <?php
@@ -138,4 +145,69 @@ echo '</div>';
     endfor;
     ?>
     </ol>
-</fieldset>
+  
+    <h2><?php echo _('Poste comptable utilisé sans la fiche correspondante') 
?></h2>
+<p class="notice">
+        <?php echo _('Cela va amener des différences entre les balances par 
fiches et par postes comptables, utilisez le plugin 
+         "OUTIL COMPTABLE" pour corriger');
+        ?>
+</p>
+
+<?php
+$sql_account_used="
+    select distinct vw.f_id,j_poste ,vw_name,quick_code
+    from vw_poste_qcode as vw 
+    join jrnx using (j_poste) 
+    join vw_fiche_attr as v_attr on (vw.f_id=v_attr.f_id)
+    join jrn on (jrnx.j_grpt=jrn.jr_grpt_id) 
+    where 
+        jrnx.f_id is null  $sql_year order by 1
+";
+       
+$sql_concerned_operation="select 
vw.f_id,jrnx.j_date,jrnx.j_id,jrn.jr_id,jrnx.j_poste,jr_internal ,jr_comment
+    from vw_poste_qcode as vw 
+    join jrnx using (j_poste) 
+    join jrn on (jrnx.j_grpt=jrn.jr_grpt_id) 
+    where 
+    jrnx.f_id is null and vw.f_id= $1 $sql_year";
+$a_account_used=$cn->get_array($sql_account_used);
+$nb_account_used=count ($a_account_used);
+    if ( $nb_account_used == 0 ) 
+    {
+        echo _('Résultat')." ".$g_succeed;
+    }
+    $ret=$cn->prepare('get_operation',$sql_concerned_operation);
+    
+?>
+    
+        <?php for ($i=0;$i<$nb_account_used;$i++): ?>
+        <h3>
+            <?php 
+                echo _('Poste comptable ').$a_account_used[$i]['j_poste']._(' 
pour la fiche ').$a_account_used[$i]['quick_code']." 
".$a_account_used[$i]['vw_name'];
+            ?>
+        </h3>
+        <?php
+            
$ret_operation=$cn->execute('get_operation',array($a_account_used[$i]['f_id']));
+                 $a_operation=Database::fetch_all($ret_operation); 
+                 $nb_operation=count($a_operation);
+        ?>
+        <table class="result">
+            <?php for ($x=0;$x<$nb_operation;$x++):?>
+        <tr>
+            <td>
+                <?php echo $a_operation[$x]['j_date']; ?>
+            </td>
+            <td>
+                <?php echo h($a_operation[$x]['jr_comment']); ?>
+            </td>
+            <td>
+                <?php echo 
HtmlInput::detail_op($a_operation[$x]['jr_id'],$a_operation[$x]['jr_internal']);
 ?>
+            </td>
+            <td>
+              
+            </td>
+        </tr>
+        <?php endfor;?>
+        </table>
+    <?php endfor;?>
+</div>
\ No newline at end of file



reply via email to

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