FIX missing selectedlines on supplier order but checkbox are displayed
This commit is contained in:
parent
3e04fe2319
commit
28fa0e4e5d
@ -1086,7 +1086,7 @@ if (empty($reshook))
|
|||||||
if ($action == 'add' && $user->rights->fournisseur->commande->creer)
|
if ($action == 'add' && $user->rights->fournisseur->commande->creer)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
$selectedLines = GETPOST('toselect', 'array');
|
||||||
if ($socid < 1)
|
if ($socid < 1)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors');
|
||||||
@ -1178,6 +1178,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
|
if (!in_array($lines[$i]->id, $selectedLines)) continue;
|
||||||
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
|
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -1756,7 +1757,7 @@ if ($action == 'create')
|
|||||||
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print "</form>\n";
|
|
||||||
|
|
||||||
// Show origin lines
|
// Show origin lines
|
||||||
if (!empty($origin) && !empty($originid) && is_object($objectsrc))
|
if (!empty($origin) && !empty($originid) && is_object($objectsrc))
|
||||||
@ -1766,10 +1767,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
$objectsrc->printOriginLinesList();
|
$objectsrc->printOriginLinesList('', $selectedLines);
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
elseif (!empty($object->id))
|
elseif (!empty($object->id))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user