noalyss Version-9
Variables
verif_bilan.inc.php File Reference

Verify the saldo of ledger: independant file. More...

Go to the source code of this file.

Variables

 $a_account_used =$cn->get_array($sql_account_used)
 
 $a_fiche_id =$cn->get_array($sql_fiche_id)
 
 $a_operation =Database::fetch_all($ret_operation)
 
 $all_dep =Database::fetch_all($poste)
 
 $bilan =new Acc_Bilan($cn)
 
 $class =($ix%2==0)?'odd':"even"
 
 $cn =Dossier::connect()
 
 $cred =$cn->get_value("select sum (j_montant) from jrnx where j_debit='f' and $sql_year ")
 
for($i=0;$i< $nb_jrn;$i++) $deb =$cn->get_value("select sum (j_montant) from jrnx where j_debit='t' and $sql_year ")
 
 $exercice =$g_user->get_exercice()
 
global $g_failed
 
global $g_parameter
 
global $g_succeed
 
 $ix =0
 
 $jrn =Database::fetch_all($res)
 
 $nb_account_used =count ($a_account_used)
 
 $nb_dep = ($all_dep == FALSE ) ? 0 :count($all_dep)
 
 $nb_jrn = ($jrn == FALSE) ?0 :count($jrn)
 
 $nb_operation =($a_operation == FALSE) ? 0 : count($a_operation)
 
 $periode =new Periode($cn)
 
 $qcode =Database::fetch_all($tmp_qcode)
 
 $res =$cn->exec_sql($sql)
 
 $resQcode =$cn->prepare('get_qcode',$sql_qcode)
 
if( $nb_account_used==0) $ret =$cn->prepare('get_operation',$sql_concerned_operation)
 
 $ret_operation =$cn->execute('get_operation',array($a_account_used[$i]['f_id']))
 
 $sql
 
 $sql_account_used
 
 $sql_concerned_operation
 
 $sql_fiche_id
 
 $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"
 
 $sql_qcode ="select ad_value as qcode from fiche_detail where f_id=$1 and ad_id=".ATTR_DEF_QUICKCODE
 
 $sql_year =" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')"
 
 $sql_year_target =" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')"
 
 $tmp_qcode =$cn->execute('get_qcode',array($a_fiche_id[$i]['f_id']))
 
if( $cred==$deb) else
 
 endfor
 
 for ( $x=0; $x< $nb_operation; $x++)
 
$bilan from =format_date($first_periode,'YYYY-MM-DD','DD.MM.YYYY')
 
 if ($jrn===false)
 
 if ($qcode==FALSE||$qcode[0][ 'qcode']=="")
 
$bilan to =$end_periode->last_day()
 

Detailed Description

Verify the saldo of ledger: independant file.

Definition in file verif_bilan.inc.php.

Variable Documentation

◆ $a_account_used

$a_account_used =$cn->get_array($sql_account_used)

Definition at line 220 of file verif_bilan.inc.php.

◆ $a_fiche_id

$a_fiche_id =$cn->get_array($sql_fiche_id)

Definition at line 147 of file verif_bilan.inc.php.

◆ $a_operation

$a_operation =Database::fetch_all($ret_operation)

Definition at line 238 of file verif_bilan.inc.php.

◆ $all_dep

$all_dep =Database::fetch_all($poste)

Definition at line 179 of file verif_bilan.inc.php.

◆ $bilan

$bilan =new Acc_Bilan($cn)

Definition at line 108 of file verif_bilan.inc.php.

◆ $class

$class =($ix%2==0)?'odd':"even"

Definition at line 100 of file verif_bilan.inc.php.

◆ $cn

Definition at line 29 of file verif_bilan.inc.php.

◆ $cred

$cred =$cn->get_value("select sum (j_montant) from jrnx where j_debit='f' and $sql_year ")

◆ $deb

for ( $i=0; $i< $nb_jrn; $i++) $deb ( ) =$cn->get_value("select sum (j_montant) from jrnx where j_debit='t' and $sql_year ")

◆ $exercice

$exercice =$g_user->get_exercice()

Definition at line 30 of file verif_bilan.inc.php.

◆ $g_failed

global $g_failed

Definition at line 28 of file verif_bilan.inc.php.

◆ $g_parameter

global $g_parameter

Definition at line 111 of file verif_bilan.inc.php.

◆ $g_succeed

global $g_succeed

Definition at line 28 of file verif_bilan.inc.php.

◆ $ix

$ix =0

Definition at line 74 of file verif_bilan.inc.php.

◆ $jrn

Definition at line 65 of file verif_bilan.inc.php.

◆ $nb_account_used

$nb_account_used =count ($a_account_used)

Definition at line 221 of file verif_bilan.inc.php.

