USe fk_product is better than ref
This commit is contained in:
parent
f3ffc7ce8a
commit
78697c1735
@ -104,8 +104,11 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
$ret = $object->fetch($id, $ref);
|
$ret = $object->fetch($id, $ref);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
$ret = $object->fetch_thirdparty();
|
$ret = $object->fetch_thirdparty();
|
||||||
if ($ret < 0)
|
if ($ret <= 0)
|
||||||
dol_print_error('', $object->error);
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
@ -1711,7 +1714,7 @@ if ($action == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} elseif ($object->id > 0) {
|
||||||
/*
|
/*
|
||||||
* Show object in view mode
|
* Show object in view mode
|
||||||
*/
|
*/
|
||||||
@ -1818,7 +1821,6 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
// Ref customer
|
// Ref customer
|
||||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1);
|
||||||
|
|||||||
@ -529,11 +529,11 @@ abstract class CommonDocGenerator
|
|||||||
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
|
||||||
|
|
||||||
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
|
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
|
||||||
if (isset($line->product_ref))
|
if (isset($line->fk_product) && $line->fk_product > 0)
|
||||||
{
|
{
|
||||||
$product = new Product($this->db);
|
$tmpproduct = new Product($this->db);
|
||||||
$result = $product->fetch(null, $line->product_ref);
|
$result = $tmpproduct->fetch($line->fk_product);
|
||||||
foreach($product->array_options as $key=>$label)
|
foreach($tmpproduct->array_options as $key=>$label)
|
||||||
$resarray["line_".$key] = $label;
|
$resarray["line_".$key] = $label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user