This commit is contained in:
Laurent Destailleur 2019-12-17 13:56:32 +01:00
parent e7e02f7db7
commit af4288ff3f

View File

@ -139,8 +139,14 @@ if (empty($reshook))
{ {
$cursorfacid = substr($key, 7); $cursorfacid = substr($key, 7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key))); $amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$totalpayment = $totalpayment + $amounts[$cursorfacid]; if (!empty($amounts[$cursorfacid])) {
if (!empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++; $atleastonepaymentnotnull++;
if (is_numeric($amounts[$cursorfacid])) {
$totalpayment = $totalpayment + $amounts[$cursorfacid];
} else {
setEventMessages($langs->transnoentities("InputValueIsNotAnNumber", GETPOST($key)), null, 'warnings');
}
}
$result = $tmpinvoice->fetch($cursorfacid); $result = $tmpinvoice->fetch($cursorfacid);
if ($result <= 0) dol_print_error($db); if ($result <= 0) dol_print_error($db);
$amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement()); $amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());