25if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
31echo
'<div class="content">';
32$sql_year=
" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice().
"')";
33echo
'<div class="myfieldset"><h1 class="legend">'._(
'Vérification des journaux').
'</h1>';
37 select sum (j_montant) as amount,j_debit , jr_def_id
38 from jrnx join jrn on (j_grpt=jr_grpt_id)
43 group by jr_def_id,j_debit
46 select sum (j_montant) as amount,j_debit , jr_def_id
47 from jrnx join jrn on (j_grpt=jr_grpt_id)
52 group by jr_def_id,j_debit
57 jcredit.amount as cred
59join jdebit on (Jdebit.jr_def_id=jrn_def.jrn_def_id)
60join jcredit on (jcredit.jr_def_id=jrn_def.jrn_def_id)
61where jcredit.amount<>jdebit.amount
69 echo
$g_succeed.
" "._(
"Aucune anomalie dans les montants des journaux");
71echo
'<table class="result">';
72echo
tr(
th(_(
'Journal')).
th(_(
'Débit'),
' style="display:right"').
th(_(
"Crédit"),
' style="display:right"').
th(_(
"Différence"),
' style="display:right"').
th(
''));
89$deb=
$cn->get_value(
"select sum (j_montant) from jrnx where j_debit='t' and $sql_year ");
90$cred=
$cn->get_value(
"select sum (j_montant) from jrnx where j_debit='f' and $sql_year ");
107echo
'<div class="myfieldset"><h1 class="legend">'._(
'Vérification des comptes').
'</h1>';
117 $first_periode=
$cn->get_value(
"select to_char(p_start,'YYYY-MM-DD') from parm_periode order by p_start limit 1");
125<div
class=
"myfieldset">
127 <?php echo _(
"Vérification des fiches").
'</legend>';?>
130 <?php echo _(
'Fiches ayant changé de poste comptable');?>
133 $sql_year_target=
" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice().
"')";
136 select count(*),f_id from (
149 $sql_poste=
"select distinct j_poste,pcm_lib from jrnx join tmp_pcmn on (pcm_val=j_poste) where f_id =$1 and $sql_year";
150 $sql_qcode=
"select ad_value as qcode from fiche_detail where f_id=$1 and ad_id=".ATTR_DEF_QUICKCODE;
154 echo
"ERREUR ".__FILE__.
":".__LINE__.
"prepare failed";
157 if (count(
$a_fiche_id) == 0) { echo
" OK $g_succeed";}
else { echo
" "._(
'Attention ').$g_failed;}
196 <
h2><?php echo _(
'Poste comptable utilisé sans la fiche correspondante') ?></
h2>
198 <?php echo _(
'Cela pourrait causer des différences entre les balances par fiches et celle par postes comptables, utilisez le plugin
199 "OUTIL COMPTABLE" pour corriger');
205 select distinct vw.f_id,j_poste ,vw_name,quick_code
206 from vw_poste_qcode as vw
207 join jrnx using (j_poste)
208 join vw_fiche_attr as v_attr on (vw.f_id=v_attr.f_id)
209 join jrn on (jrnx.j_grpt=jrn.jr_grpt_id)
211 jrnx.f_id is null and $sql_year order by 1
215 from vw_poste_qcode as vw
216 join jrnx using (j_poste)
217 join jrn on (jrnx.j_grpt=jrn.jr_grpt_id)
219 jrnx.f_id is null and vw.f_id= $1 and $sql_year";
230 <?php
for (
$i=0;$i<$nb_account_used;$i++): ?>
233 echo _(
'Poste comptable ').$a_account_used[
$i][
'j_poste']._(
' pour la fiche ').$a_account_used[
$i][
'quick_code'].
" ".
$a_account_used[
$i][
'vw_name'];
241 <
table class=
"result">
242 <?php
for ($x=0;$x<$nb_operation;$x++):?>
format_date($p_date, $p_from_format='YYYY-MM-DD', $p_to_format='DD.MM.YYYY')
format the date, when taken from the database the format is MM-DD-YYYY
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
h1($p_string, $p_class="")
tr($p_string, $p_extra='')
td($p_string='', $p_extra='')
surround the string with td
nbm($p_number, $p_dec=2)
format the number with a sep.
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
this class handle the different bilan, from the table bilan, parse the form and replace in the templa...
static fetch_all($ret)
wrapper for the function pg_fetch_all
For the periode tables parm_periode and jrn_periode.
for($i=0;$i< $nb_jrn;$i++) $deb
if( $nb_account_used==0) $ret