diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 8c5f55fb8afa983e76b9d7d545403aee24693eb7..8a2f5841f8fec45d917a578fdbfa10f233322528 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -128,8 +128,12 @@ if ($action == "correct_stock") if ($product->hasbatch()) { $batch=GETPOST('batch_number'); - $eatby=GETPOST('eatby'); - $sellby=GETPOST('sellby'); + + //$eatby=GETPOST('eatby'); + //$sellby=GETPOST('sellby'); + $eatby=dol_mktime(12, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); + $sellby=dol_mktime(12, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear')); + $result=$product->correct_stock_batch( $user, $id, diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index b137bde592ecee2545b1a0a50682f68f71da8331..522e8d2899b536357a54a969f739b44635469a45 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -63,13 +63,13 @@ { print '<td width="20%" class="fieldrequired" colspan="2">'.$langs->trans("Product").'</td>'; print '<td width="20%">'; - print $form->select_produits(GETPOST('product_id'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':'')); + print $form->select_produits(GETPOST('product_id'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''), 20, 0, -1); print '</td>'; } print '<td width="20%">'; print '<select name="mouvement" id="mouvement" class="flat">'; print '<option value="0">'.$langs->trans("Add").'</option>'; - print '<option value="1">'.$langs->trans("Delete").'</option>'; + print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>'; print '</select></td>'; print '<td width="20%" class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input class="flat" name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>'; print '</tr>';