get_exercice(); echo '
'; $sql_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')"; echo '

'._('Vérification des journaux').'

'; $sql="select jrn_def_id,jrn_def_name from jrn_def"; $res=$cn->exec_sql($sql); $jrn=Database::fetch_all($res); echo ''; 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']; $name=$l['jrn_def_name']; $deb=$cn->get_value("select sum (j_montant) from jrnx where j_debit='t' and j_jrn_def=$id $sql_year "); $cred=$cn->get_value("select sum (j_montant) from jrnx where j_debit='f' and j_jrn_def=$id $sql_year "); if ( $cred == $deb ) { $result =$g_succeed; } 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++; } $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; } $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 '
'; echo '
'; echo '
'; echo '

'._('Vérification des comptes').'

'; $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 '
'; ?>

';?>

get_exercice()."')"; $sql_year_source=" source.j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')"; $sql_qcode="select distinct source.f_id,source.j_qcode from jrnx as source ,jrnx as target where source.j_id < target.j_id and source.j_poste<>target.j_poste and source.j_qcode = target.j_qcode and $sql_year_source and $sql_year_target "; $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;} ?>
    execute('get_poste',array($a_qcode[$i]['j_qcode'])); ?>

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); ?>

execute('get_operation',array($a_account_used[$i]['f_id'])); $a_operation=Database::fetch_all($ret_operation); $nb_operation=count($a_operation); ?>