Task #0002327: Balance : indiqué si le solde est correct débit / crédit

This commit is contained in:
Dany wm 2024-01-14 22:32:17 +01:00
parent 0db402bd52
commit 014574b18c
4 changed files with 30 additions and 3 deletions

View file

@ -437,8 +437,21 @@ if ( isset($_GET['view'] ) )
echo '<TR class="'.$tr.'">';
echo td($view_history);
echo td(h($r['label']));
// label + warning if the saldo is incorrect
$label=$r['label'];
if (in_array($r['type'],array('CHA','ACT','PASINV','PROINV')) && $r['sum_deb']<$r['sum_cred'])
{
$label.=" ".Icon_Action::warnbulle(85);
}
if (in_array($r['type'],array('PRO','PAS','ACTINV','CHAINV')) && $r['sum_deb']>$r['sum_cred'])
{
$label.=" ".Icon_Action::warnbulle(86);
}
print '<td>';
print $label;
print '</td>';
if ($previous == 1 ) {
echo td(nbm($r['sum_deb_previous']),' class="previous_year"');
echo td(nbm($r['sum_cred_previous']),' class="previous_year" ');

View file

@ -231,6 +231,7 @@ class Acc_Balance
$a['poste']=$r['poste'];
$a['label']=mb_substr($poste->get_lib(),0,40);
$a['type']=$poste->get_parameter("pcm_type");
$a['sum_deb']=round($r['sum_deb'],2);
$a['sum_cred']=round($r['sum_cred'],2);
$a['solde_deb']=round(( $a['sum_deb'] >= $a['sum_cred'] )? $a['sum_deb']- $a['sum_cred']:0,2);

View file

@ -212,7 +212,18 @@ if (!empty($array)) {
$fill=$pdf->is_fill($i);
$pdf->LongLine(30, 6, $value['poste'], 0, 'L', $fill);
$label=$value['poste'];
if (in_array($r['type'],array('CHA','ACT','PASINV','PROINV')) && $value['sum_deb']<$value['sum_cred'])
{
$label.=" ".mb_chr(0x26a0);
}
if (in_array($r['type'],array('PRO','PAS','ACTINV','CHAINV')) && $value['sum_deb']>$value['sum_cred'])
{
$label.=" ".mb_chr(0x26a0);
}
$pdf->LongLine(30, 6, $label, 0, 'L', $fill);
$pdf->LongLine(60, 6, $value['label'], 0, 'L', $fill);
$summary_tab = $bal->summary_add($summary_tab, $value['poste'],
$value['sum_deb'],

View file

@ -118,4 +118,6 @@ content[81]="<?php echo htmlspecialchars(_("Recommendé d'avoir un poste propre"
content[82]="<?php echo htmlspecialchars(_("valeur en % "),ENT_QUOTES)?>";
content[83]="<?php echo htmlspecialchars(_("Données invalides "),ENT_QUOTES)?>";
content[84]="<?php echo htmlspecialchars(_("En Belgique, l'exercice commence par un report des comptes de 0 à 5, mais pas en France, ce solde est calculé depuis le tout premier exercice"),ENT_QUOTES)?>";
content[85]="<?php echo htmlspecialchars(_("Solde créditeur au lieu de débiteur"),ENT_QUOTES)?>";
content[86]="<?php echo htmlspecialchars(_("Solde débiteur au lieu de créditeur"),ENT_QUOTES)?>";
</script>