24if (!defined(
'NOTOKENRENEWAL')) {
25 define(
'NOTOKENRENEWAL',
'1');
27if (!defined(
'NOREQUIREMENU')) {
28 define(
'NOREQUIREMENU',
'1');
30if (!defined(
'NOREQUIREHTML')) {
31 define(
'NOREQUIREHTML',
'1');
33if (!defined(
'NOREQUIREAJAX')) {
34 define(
'NOREQUIREAJAX',
'1');
36if (!defined(
'NOBROWSERNOTIF')) {
37 define(
'NOBROWSERNOTIF',
'1');
41require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
44$action =
GETPOST(
'action',
'aZ09');
46$batch =
GETPOST(
'batch',
'alphanohtml');
49restrictedArea($user,
'produit|service', $productId,
'product&product');
51$permissiontoread = $user->hasRight(
'stock',
'lire');
61if ($action ==
'search' && $batch !=
'' && $permissiontoread) {
63 $result = $productLot->fetch(
'', $productId, $batch);
65 if ($result > 0 && $productLot->id > 0) {
67 'rowid' => $productLot->id,
68 'sellby' => ($productLot->sellby ?
dol_print_date($productLot->sellby,
'day') :
''),
69 'eatby' => ($productLot->eatby ?
dol_print_date($productLot->eatby,
'day') :
''),
74echo 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.