25if (!defined(
'NOTOKENRENEWAL')) {
26 define(
'NOTOKENRENEWAL',
'1');
28if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
31if (!defined(
'NOREQUIREHTML')) {
32 define(
'NOREQUIREHTML',
'1');
34if (!defined(
'NOREQUIREAJAX')) {
35 define(
'NOREQUIREAJAX',
'1');
37if (!defined(
'NOBROWSERNOTIF')) {
38 define(
'NOBROWSERNOTIF',
'1');
42require
'../../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
45$action =
GETPOST(
'action',
'aZ09');
47$batch =
GETPOST(
'batch',
'alphanohtml');
50restrictedArea($user,
'produit|service', $productId,
'product&product');
52$permissiontoread = $user->hasRight(
'stock',
'lire');
62if ($action ==
'search' && $batch !=
'' && $permissiontoread) {
64 $result = $productLot->fetch(0, $productId, $batch);
66 if ($result > 0 && $productLot->id > 0) {
68 'rowid' => $productLot->id,
69 'sellby' => ($productLot->sellby ?
dol_print_date($productLot->sellby,
'day') :
''),
70 'eatby' => ($productLot->eatby ?
dol_print_date($productLot->eatby,
'day') :
''),
75echo 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.