fix: restore autofill lost functionality

This commit is contained in:
bahfir abbes 2020-08-03 18:44:07 +01:00
parent 22f69f0da9
commit e24027fb1e

View File

@ -1042,6 +1042,7 @@ if ($action == 'create')
while ($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
if (!empty($conf->productbatch->enabled)) print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++;
}
print '});
@ -1050,6 +1051,7 @@ if ($action == 'create')
while ($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(0);'."\n";
if (!empty($conf->productbatch->enabled)) print 'jQuery("#qtyl'.$i.'_'.$i.'").val(0);'."\n";
$i++;
}
print '});
@ -1070,11 +1072,8 @@ if ($action == 'create')
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
print '<td class="center">'.$langs->trans("QtyShipped").'</td>';
print '<td class="center">'.$langs->trans("QtyToShip");
if (empty($conf->productbatch->enabled))
{
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
}
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
print '</td>';
if (!empty($conf->stock->enabled))
{