* Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * $object must be defined * $backtopage */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } ?> element == 'product') { $productref = $object->ref; } $langs->load("productbatch"); if (empty($id)) { $id = $object->id; } $pdluoid = GETPOST('pdluoid', 'int'); $pdluo = new Productbatch($db); if ($pdluoid > 0) { $result = $pdluo->fetch($pdluoid); if ($result > 0) { $pdluoid = $pdluo->id; } else { dol_print_error($db, $pdluo->error, $pdluo->errors); } } print ''; print load_fiche_titre($langs->trans("StockCorrection"), '', 'generic'); print '
'."\n"; print dol_get_fiche_head(); print ''; print ''; print ''; if ($pdluoid) { print ''; } print ''; // Warehouse or product print ''; if ($object->element == 'product') { print ''; print ''; } if ($object->element == 'stock') { print ''; print ''; } print ''; print ''; print ''; // If product is a Kit, we ask if we must disable stock change of subproducts if (!empty($conf->global->PRODUIT_SOUSPRODUITS) && $object->element == 'product' && $object->hasFatherOrChild(1)) { print ''; print ''; print ''; print ''; } // Serial / Eat-by date if (ismodEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) { print ''; print 'element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").''; print ''; print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; } if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ''; } print ''; } // Purchase price and project print ''; print ''; print ''; if (!empty($conf->project->enabled)) { print ''; print ''; } print ''; // Label of mouvement of id of inventory $valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans("MovementCorrectStock", ''))) ? GETPOST("label") : $langs->trans("MovementCorrectStock", $productref)); print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Warehouse").''; $ident = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ? GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))); if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE; } print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100 maxwidth300 widthcentpercentminusx'); print ''.$langs->trans("Product").''; print img_picto('', 'product'); $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); print ''.$langs->trans("NumberOfUnit").''; if ($object->element == 'product' || $object->element == 'stock') { print ''; print ajax_combobox("mouvement"); } print ''; print '
'; print ''; print ' '; print '
'; if ($pdluoid > 0) { // If form was opened for a specific pdluoid, field is disabled print ''; print ''; } else { print img_picto('', 'barcode', 'class="pictofixedwidth"').''; } print '
'.$langs->trans("SellByDate").''; $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear')); // If form was opened for a specific pdluoid, field is disabled print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); print ''.$langs->trans("EatByDate").''; $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); // If form was opened for a specific pdluoid, field is disabled print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); print '
'.$langs->trans("UnitPurchaseValue").''.$langs->trans('Project').''; print img_picto('', 'project'); $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300 widthcentpercentminusx'); print '
'.$langs->trans("MovementLabel").''; print ''; print ''.$langs->trans("InventoryCode").''; print ''; print '
'; print dol_get_fiche_end(); print '
'; print ''; print '     '; print ''; print '
'; print '
'; ?>