Fix: seller and buyer inverted when using suppliers orders and
invoices.
This commit is contained in:
parent
f621f7eb32
commit
7ecfd4c243
@ -1144,6 +1144,10 @@ elseif (! empty($object->id))
|
|||||||
$author = new User($db);
|
$author = new User($db);
|
||||||
$author->fetch($object->user_author_id);
|
$author->fetch($object->user_author_id);
|
||||||
|
|
||||||
|
$societe = new Fournisseur($db);
|
||||||
|
$result=$societe->fetch($object->socid);
|
||||||
|
if ($result < 0) dol_print_error($db);
|
||||||
|
|
||||||
$head = ordersupplier_prepare_head($object);
|
$head = ordersupplier_prepare_head($object);
|
||||||
|
|
||||||
$title=$langs->trans("SupplierOrder");
|
$title=$langs->trans("SupplierOrder");
|
||||||
@ -1751,7 +1755,7 @@ elseif (! empty($object->id))
|
|||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
// Add free products/services
|
// Add free products/services
|
||||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
@ -1888,8 +1888,7 @@ else
|
|||||||
|
|
||||||
// Show product and description
|
// Show product and description
|
||||||
$type=(! empty($object->lines[$i]->product_type)?$object->lines[$i]->product_type:(! empty($object->lines[$i]->fk_product_type)?$object->lines[$i]->fk_product_type:0));
|
$type=(! empty($object->lines[$i]->product_type)?$object->lines[$i]->product_type:(! empty($object->lines[$i]->fk_product_type)?$object->lines[$i]->fk_product_type:0));
|
||||||
// Try to enhance type detection using date_start and date_end for free lines where type
|
// Try to enhance type detection using date_start and date_end for free lines where type was not saved.
|
||||||
// was not saved.
|
|
||||||
$date_start='';
|
$date_start='';
|
||||||
$date_end='';
|
$date_end='';
|
||||||
if (! empty($object->lines[$i]->date_start))
|
if (! empty($object->lines[$i]->date_start))
|
||||||
@ -2077,7 +2076,7 @@ else
|
|||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
// Add free products/services
|
// Add free products/services
|
||||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user