From 27b7cf8beaa34985efc3c193504a9d9c0a16a3d0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 16 Oct 2018 23:31:19 +0200 Subject: [PATCH] Fix uniformization dates of order in API --- htdocs/commande/class/commande.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c588830d83d..7f2a8c98dbe 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -155,7 +155,10 @@ class Commande extends CommonOrder public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) public $demand_reason_code; public $date; // Date commande - + public $date_creation; // Date commande + public $date_validation; // Date commande + public $date_modification; // Date commande + /** * @deprecated * @see date @@ -1620,7 +1623,7 @@ class Commande extends CommonOrder $sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut'; $sql.= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason'; $sql.= ', c.fk_account'; - $sql.= ', c.date_commande'; + $sql.= ', c.date_commande, c.date_valid, c.tms'; $sql.= ', c.date_livraison'; $sql.= ', c.fk_shipping_method'; $sql.= ', c.fk_warehouse'; @@ -1673,6 +1676,9 @@ class Commande extends CommonOrder $this->total_ttc = $obj->total_ttc; $this->date = $this->db->jdate($obj->date_commande); $this->date_commande = $this->db->jdate($obj->date_commande); + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_validation = $this->db->jdate($obj->date_valid); + $this->date_modification = $this->db->jdate($obj->tms); $this->remise = $obj->remise; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue;