From 3e19702e392ee26a6dfbf36e700fd474805f2736 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 17 Dec 2019 18:05:59 +0100 Subject: [PATCH] Fix prevent double action on shipment close --- htdocs/expedition/class/expedition.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ea6e003d326..81c7cb55fc4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1902,6 +1902,12 @@ class Expedition extends CommonObject $error=0; + // Protection. This avoid to move stock later when we should not + if ($this->statut == self::STATUS_CLOSED) + { + return 0; + } + $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut='.self::STATUS_CLOSED;