diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3057d5ebe11..ffed0ec77b0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2134,7 +2134,7 @@ if (empty($reshook)) if (!GETPOST('qty')) $special_code = 3; $line = new FactureLigne($db); - $line->fetch(GETPOST('lineid')); + $line->fetch(GETPOST('lineid', 'int')); $percent = $line->get_prev_progress($object->id); if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0) @@ -2294,17 +2294,17 @@ if (empty($reshook)) } } - elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) + elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) // Update all lines of situation invoice { if (!$object->fetch($id) > 0) dol_print_error($db); - if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "") + if (GETPOST('all_progress') != "") { $all_progress = GETPOST('all_progress', 'int'); foreach ($object->lines as $line) { $percent = $line->get_prev_progress($object->id); if (floatval($all_progress) < floatval($percent)) { - $mesg = $langs->trans("Line").' '.$i.' '.$line->ref.' : '.$langs->trans("CantBeLessThanMinPercent"); + $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; } else @@ -2314,7 +2314,7 @@ if (empty($reshook)) } elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) { - header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // To show again edited page exit(); } @@ -3003,14 +3003,16 @@ if ($action == 'create') exit(); } $options = ""; - foreach ($facids as $facparam) - { - $options .= ''; + if (is_array($facids)) { + foreach ($facids as $facparam) + { + $options .= ''; + } } print ''; @@ -4251,7 +4253,7 @@ elseif ($id > 0 || !empty($ref)) } else { - print $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); if (!$displayWarranty) { print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); } @@ -4568,7 +4570,7 @@ elseif ($id > 0 || !empty($ref)) print ''; // Payments already done (from payment on this invoice) - $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; + $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,'; $sql .= ' c.code as payment_code, c.libelle as payment_label,'; $sql .= ' pf.amount,'; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; @@ -4594,7 +4596,7 @@ elseif ($id > 0 || !empty($ref)) $paymentstatic->id = $objp->rowid; $paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->ref = $objp->ref; - $paymentstatic->num_paiement = $objp->num_paiement; + $paymentstatic->num_payment = $objp->num_payment; $paymentstatic->payment_code = $objp->payment_code; print ''; @@ -4602,7 +4604,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''.dol_print_date($db->jdate($objp->dp), 'dayhour').''; $label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; - print ''.$label.' '.$objp->num_paiement.''; + print ''.$label.' '.$objp->num_payment.''; if (!empty($conf->banque->enabled)) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 228a0583ac4..112e09daad3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4515,7 +4515,8 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ /** * Function that return a number with universal decimal format (decimal separator is '.') from an amount typed by a user. - * Function to use on each input amount before any numeric test or database insert + * Function to use on each input amount before any numeric test or database insert. A better name for this function + * should be text2num(). * * @param float $amount Amount to convert/clean * @param string $rounding ''=No rounding