Task 3273 : Change the look
This commit is contained in:
parent
1f21da1f4b
commit
b65bcc22e2
2 changed files with 19 additions and 6 deletions
|
|
@ -543,9 +543,13 @@ function GetJrnProperty($p_cn,$p_jrn)
|
|||
* - an array containing properties
|
||||
*
|
||||
*/
|
||||
function GetJrnProp($p_dossier,$p_jrn)
|
||||
function GetJrnProp($p_dossier,$p_jrn,$is_connected=0)
|
||||
{
|
||||
$cn=DbConnect($p_dossier);
|
||||
if ( $is_connected == 0 )
|
||||
$cn=DbConnect($p_dossier);
|
||||
else
|
||||
$cn=$p_dossier;
|
||||
|
||||
$Res=ExecSql($cn,"select jrn_Def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_def_type,
|
||||
jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code,
|
||||
jrn_def_fiche_deb,jrn_def_fiche_deb
|
||||
|
|
|
|||
|
|
@ -341,7 +341,9 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null)
|
|||
$r.="<th>Op. Concernée</th>";
|
||||
$r.="<th>Document</th>";
|
||||
$r.="</tr>";
|
||||
|
||||
// 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);
|
||||
|
||||
|
|
@ -369,8 +371,16 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null)
|
|||
$r.="</TD>";
|
||||
|
||||
// Amount
|
||||
$r.="<TD>";
|
||||
$r.=$row['jr_montant'];
|
||||
// If the ledger is financial :
|
||||
// the credit must be negative and written in red
|
||||
$positive=0;
|
||||
if ( $p_jrn !=0 && $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'");
|
||||
}
|
||||
$r.="<TD align=\"right\">";
|
||||
$r.=( $positive != 0 )?"<font color=\"red\"> - ".sprintf("%8.2f",$row['jr_montant'])."</font>":sprintf("%8.2f",$row['jr_montant']);
|
||||
$r.="</TD>";
|
||||
|
||||
// Rapt
|
||||
|
|
@ -691,4 +701,3 @@ function isValid ($p_cn,$p_grpt_id) {
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue