Fix warnings

This commit is contained in:
Laurent Destailleur 2022-02-10 13:16:51 +01:00
parent d2af490b33
commit c4c15fc105

View File

@ -56,19 +56,23 @@ $currentInvId = $_POST['imgClicked']; // from DOM elements : imgId (equals invoi
$amountPayment = $amountPayment != '' ? (is_numeric(price2num($amountPayment)) ? price2num($amountPayment) : '') : ''; // keep void if not a valid entry $amountPayment = $amountPayment != '' ? (is_numeric(price2num($amountPayment)) ? price2num($amountPayment) : '') : ''; // keep void if not a valid entry
// Clean checkamounts // Clean checkamounts
foreach ($amounts as $key => $value) { if (is_array($amounts)) {
$value = price2num($value); foreach ($amounts as $key => $value) {
$amounts[$key] = $value; $value = price2num($value);
if (empty($value)) { $amounts[$key] = $value;
unset($amounts[$key]); if (empty($value)) {
unset($amounts[$key]);
}
} }
} }
// Clean remains // Clean remains
foreach ($remains as $key => $value) { if (is_array($remains)) {
$value = price2num($value); foreach ($remains as $key => $value) {
$remains[$key] = (($invoice_type) == 2 ?-1 : 1) * $value; $value = price2num($value);
if (empty($value)) { $remains[$key] = (($invoice_type) == 2 ?-1 : 1) * $value;
unset($remains[$key]); if (empty($value)) {
unset($remains[$key]);
}
} }
} }