2
0
forked from Wavyzz/dolibarr

Fix compatibility with date_delivery

This commit is contained in:
Laurent Destailleur
2020-11-11 18:08:40 +01:00
parent a804ad4914
commit 90884d8085
13 changed files with 60 additions and 10 deletions

View File

@@ -180,6 +180,12 @@ class Commande extends CommonOrder
*/
public $date_commande;
/**
* @var int Date expected for delivery
* @deprecated
*/
public $date_livraison; // deprecated; Use delivery_date instead.
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
/**
@@ -1354,6 +1360,7 @@ class Commande extends CommonOrder
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->delivery_date = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id;
$this->warehouse_id = $object->warehouse_id;
$this->fk_delivery_address = $object->fk_delivery_address;
@@ -1864,6 +1871,7 @@ class Commande extends CommonOrder
$this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->delivery_date = $this->db->jdate($obj->date_livraison);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
$this->fk_delivery_address = $obj->fk_delivery_address;
@@ -2595,6 +2603,7 @@ class Commande extends CommonOrder
{
$this->oldcopy = clone $this;
$this->date_livraison = $delivery_date;
$this->delivery_date = $delivery_date;
}
if (!$notrigger && empty($error))
@@ -3495,7 +3504,9 @@ class Commande extends CommonOrder
$generic_commande->statut = $obj->fk_statut;
$generic_commande->date_commande = $this->db->jdate($obj->date_commande);
$generic_commande->date = $this->db->jdate($obj->date_commande);
$generic_commande->date_livraison = $this->db->jdate($obj->delivery_date);
$generic_commande->delivery_date = $this->db->jdate($obj->delivery_date);
if ($generic_commande->hasDelay()) {
$response->nbtodolate++;