Fix : facture fourn type not init in radio

This commit is contained in:
Lucas Marcouiller 2022-05-21 19:15:15 +02:00
parent 2f6bf5f0c8
commit 9c9acf1538

View File

@ -720,6 +720,11 @@ if (empty($reshook)) {
//exit;
// Replacement invoice
if (GETPOST('type', 'int') === '') {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error++;
}
if (GETPOST('type') == FactureFournisseur::TYPE_REPLACEMENT) {
if (empty($dateinvoice)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('DateInvoice')), null, 'errors');
@ -2136,7 +2141,7 @@ if ($action == 'create') {
// Standard invoice
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp = '<input type="radio" id="radio_standard" name="type" value="0"'.(GETPOST('type') == 0 ? ' checked' : '').'> ';
$tmp = '<input type="radio" id="radio_standard" name="type" value="0"'.(GETPOST('type', 'int')? '' : 'checked').'> ';
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';