Merge pull request #14540 from TobiasSekan/FixSingelPaymentWithMulticurrency

FIX non-numeric value on multicurrency payment (part 1)
This commit is contained in:
Laurent Destailleur 2020-08-28 21:17:32 +02:00 committed by GitHub
commit 144cc52b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,8 @@ if (empty($reshook))
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 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
$tmpinvoice = new FactureFournisseur($db);
@ -171,7 +172,7 @@ if (empty($reshook))
} elseif (substr($key, 0, 21) == 'multicurrency_amount_')
{
$cursorfacid = substr($key, 21);
$multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$multicurrency_amounts[$cursorfacid] = (GETPOST($key) ? price2num(GETPOST($key)) : 0);
$multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result = $tmpinvoice->fetch($cursorfacid);