Fix for non-numeric value in payment

This commit is contained in:
Sekan, Tobias 2020-08-24 14:53:34 +02:00
parent 3281d5ec17
commit 4c887d6110

View File

@ -129,7 +129,8 @@ if (empty($reshook))
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0; $paiement_id = 0;
$totalpayment = 0; $totalpayment = 0;
$atleastonepaymentnotnull = 0; $atleastonepaymentnotnull = 0;
$multicurrency_totalpayment = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date // Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice = new FactureFournisseur($db); $tmpinvoice = new FactureFournisseur($db);
@ -171,7 +172,7 @@ if (empty($reshook))
} elseif (substr($key, 0, 21) == 'multicurrency_amount_') } elseif (substr($key, 0, 21) == 'multicurrency_amount_')
{ {
$cursorfacid = substr($key, 21); $cursorfacid = substr($key, 21);
$multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key))); $multicurrency_amounts[$cursorfacid] = GETPOST($key) ? price2num(trim(GETPOST($key))) : 0;
$multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid]; $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++; if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result = $tmpinvoice->fetch($cursorfacid); $result = $tmpinvoice->fetch($cursorfacid);