From 2c2f085b5cd4d37f51e6205b97e5e8ceda4f4b5a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 14 Aug 2025 00:49:56 +0200 Subject: [PATCH] FIX #34936 --- htdocs/expedition/card.php | 2 +- htdocs/expedition/class/expedition.class.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ff48e5e66f0..6f7edbcd389 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2062,7 +2062,7 @@ if ($action == 'create') { $text .= $notify->confirmMessage('SHIPPING_VALIDATE', $object->socid, $object); } - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('ValidateSending'), $text, 'confirm_valid', '', 0, 1, 250); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('ValidateSending'), $text, 'confirm_valid', '', 0, 1, 260); } // Confirm cancellation if ($action == 'cancel') { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 4b52d425025..1470249acf1 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2627,7 +2627,10 @@ class Expedition extends CommonObject $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET fk_statut = ".self::STATUS_CLOSED.", date_expedition = '".$this->db->escape($this->db->idate(dol_now()))."'"; + $sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET fk_statut = ".self::STATUS_CLOSED; + if (empty($this->date_shipping)) { // Date of real shipment was not yet set, we force it on closing + $sql .= ", date_expedition = '".$this->db->escape($this->db->idate(dol_now()))."'"; + } $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut > 0"; $resql = $this->db->query($sql);