add command for replaySameStatus

add command for replaySameStatus

diff --git a/core/class/logistique.class.php b/core/class/logistique.class.php
index 68347ac..0efed38 100644
--- a/core/class/logistique.class.php
+++ b/core/class/logistique.class.php
@@ -1217,7 +1217,6 @@ class logistique extends eqLogic {
                 $cmdDoRef->setConfiguration('referenceOrder', $_doc['docEntete']['dO_Ref']);
                 $cmdStatus->save();
                 self::handleEventStatus($cmdStatus, 'waitTreatment', $_options = ['step' => 1]);
-               // $cmdStatus->event(self::$status['waitTreatment']);
             }
 
             $cmdTrackingNb = cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'trackingNumber');
@@ -1282,6 +1281,19 @@ class logistique extends eqLogic {
             $cmdActionCleanBLPreparationInfos->setEqLogic_id($eqLogic->getId());
             $cmdActionCleanBLPreparationInfos->save();
 
+            $cmdActionReplaySameStatus = cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'replaySameStatus');
+            if (!is_object($cmdActionReplaySameStatus)) {
+                $cmdActionReplaySameStatus = new logistiqueCmd();
+                $cmdActionReplaySameStatus->setLogicalId('replaySameStatus');
+                $cmdActionReplaySameStatus->setIsVisible(1);
+                $cmdActionReplaySameStatus->setName(__('Rejouer le status courant pour débloquer', __FILE__));
+                $cmdActionReplaySameStatus->setOrder(1);
+            }
+            $cmdActionReplaySameStatus->setType('action');
+            $cmdActionReplaySameStatus->setSubType('other');
+            $cmdActionReplaySameStatus->setEqLogic_id($eqLogic->getId());
+            $cmdActionReplaySameStatus->save();
+
             $eqLogic->addListener();
             $jsonData = json_encode($_doc);
             file_put_contents($todayDir.'/'.$_doc['docEntete']['dO_Piece'].'.json',$jsonData);
@@ -4031,6 +4043,13 @@ class logistique extends eqLogic {
         }
     }
 
+    public function replaySameStatus(){
+        
+        if(is_object($cmdStatus)){  
+                self::handleEventStatus($cmdStatus, 'labelGenerate', $_statutCode = ['step' => 2]);
+            }
+    }
+
     public function replayStep(){
         $cmdStatus =  $this->getCmd(null, 'status');
         if(is_object($cmdStatus)){  
@@ -4108,6 +4127,11 @@ class logistiqueCmd extends cmd {
             logistique::resetEventGetPL();
             log::add('logistique', 'debug', 'resetGetPLRunning');
             break;
+
+        case 'replaySameStatus':
+            $eqLogic->replaySameStatus();
+            log::add('logistique', 'debug', 'replaySameStatus');
+            break;
     }
   }
 

GitHub
sha: ef6b827b63c970702b133431c4d3ba43cbf24096