Skip to content

Commit

Permalink
Fix default value for inventory code during a stock correction
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 2, 2017
1 parent 2a92ee6 commit 025ecd4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions htdocs/product/stock/tpl/stockcorrection.tpl.php
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $object must be defined
* $backtopage
* $backtopage
*/
?>

Expand Down Expand Up @@ -50,7 +50,7 @@ function init_price()
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";

dol_fiche_head();

print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="correct_stock">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
Expand Down Expand Up @@ -93,12 +93,12 @@ function init_price()
print '<td>'.$langs->trans('Project').'</td>';
print '<td>';
$formproject->select_projects();
print '</td>';
print '</td>';
}
print '</tr>';

// Serial / Eat-by date
if (! empty($conf->productbatch->enabled) &&
if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock'))
)
Expand Down Expand Up @@ -127,19 +127,19 @@ function init_price()
print '<td>';
print '<input type="text" name="label" size="60" value="'.$valformovementlabel.'">';
print '</td>';
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.GETPOST("inventorycode").'"></td>';
print '<td>'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"])?GETPOST("inventorycode",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')).'"></td>';
print '</tr>';

print '</table>';

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</div>';

print '</form>';
?>
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
18 changes: 9 additions & 9 deletions htdocs/product/stock/tpl/stocktransfer.tpl.php
Expand Up @@ -25,9 +25,9 @@
if ($object->element == 'product') $productref = $object->ref;

$langs->load("productbatch");

if (empty($id)) $id = $object->id;

$pdluoid=GETPOST('pdluoid','int');

$pdluo = new Productbatch($db);
Expand All @@ -48,9 +48,9 @@
print load_fiche_titre($langs->trans("StockTransfer"),'','title_generic.png');

print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";

dol_fiche_head();

print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="transfert_stock">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
Expand All @@ -76,15 +76,15 @@
print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''));
print '</td>';
}

print '<td width="20%" class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td width="30%">';
print $formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
print '</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td colspan="3"><input type="text" name="nbpiece" size="10" value="'.dol_escape_htmltag(GETPOST("nbpiece")).'"></td>';
print '</tr>';

// Serial / Eat-by date
if (! empty($conf->productbatch->enabled) &&
if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock'))
)
Expand All @@ -103,7 +103,7 @@
}
print '</td>';
print '</tr>';

print '<tr>';
print '<td>'.$langs->trans("EatByDate").'</td><td>';
print $form->select_date(($d_eatby?$d_eatby:$pdluo->eatby),'eatby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
Expand All @@ -121,13 +121,13 @@
print '<td>';
print '<input type="text" name="label" size="60" value="'.dol_escape_htmltag($valformovementlabel).'">';
print '</td>';
print '<td width="15%">'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(GETPOST("inventorycode")?GETPOST("inventorycode",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')).'"></td>';
print '<td width="15%">'.$langs->trans("InventoryCode").'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(isset($_POST["inventorycode"])?GETPOST("inventorycode",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S')).'"></td>';
print '</tr>';

print '</table>';

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
Expand Down

0 comments on commit 025ecd4

Please sign in to comment.