diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 36a76fe6a45..ac194eab6ae 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -764,7 +764,7 @@ else
print "
| Total : | ".price($total)." | $_MONNAIE |
\n";
print "| Facturé : | ".price($fac->total_ttc)." | $_MONNAIE |
\n";
- $resteapayer = abs($fac->total_ttc - $total);
+ $resteapayer = $fac->total_ttc - $total;
print "| Reste à payer : | ";
print "".price($resteapayer)." | $_MONNAIE |
\n";
@@ -974,7 +974,7 @@ else
}
// Envoyer
- if ($fac->statut == 1 && abs($resteapayer) > 0 && $user->rights->facture->envoyer)
+ if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->envoyer)
{
print "id&action=presend\">Envoyer";
}
@@ -992,7 +992,7 @@ else
}
// Classer 'payé'
- if ($fac->statut == 1 && abs($resteapayer) == 0
+ if ($fac->statut == 1 && $resteapayer <= 0
&& $fac->paye == 0 && $user->rights->facture->paiement)
{
print "id&action=payed\">Classer 'Payée'";