Merge pull request #14364 from bafbes/abb120130

fix: restore autofill lost functionality on expeditions
This commit is contained in:
Laurent Destailleur 2020-08-23 19:52:21 +02:00 committed by GitHub
commit 5aaf567f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 '});
@ -1072,9 +1074,12 @@ if ($action == 'create')
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 ' / ';
} else {
print '<br>';
}
print '<a href="#" id="autoreset">'.$langs->trans("Reset").'</a>';
print '</td>';
if (!empty($conf->stock->enabled))
{