341 |
$r.="<th>Op. Concernée</th>"; |
$r.="<th>Op. Concernée</th>"; |
342 |
$r.="<th>Document</th>"; |
$r.="<th>Document</th>"; |
343 |
$r.="</tr>"; |
$r.="</tr>"; |
|
// Get the jrn type |
|
344 |
|
|
|
$jrn_prop=($p_jrn == 0 )?0:$jrn_prop=GetJrnProp($p_cn,$p_jrn,1); |
|
345 |
for ($i=0; $i < $Max;$i++) { |
for ($i=0; $i < $Max;$i++) { |
346 |
$row=pg_fetch_array($Res,$i); |
$row=pg_fetch_array($Res,$i); |
347 |
|
|
371 |
// Amount |
// Amount |
372 |
// If the ledger is financial : |
// If the ledger is financial : |
373 |
// the credit must be negative and written in red |
// the credit must be negative and written in red |
374 |
|
// Get the jrn type |
375 |
|
$jrn_prop=GetJrnProp($p_cn,$row['jrn_def_id'],1); |
376 |
$positive=0; |
$positive=0; |
377 |
if ( $p_jrn !=0 && $jrn_prop['jrn_def_type'] == 'FIN' ) { |
if ( $jrn_prop['jrn_def_type'] == 'FIN' ) { |
378 |
$positive = CountSql($p_cn,"select * from jrn inner join jrnx on jr_grpt_id=j_grpt ". |
$positive = CountSql($p_cn,"select * from jrn inner join jrnx on jr_grpt_id=j_grpt ". |
379 |
" where jr_id=".$row['jr_id']." and (j_poste like '55%' or j_poste like '57%' )". |
" where jr_id=".$row['jr_id']." and (j_poste like '55%' or j_poste like '57%' )". |
380 |
" and j_debit='f'"); |
" and j_debit='f'"); |