NEW The lot of a product uses the link and picto when shown into list.
This commit is contained in:
parent
3b40c95107
commit
8f5206accf
@ -189,7 +189,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
|||||||
if (GETPOST('urlfrom','alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom','alpha');
|
if (GETPOST('urlfrom','alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom','alpha');
|
||||||
else unset($_SESSION["urlfrom"]);
|
else unset($_SESSION["urlfrom"]);
|
||||||
|
|
||||||
if (! GETPOST("username")) $focus_element='username';
|
if (! GETPOST("username",'alpha')) $focus_element='username';
|
||||||
else $focus_element='password';
|
else $focus_element='password';
|
||||||
|
|
||||||
$demologin='';
|
$demologin='';
|
||||||
|
|||||||
@ -152,7 +152,7 @@ else if (! empty($_ENV["dol_entity"])) // Entity inside a CLI script
|
|||||||
{
|
{
|
||||||
$conf->entity = $_ENV["dol_entity"];
|
$conf->entity = $_ENV["dol_entity"];
|
||||||
}
|
}
|
||||||
else if (isset($_POST["loginfunction"]) && GETPOST("entity")) // Just after a login page
|
else if (isset($_POST["loginfunction"]) && GETPOST("entity",'int')) // Just after a login page
|
||||||
{
|
{
|
||||||
$conf->entity = GETPOST("entity",'int');
|
$conf->entity = GETPOST("entity",'int');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -493,7 +493,7 @@ class Productbatch extends CommonObject
|
|||||||
$sql.= " t.import_key";
|
$sql.= " t.import_key";
|
||||||
if ($fk_product > 0)
|
if ($fk_product > 0)
|
||||||
{
|
{
|
||||||
$sql.= ", pl.eatby as eatby, pl.sellby as sellby";
|
$sql.= ", pl.rowid as lotid, pl.eatby as eatby, pl.sellby as sellby";
|
||||||
// TODO May add extrafields to ?
|
// TODO May add extrafields to ?
|
||||||
}
|
}
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_batch as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_batch as t";
|
||||||
@ -517,6 +517,7 @@ class Productbatch extends CommonObject
|
|||||||
|
|
||||||
$tmp = new Productbatch($db);
|
$tmp = new Productbatch($db);
|
||||||
$tmp->id = $obj->rowid;
|
$tmp->id = $obj->rowid;
|
||||||
|
$tmp->lotid = $obj->lotid;
|
||||||
$tmp->tms = $db->jdate($obj->tms);
|
$tmp->tms = $db->jdate($obj->tms);
|
||||||
$tmp->fk_product_stock = $obj->fk_product_stock;
|
$tmp->fk_product_stock = $obj->fk_product_stock;
|
||||||
$tmp->sellby = $db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby);
|
$tmp->sellby = $db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby);
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
@ -115,7 +116,7 @@ $sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desire
|
|||||||
$sql.= ' ps.fk_entrepot,';
|
$sql.= ' ps.fk_entrepot,';
|
||||||
$sql.= ' e.label as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
|
$sql.= ' e.label as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,';
|
||||||
$sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
|
$sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,';
|
||||||
$sql.= ' pl.eatby, pl.sellby,';
|
$sql.= ' pl.rowid as lotid, pl.eatby, pl.sellby,';
|
||||||
$sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable';
|
$sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps on p.rowid = ps.fk_product'; // Detail for each warehouse
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps on p.rowid = ps.fk_product'; // Detail for each warehouse
|
||||||
@ -157,7 +158,7 @@ $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.
|
|||||||
$sql.= " ps.fk_entrepot,";
|
$sql.= " ps.fk_entrepot,";
|
||||||
$sql.= " e.label, e.lieu, e.fk_parent,";
|
$sql.= " e.label, e.lieu, e.fk_parent,";
|
||||||
$sql.= " pb.batch, pb.eatby, pb.sellby,";
|
$sql.= " pb.batch, pb.eatby, pb.sellby,";
|
||||||
$sql.= " pl.eatby, pl.sellby";
|
$sql.= " pl.rowid, pl.eatby, pl.sellby";
|
||||||
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
|
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
@ -306,6 +307,7 @@ if ($resql)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$product_static=new Product($db);
|
$product_static=new Product($db);
|
||||||
|
$product_lot_static=new Productlot($db);
|
||||||
$warehousetmp=new Entrepot($db);
|
$warehousetmp=new Entrepot($db);
|
||||||
|
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
@ -336,6 +338,13 @@ if ($resql)
|
|||||||
$product_static->type=$objp->fk_product_type;
|
$product_static->type=$objp->fk_product_type;
|
||||||
$product_static->entity=$objp->entity;
|
$product_static->entity=$objp->entity;
|
||||||
|
|
||||||
|
$product_lot_static->batch=$objp->batch;
|
||||||
|
$product_lot_static->product_id=$objp->rowid;
|
||||||
|
$product_lot_static->id=$objp->lotid;
|
||||||
|
$product_lot_static->eatby=$objp->eatby;
|
||||||
|
$product_lot_static->sellby=$objp->sellby;
|
||||||
|
|
||||||
|
|
||||||
$warehousetmp->id=$objp->fk_entrepot;
|
$warehousetmp->id=$objp->fk_entrepot;
|
||||||
$warehousetmp->ref=$objp->warehouse_ref;
|
$warehousetmp->ref=$objp->warehouse_ref;
|
||||||
$warehousetmp->label=$objp->warehouse_ref;
|
$warehousetmp->label=$objp->warehouse_ref;
|
||||||
@ -372,7 +381,15 @@ if ($resql)
|
|||||||
print $warehousetmp->getNomUrl(1);
|
print $warehousetmp->getNomUrl(1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">'.$objp->batch.'</td>';
|
|
||||||
|
// Lot
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($product_lot_static->batch)
|
||||||
|
{
|
||||||
|
print $product_lot_static->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
|
print '<td align="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
|
print '<td align="center">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
@ -823,6 +824,8 @@ $sql.= " AND ps.fk_product = ".$object->id;
|
|||||||
$sql.= " ORDER BY e.label";
|
$sql.= " ORDER BY e.label";
|
||||||
|
|
||||||
$entrepotstatic=new Entrepot($db);
|
$entrepotstatic=new Entrepot($db);
|
||||||
|
$product_lot_static=new Productlot($db);
|
||||||
|
|
||||||
$total=0;
|
$total=0;
|
||||||
$totalvalue=$totalvaluesell=0;
|
$totalvalue=$totalvaluesell=0;
|
||||||
|
|
||||||
@ -867,6 +870,11 @@ if ($resql)
|
|||||||
if ($details<0) dol_print_error($db);
|
if ($details<0) dol_print_error($db);
|
||||||
foreach ($details as $pdluo)
|
foreach ($details as $pdluo)
|
||||||
{
|
{
|
||||||
|
$product_lot_static->id = $pdluo->lotid;
|
||||||
|
$product_lot_static->batch = $pdluo->batch;
|
||||||
|
$product_lot_static->eatby = $pdluo->eatby;
|
||||||
|
$product_lot_static->sellby = $pdluo->sellby;
|
||||||
|
|
||||||
if ($action == 'editline' && GETPOST('lineid','int') == $pdluo->id)
|
if ($action == 'editline' && GETPOST('lineid','int') == $pdluo->id)
|
||||||
{ //Current line edit
|
{ //Current line edit
|
||||||
print "\n".'<tr>';
|
print "\n".'<tr>';
|
||||||
@ -896,7 +904,9 @@ if ($resql)
|
|||||||
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
|
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
|
||||||
//print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=editline&lineid='.$pdluo->id.'#'.$pdluo->id.'">';
|
//print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=editline&lineid='.$pdluo->id.'#'.$pdluo->id.'">';
|
||||||
//print img_edit().'</a></td>';
|
//print img_edit().'</a></td>';
|
||||||
print '<td align="right">'.$pdluo->batch.'</td>';
|
print '<td align="right">';
|
||||||
|
print $product_lot_static->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">'. dol_print_date($pdluo->eatby,'day') .'</td>';
|
print '<td align="center">'. dol_print_date($pdluo->eatby,'day') .'</td>';
|
||||||
print '<td align="center">'. dol_print_date($pdluo->sellby,'day') .'</td>';
|
print '<td align="center">'. dol_print_date($pdluo->sellby,'day') .'</td>';
|
||||||
print '<td align="right">'.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'</td>';
|
print '<td align="right">'.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'</td>';
|
||||||
|
|||||||
@ -284,7 +284,6 @@ if ($action == 'create')
|
|||||||
print '<table class="border centpercent">'."\n";
|
print '<table class="border centpercent">'."\n";
|
||||||
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
|
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
|
||||||
//
|
//
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldentity").'</td><td><input class="flat" type="text" name="entity" value="'.GETPOST('entity').'"></td></tr>';
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldfk_product").'</td><td><input class="flat" type="text" name="fk_product" value="'.GETPOST('fk_product').'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldfk_product").'</td><td><input class="flat" type="text" name="fk_product" value="'.GETPOST('fk_product').'"></td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldbatch").'</td><td><input class="flat" type="text" name="batch" value="'.GETPOST('batch').'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldbatch").'</td><td><input class="flat" type="text" name="batch" value="'.GETPOST('batch').'"></td></tr>';
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldfk_user_creat").'</td><td><input class="flat" type="text" name="fk_user_creat" value="'.GETPOST('fk_user_creat').'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Fieldfk_user_creat").'</td><td><input class="flat" type="text" name="fk_user_creat" value="'.GETPOST('fk_user_creat').'"></td></tr>';
|
||||||
|
|||||||
@ -48,19 +48,19 @@ $action=GETPOST('action', 'alpha');
|
|||||||
$mode=$dolibarr_main_authentication;
|
$mode=$dolibarr_main_authentication;
|
||||||
if (! $mode) $mode='http';
|
if (! $mode) $mode='http';
|
||||||
|
|
||||||
$username = GETPOST('username');
|
$username = GETPOST('username','alpha');
|
||||||
$passwordhash = GETPOST('passwordhash');
|
$passwordhash = GETPOST('passwordhash','alpha');
|
||||||
$conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
|
$conf->entity = (GETPOST('entity','int') ? GETPOST('entity','int') : 1);
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module only if not already define
|
// Instantiate hooks of thirdparty module only if not already define
|
||||||
$hookmanager->initHooks(array('passwordforgottenpage'));
|
$hookmanager->initHooks(array('passwordforgottenpage'));
|
||||||
|
|
||||||
|
|
||||||
if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
|
if (GETPOST('dol_hide_leftmenu','alpha') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
|
||||||
if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
|
if (GETPOST('dol_hide_topmenu','alpha') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
|
||||||
if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
|
if (GETPOST('dol_optimize_smallscreen','alpha') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
|
||||||
if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
|
if (GETPOST('dol_no_mouse_hover','alpha') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
|
||||||
if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
|
if (GETPOST('dol_use_jmobile','alpha') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user