Fix customer ref of shipment

This commit is contained in:
Laurent Destailleur 2016-10-30 16:34:46 +01:00
parent 6df4666cf3
commit a3607fff77
3 changed files with 12 additions and 7 deletions

View File

@ -2798,7 +2798,11 @@ abstract class CommonObject
if (! $error) if (! $error)
{ {
$this->db->commit(); $this->db->commit();
$this->statut = $status; if (empty($elementId)) // If the element we update was $this (so $elementId is null)
{
$this->statut = $status;
$this->status = $status;
}
return 1; return 1;
} }
else else

View File

@ -202,9 +202,9 @@ if (empty($reshook))
$objectsrc->fetch($object->origin_id); $objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid; $object->socid = $objectsrc->socid;
$object->ref_customer = $objectsrc->ref_client; $object->ref_customer = ''; // We don't use $objectsrc->ref_client, this is ref or order not shipment
$object->model_pdf = GETPOST('model'); $object->model_pdf = GETPOST('model');
$object->date_delivery = $date_delivery; // Date delivery planed $object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address; $object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int'); $object->shipping_method_id = GETPOST('shipping_method_id','int');
$object->tracking_number = GETPOST('tracking_number','alpha'); $object->tracking_number = GETPOST('tracking_number','alpha');
@ -413,9 +413,9 @@ if (empty($reshook))
) )
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$result = $object->valid($user); $result = $object->valid($user);
if ($result < 0) if ($result < 0)
{ {
$langs->load("errors"); $langs->load("errors");
@ -1332,7 +1332,7 @@ else if ($id || $ref)
$objectsrc=new Propal($db); $objectsrc=new Propal($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
// Shipment card // Shipment card
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';

View File

@ -742,7 +742,8 @@ class Expedition extends CommonObject
// Change status of order to "shipment in process" // Change status of order to "shipment in process"
$ret = $this->setStatut(Commande::STATUS_SHIPMENTONPROCESS, $this->origin_id, $this->origin); $ret = $this->setStatut(Commande::STATUS_SHIPMENTONPROCESS, $this->origin_id, $this->origin);
if (! $ret)
if (! $ret)
{ {
$error++; $error++;
} }