diff --git a/include/user_common.php b/include/user_common.php index d063c74d6..cd043e722 100644 --- a/include/user_common.php +++ b/include/user_common.php @@ -341,9 +341,7 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) $r.="Op. Concernée"; $r.="Document"; $r.=""; - // Get the jrn type - $jrn_prop=($p_jrn == 0 )?0:$jrn_prop=GetJrnProp($p_cn,$p_jrn,1); for ($i=0; $i < $Max;$i++) { $row=pg_fetch_array($Res,$i); @@ -373,8 +371,10 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) // Amount // If the ledger is financial : // the credit must be negative and written in red + // Get the jrn type + $jrn_prop=GetJrnProp($p_cn,$row['jrn_def_id'],1); $positive=0; - if ( $p_jrn !=0 && $jrn_prop['jrn_def_type'] == 'FIN' ) { + if ( $jrn_prop['jrn_def_type'] == 'FIN' ) { $positive = CountSql($p_cn,"select * from jrn inner join jrnx on jr_grpt_id=j_grpt ". " where jr_id=".$row['jr_id']." and (j_poste like '55%' or j_poste like '57%' )". " and j_debit='f'");