Fix: seller and buyer inverted when using suppliers orders and

invoices.
This commit is contained in:
Laurent Destailleur 2014-05-13 13:55:08 +02:00
parent f621f7eb32
commit 7ecfd4c243
2 changed files with 7 additions and 4 deletions

View File

@ -1144,6 +1144,10 @@ elseif (! empty($object->id))
$author = new User($db);
$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);
$title=$langs->trans("SupplierOrder");
@ -1751,7 +1755,7 @@ elseif (! empty($object->id))
$var = true;
// Add free products/services
$object->formAddObjectLine(1, $mysoc, $soc);
$object->formAddObjectLine(1, $societe, $mysoc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook

View File

@ -1888,8 +1888,7 @@ else
// 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));
// Try to enhance type detection using date_start and date_end for free lines where type
// was not saved.
// Try to enhance type detection using date_start and date_end for free lines where type was not saved.
$date_start='';
$date_end='';
if (! empty($object->lines[$i]->date_start))
@ -2077,7 +2076,7 @@ else
$var = true;
// Add free products/services
$object->formAddObjectLine(1, $mysoc, $soc);
$object->formAddObjectLine(1, $societe, $mysoc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook