|
@@ -101,11 +101,13 @@ $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($
|
|
|
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
|
|
|
|
|
|
$object = new Reception($db);
|
|
|
+$objectorder = new CommandeFournisseur($db);
|
|
|
$extrafields = new ExtraFields($db);
|
|
|
|
|
|
// fetch optionals attributes and labels
|
|
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
|
|
$extrafields->fetch_name_optionals_label($object->table_element_line);
|
|
|
+$extrafields->fetch_name_optionals_label($objectorder->table_element_line);
|
|
|
|
|
|
// Load object. Make an object->fetch
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
|
@@ -1237,32 +1239,26 @@ if ($action == 'create') {
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
- $extralabelslines = $extrafields->attributes[$line->table_element];
|
|
|
-
|
|
|
- // Display lines extrafields
|
|
|
- // $line is a line of reception (so CommandeFournisseurDispatch)
|
|
|
- if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
|
|
+ // Display lines for extrafields of the Reception line
|
|
|
+ // $line is a 'CommandeFournisseurLigne', $dispatchLines contains values of Reception lines so properties of CommandeFournisseurDispatch
|
|
|
+ if (!empty($extrafields)) {
|
|
|
+ //var_dump($line);
|
|
|
$colspan = 5;
|
|
|
if ($conf->productbatch->enabled) {
|
|
|
$colspan += 3;
|
|
|
}
|
|
|
+ $recLine = new CommandeFournisseurDispatch($db);
|
|
|
|
|
|
$srcLine = new CommandeFournisseurLigne($db);
|
|
|
- $line = new CommandeFournisseurDispatch($db);
|
|
|
-
|
|
|
- $extrafields->fetch_name_optionals_label($srcLine->table_element);
|
|
|
- $extrafields->fetch_name_optionals_label($line->table_element);
|
|
|
-
|
|
|
$srcLine->id = $line->id;
|
|
|
$srcLine->fetch_optionals(); // fetch extrafields also available in orderline
|
|
|
- $line->fetch_optionals();
|
|
|
|
|
|
- if (empty($line->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) {
|
|
|
- $line->array_options = $dispatchLines[$indiceAsked]['array_options'];
|
|
|
+ if (empty($recLine->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) {
|
|
|
+ $recLine->array_options = $dispatchLines[$indiceAsked]['array_options'];
|
|
|
}
|
|
|
- $line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
|
|
+ $recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options);
|
|
|
|
|
|
- print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
|
|
|
+ print $recLine->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
|
|
|
}
|
|
|
|
|
|
$indiceAsked++;
|