◆ $nb_dep

$nb_dep = ($all_dep == FALSE ) ? 0 :count($all_dep)

Definition at line 180 of file verif_bilan.inc.php.

Referenced by Extension\insert_profile_menu().

◆ $nb_jrn

$nb_jrn = ($jrn == FALSE) ?0 :count($jrn)

Definition at line 67 of file verif_bilan.inc.php.

Referenced by Print_Ledger\available_ledger().

◆ $nb_operation

$nb_operation =($a_operation == FALSE) ? 0 : count($a_operation)

◆ $periode

$periode =new Periode($cn)

Definition at line 109 of file verif_bilan.inc.php.

◆ $qcode

$qcode =Database::fetch_all($tmp_qcode)

Definition at line 164 of file verif_bilan.inc.php.

◆ $res

$res =$cn->exec_sql($sql)

Definition at line 64 of file verif_bilan.inc.php.

◆ $resQcode

$resQcode =$cn->prepare('get_qcode',$sql_qcode)

Definition at line 152 of file verif_bilan.inc.php.

◆ $ret

if ($nb_account_used==0) $ret =$cn->prepare('get_operation',$sql_concerned_operation)

Definition at line 226 of file verif_bilan.inc.php.

◆ $ret_operation

$ret_operation =$cn->execute('get_operation',array($a_account_used[$i]['f_id']))

Definition at line 237 of file verif_bilan.inc.php.

◆ $sql

$sql
Initial value:
="
with jdebit as (
select sum (j_montant) as amount,j_debit , jr_def_id
from jrnx join jrn on (j_grpt=jr_grpt_id)
where
$sql_year
and
j_debit='t'
group by jr_def_id,j_debit
),
jcredit as (
select sum (j_montant) as amount,j_debit , jr_def_id
from jrnx join jrn on (j_grpt=jr_grpt_id)
where
$sql_year
and
j_debit='f'
group by jr_def_id,j_debit
)
select jrn_def_id,
jrn_def_name,
jdebit.amount as deb,
jcredit.amount as cred
from jrn_def
join jdebit on (Jdebit.jr_def_id=jrn_def.jrn_def_id)
join jcredit on (jcredit.jr_def_id=jrn_def.jrn_def_id)
where jcredit.amount<>jdebit.amount
order by jrn_def_name
"

Definition at line 35 of file verif_bilan.inc.php.

◆ $sql_account_used

$sql_account_used
Initial value:
="
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 and $sql_year order by 1
"

Definition at line 204 of file verif_bilan.inc.php.

◆ $sql_concerned_operation

$sql_concerned_operation
Initial value:
="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 and $sql_year"

Definition at line 214 of file verif_bilan.inc.php.

◆ $sql_fiche_id

$sql_fiche_id
Initial value:
="
select count(*),f_id from (
select distinct
f_id,j_poste
from jrnx
where
$sql_year_target
) as m
group by f_id
having count(*) > 1
"

Definition at line 135 of file verif_bilan.inc.php.

◆ $sql_poste

$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"

Definition at line 149 of file verif_bilan.inc.php.

◆ $sql_qcode

$sql_qcode ="select ad_value as qcode from fiche_detail where f_id=$1 and ad_id=".ATTR_DEF_QUICKCODE

Definition at line 150 of file verif_bilan.inc.php.

◆ $sql_year

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

Definition at line 32 of file verif_bilan.inc.php.

◆ $sql_year_target

$sql_year_target =" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')"

Definition at line 133 of file verif_bilan.inc.php.

◆ $tmp_qcode

$tmp_qcode =$cn->execute('get_qcode',array($a_fiche_id[$i]['f_id']))

Definition at line 163 of file verif_bilan.inc.php.

◆ else

if (count( $a_fiche_id)==0) else
Initial value:
{
global $g_failed

Definition at line 96 of file verif_bilan.inc.php.

◆ endfor

endfor

Definition at line 192 of file verif_bilan.inc.php.

◆ for

for($x=0;$x< $nb_operation;$x++) ( )

Definition at line 242 of file verif_bilan.inc.php.

◆ from

$bilan from =format_date($first_periode,'YYYY-MM-DD','DD.MM.YYYY')

Definition at line 118 of file verif_bilan.inc.php.

◆ if [1/2]

if( $res==false|| $resQcode==false) (   $jrn = ==false)

Definition at line 68 of file verif_bilan.inc.php.

◆ if [2/2]

if( $qcode==FALSE|| $qcode[0]['qcode']=="") (   $qcode = = FALSE || $qcode[0]['qcode']=="")

Definition at line 166 of file verif_bilan.inc.php.

◆ to

$bilan to =$end_periode->last_day()

Definition at line 119 of file verif_bilan.inc.php.