Fix do not show warehouse for shipment on not predefined product

This commit is contained in:
Laurent Destailleur 2016-01-08 18:15:53 +01:00
parent b6895c7c1f
commit de36db19bc
2 changed files with 20 additions and 17 deletions

View File

@ -207,7 +207,7 @@ if (file_exists($fullpathselecteddir))
// Enable jquery handlers on new generated HTML objects // Enable jquery handlers on new generated HTML objects
print '<script type="text/javascript">'; print '<script type="text/javascript">';
print 'jQuery(".classfortooltip").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});'; print 'jQuery(".classfortooltip").tipTip({ maxWidth: "'.dol_size(600,'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});';
// TODO Remove this. Is replaced with function as 3rd parameter of fileTree // TODO Remove this. Is replaced with function as 3rd parameter of fileTree
print 'jQuery(".fmdirlia").click(function(e) { print 'jQuery(".fmdirlia").click(function(e) {
id=jQuery(this).attr(\'id\').substr(12); id=jQuery(this).attr(\'id\').substr(12);

View File

@ -272,6 +272,7 @@ if (empty($reshook))
$idl = "idl".$i; $idl = "idl".$i;
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); $entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
if ($entrepot_id < 0) $entrepot_id=''; if ($entrepot_id < 0) $entrepot_id='';
if (! ($objectsrc->lines[$i]->fk_product > 0)) $entrepot_id = 0;
$ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int'),$array_options[$i]); $ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int'),$array_options[$i]);
if ($ret < 0) if ($ret < 0)
@ -863,12 +864,14 @@ if ($action == 'create')
if (! empty($conf->stock->enabled)) if (! empty($conf->stock->enabled))
{ {
print '<td align="left">'; print '<td align="left">';
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Type of product need stock change ?
{ {
// Show warehouse combo list // Show warehouse combo list
$ent = "entl".$indiceAsked; $ent = "entl".$indiceAsked;
$idl = "idl".$indiceAsked; $idl = "idl".$indiceAsked;
$tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):$warehouse_id; $tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):$warehouse_id;
if ($line->fk_product > 0)
{
print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product); print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product);
if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id)
{ {
@ -879,6 +882,7 @@ if ($action == 'create')
} }
} }
} }
}
else else
{ {
print $langs->trans("Service"); print $langs->trans("Service");
@ -1602,7 +1606,6 @@ else if ($id || $ref)
} }
print '</div>'; print '</div>';
print "<br>\n";
} }