diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c8fb3804e60..7adc13d3724 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -648,12 +648,13 @@ if (empty($reshook)) if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION) { // If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT - $sql = 'SELECT SUM(pf.amount) as total_paiements FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p - WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms'; + WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; $resql = $db->query($sql); + if (! $resql) dol_print_error($db); + $res = $db->fetch_object($resql); $total_paiements = $res->total_paiements; @@ -4103,11 +4104,11 @@ else if ($id > 0 || ! empty($ref)) if ($objectidnext) { print '
' . $langs->trans('DoPayment') . '
'; } else { - if ($resteapayer == 0) { - print '
' . $langs->trans('DoPayment') . '
'; - } else { + //if ($resteapayer == 0) { + // print '
' . $langs->trans('DoPayment') . '
'; + //} else { print '
' . $langs->trans('DoPayment') . '
'; - } + //} } } diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 913ff439ecc..55741543d25 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -107,7 +107,7 @@ SendRemindByMail=Envoyer rappel DoPayment=Saisir réglement DoPaymentBack=Saisir remboursement ConvertToReduc=Convertir en réduction future -ConvertExcessReceivedToReduc=Le trop-perçu a été converti en réduction future +ConvertExcessReceivedToReduc=Convertir le trop-perçu en réduction future EnterPaymentReceivedFromCustomer=Saisie d'un règlement reçu du client EnterPaymentDueToCustomer=Saisie d'un remboursement d'un avoir client DisabledBecauseRemainderToPayIsZero=Désactivé car reste à payer est nul