26if (!defined(
'NOTOKENRENEWAL')) {
27 define(
'NOTOKENRENEWAL',
'1');
29if (!defined(
'NOREQUIREMENU')) {
30 define(
'NOREQUIREMENU',
'1');
32if (!defined(
'NOREQUIREHTML')) {
33 define(
'NOREQUIREHTML',
'1');
35if (!defined(
'NOREQUIREAJAX')) {
36 define(
'NOREQUIREAJAX',
'1');
38if (!defined(
'NOBROWSERNOTIF')) {
39 define(
'NOBROWSERNOTIF',
'1');
43require
'../../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
54$action =
GETPOST(
'action',
'aZ09');
56$batch =
GETPOST(
'batch',
'alphanohtml');
59restrictedArea($user,
'produit|service', $productId,
'product&product');
61$permissiontoread = $user->hasRight(
'stock',
'lire');
71if ($action ==
'search' && $batch !=
'' && $permissiontoread) {
73 $result = $productLot->fetch(0, $productId, $batch);
75 if ($result > 0 && $productLot->id > 0) {
77 'rowid' => $productLot->id,
78 'sellby' => ($productLot->sellby ?
dol_print_date($productLot->sellby,
'day') :
''),
79 'eatby' => ($productLot->eatby ?
dol_print_date($productLot->eatby,
'day') :
''),
84echo json_encode($rows);
Class with list of lots and properties.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.