diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9977910518b..8613828f632 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -184,6 +184,7 @@ if (empty($reshook)) if ($difference != 0) { $object->date_livraison = $date_delivery; + $object->delivery_date = $date_delivery; foreach ($object->lines as $line) { if (isset($line->date_start)) $line->date_start = $line->date_start + $difference; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d81c0fd288a..27f57569c3a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -152,9 +152,15 @@ class Propal extends CommonObject public $datep; /** - * @var integer|string $delivery_date; + * @var int Date expected for delivery + * @deprecated */ - public $delivery_date; + public $date_livraison; // deprecated; Use delivery_date instead. + + /** + * @var integer|string $delivery_date; + */ + public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) public $fin_validite; @@ -1518,6 +1524,7 @@ class Propal extends CommonObject $this->datep = $this->db->jdate($obj->dp); // deprecated $this->fin_validite = $this->db->jdate($obj->dfv); $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->availability_id = $obj->fk_availability; $this->availability_code = $obj->availability_code; @@ -2104,6 +2111,7 @@ class Propal extends CommonObject { $this->oldcopy = clone $this; $this->date_livraison = $delivery_date; + $this->date_delivery = $delivery_date; } if (!$notrigger && empty($error)) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index e69b2dfb8da..fd4c895caec 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -275,6 +275,7 @@ if (empty($reshook)) $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); $object->date_livraison = $datelivraison; + $object->delivery_date = $datelivraison; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int'); $object->fk_delivery_address = GETPOST('fk_address'); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a86a751dcb5..5c341ac0ffb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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++; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 05c6089bfff..1c9cffcdacd 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -932,6 +932,7 @@ if ($resql) $generic_commande->billed = $obj->billed; $generic_commande->date = $db->jdate($obj->date_commande); $generic_commande->date_livraison = $db->jdate($obj->date_delivery); + $generic_commande->delivery_date = $db->jdate($obj->date_delivery); $generic_commande->ref_client = $obj->ref_client; $generic_commande->total_ht = $obj->total_ht; $generic_commande->total_tva = $obj->total_tva; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5049ed41e57..9c78fa6acb9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -115,6 +115,14 @@ class Facture extends CommonInvoice public $date; // Date invoice public $datem; + /** + * @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) + /** * @var string customer ref */ @@ -1331,6 +1339,7 @@ class Facture extends CommonInvoice $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->fk_delivery_address = $object->fk_delivery_address; // deprecated $this->contact_id = $object->contact_id; $this->ref_client = $object->ref_client; diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 1d367774432..f59cb8b6e26 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -86,7 +86,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $sql = "SELECT s.nom as name, s.rowid as socid,"; $sql .= " s.code_client, s.code_fournisseur, s.email,"; $sql .= " s.logo,"; - $sql .= " c.rowid, c.ref, c.tms, c.date_commande, c.date_livraison, "; + $sql .= " c.rowid, c.ref, c.tms, c.date_commande, c.date_livraison as delivery_date, "; $sql .= " c.total_ht,"; $sql .= " c.tva as total_tva,"; $sql .= " c.total_ttc,"; @@ -112,10 +112,11 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $date = $this->db->jdate($objp->date_commande); - $delivery_date = $this->db->jdate($objp->date_livraison); + $delivery_date = $this->db->jdate($objp->delivery_date); $datem = $this->db->jdate($objp->tms); $supplierorderstatic->date_livraison = $delivery_date; + $supplierorderstatic->delivery_date = $delivery_date; $supplierorderstatic->statut = $objp->fk_statut; $supplierorderstatic->id = $objp->rowid; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1dd68accbc9..d6cdce9f7f5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -296,6 +296,11 @@ abstract class CommonObject */ public $cond_reglement_id; + /** + * @var int Demand reason ID + */ + public $demand_reason_id; + /** * @var int Transport mode ID (For module intracomm report) * @see setTransportMode() diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9b927360025..13c1e966c6d 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -114,6 +114,12 @@ class CommandeFournisseur extends CommonOrder public $date_approve2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set public $date_commande; + /** + * @var int Date expected for delivery + * @deprecated See delivery_date + */ + public $date_livraison; + /** * Delivery date */ @@ -313,7 +319,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " c.localtax1, c.localtax2, "; $sql .= " c.date_creation, c.date_valid, c.date_approve, c.date_approve2,"; $sql .= " c.fk_user_author, c.fk_user_valid, c.fk_user_approve, c.fk_user_approve2,"; - $sql .= " c.date_commande as date_commande, c.date_livraison as date_livraison, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_input_method,"; + $sql .= " c.date_commande as date_commande, c.date_livraison as delivery_date, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_input_method,"; $sql .= " c.fk_account,"; $sql .= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,"; $sql .= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,"; @@ -369,7 +375,8 @@ class CommandeFournisseur extends CommonOrder $this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier - $this->date_livraison = $this->db->jdate($obj->date_livraison); + $this->date_livraison = $this->db->jdate($obj->delivery_date); + $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->remise_percent = $obj->remise_percent; $this->methode_commande_id = $obj->fk_input_method; $this->methode_commande = $obj->methode_commande; @@ -2313,6 +2320,7 @@ class CommandeFournisseur extends CommonOrder { $this->oldcopy = clone $this; $this->date_livraison = $delivery_date; + $this->delivery_date = $delivery_date; } if (!$notrigger && empty($error)) @@ -2918,6 +2926,7 @@ class CommandeFournisseur extends CommonOrder $response->nbtodo++; $commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); + $commandestatic->delivery_date = $this->db->jdate($obj->delivery_date); $commandestatic->date_commande = $this->db->jdate($obj->date_commande); $commandestatic->statut = $obj->fk_statut; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 600e60265d5..5ff7da8a9f0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1146,6 +1146,7 @@ if (empty($reshook)) $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); $object->date_livraison = $datelivraison; + $object->delivery_date = $datelivraison; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 066d68b8902..5a5e73a1927 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -258,6 +258,7 @@ if (empty($reshook)) if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) { $object->ref = GETPOST('ref'); $object->date_livraison = $date_delivery; + $object->delivery_date = $date_delivery; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); @@ -279,6 +280,7 @@ if (empty($reshook)) } else { $object->ref = GETPOST('ref'); $object->date_livraison = $date_delivery; + $object->delivery_date = $date_delivery; $object->demand_reason_id = GETPOST('demand_reason_id'); $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e189d149bf7..59305cf7548 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1201,7 +1201,7 @@ class SupplierProposal extends CommonObject $sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht"; $sql .= ", p.datec"; $sql .= ", p.date_valid as datev"; - $sql .= ", p.date_livraison as date_livraison"; + $sql .= ", p.date_livraison as delivery_date"; $sql .= ", p.model_pdf, p.extraparams"; $sql .= ", p.note_private, p.note_public"; $sql .= ", p.fk_projet as fk_project, p.fk_statut"; @@ -1256,7 +1256,8 @@ class SupplierProposal extends CommonObject $this->datev = $this->db->jdate($obj->datev); // TODO deprecated $this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date - $this->date_livraison = $this->db->jdate($obj->date_livraison); + $this->date_livraison = $this->db->jdate($obj->delivery_date); + $this->delivery_date = $this->db->jdate($obj->delivery_date); $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $this->mode_reglement_id = $obj->fk_mode_reglement; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 03833b9f6d9..62e8dc99d72 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -464,7 +464,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') 'mode_reglement_code' => $order->mode_reglement_code, 'mode_reglement' => $order->mode_reglement, - 'date_livraison' => $order->date_livraison, + 'date_livraison' => $order->delivery_date, 'demand_reason_id' => $order->demand_reason_id, 'demand_reason_code' => $order->demand_reason_code, @@ -621,7 +621,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty) 'mode_reglement' => $order->mode_reglement, 'mode_reglement_code' => $order->mode_reglement_code, - 'date_livraison' => $order->date_livraison, + 'date_livraison' => $order->delivery_date, 'demand_reason_id' => $order->demand_reason_id, 'demand_reason_code' => $order->demand_reason_code,