diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d1bf69a8eee27c18ecfbfdd43cc294a138775d3f..d4c256dfbf23638135b50bf66a5dcca42a5279e1 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -51,7 +51,7 @@ if ($action == "confirm_update") { $error = 0; - if ((intval($debit) != 0) && (intval($credit) != 0)) { + if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) { setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); $error ++; } @@ -69,11 +69,11 @@ if ($action == "confirm_update") { $book->debit = $debit; $book->credit = $credit; - if (! empty($debit)) { + if (floatval($debit)!=0.0) { $book->montant = $debit; $book->sens = 'D'; } - if (! empty($credit)) { + if (floatval($credit)!=0.0) { $book->montant = $credit; $book->sens = 'C'; } @@ -372,4 +372,4 @@ if ($action == 'create') { } llxFooter(); -$db->close(); \ No newline at end of file +$db->close();