Fix missing status_batch var on product lists #9606

This commit is contained in:
Maxime Kohlhaas 2018-10-14 19:55:25 +02:00
parent aedc6fadf4
commit af813f8214
4 changed files with 7 additions and 2 deletions

View File

@ -273,7 +273,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
*/
$max=15;
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.fk_price_expression,";
$sql.= " p.entity,";
$sql.= " p.entity, p.tobatch,";
$sql.= " p.tms as datem";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")";
@ -337,6 +337,7 @@ if ($result)
$product_static->label = $objp->label;
$product_static->type=$objp->fk_product_type;
$product_static->entity = $objp->entity;
$product_static->status_batch = $objp->tobatch;
print $product_static->getNomUrl(1,'',16);
print "</td>\n";
print '<td>'.dol_trunc($objp->label,32).'</td>';

View File

@ -700,6 +700,7 @@ else
$product_static->status = $obj->tosell;
$product_static->entity = $obj->entity;
$product_static->pmp = $obj->pmp;
$product_static->status_batch = $obj->tobatch;
if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock
{

View File

@ -337,6 +337,7 @@ if ($resql)
$product_static->label = $objp->label;
$product_static->type=$objp->fk_product_type;
$product_static->entity=$objp->entity;
$product_static->status_batch=$objp->tobatch;
$product_lot_static->batch=$objp->batch;
$product_lot_static->product_id=$objp->rowid;

View File

@ -216,7 +216,8 @@ $sql.= " t.fk_user_modif,";
$sql.= " t.import_key,";
$sql.= " p.fk_product_type as product_type,";
$sql.= " p.ref as product_ref,";
$sql.= " p.label as product_label";
$sql.= " p.label as product_label,";
$sql.= " p.tobatch";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
@ -430,6 +431,7 @@ if ($resql)
$productstatic->type=$obj->product_type;
$productstatic->ref=$obj->product_ref;
$productstatic->label=$obj->product_label;
$productstatic->status_batch = $obj->tobatch;
print '<td>'.$productstatic->getNomUrl(1).'</td>';
if (! $i) $totalarray['nbfield']++;
}