Merge pull request #13553 from atm-quentin/11_fix_checkbox_supplier_order

FIX missing selectedlines on supplier order
This commit is contained in:
Laurent Destailleur 2020-04-10 20:04:24 +02:00 committed by GitHub
commit 679b94dcaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1086,7 +1086,7 @@ if (empty($reshook))
if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{
$error = 0;
$selectedLines = GETPOST('toselect', 'array');
if ($socid < 1)
{
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors');
@ -1178,7 +1178,7 @@ if (empty($reshook))
for ($i = 0; $i < $num; $i++)
{
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0 || !in_array($lines[$i]->id, $selectedLines))
continue;
$label = (!empty($lines[$i]->label) ? $lines[$i]->label : '');
@ -1756,7 +1756,7 @@ if ($action == 'create')
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
print '</div>';
print "</form>\n";
// Show origin lines
if (!empty($origin) && !empty($originid) && is_object($objectsrc))
@ -1766,10 +1766,11 @@ if ($action == 'create')
print '<table class="noborder centpercent">';
$objectsrc->printOriginLinesList();
$objectsrc->printOriginLinesList('', $selectedLines);
print '</table>';
}
print "</form>\n";
}
elseif (!empty($object->id))
{