public function setStatus()
 {
     if (empty($_REQUEST['statusId'])) {
         return;
     }
     /** @var ModelSaleOrder $modelSaleOrder */
     $modelSaleOrder = $this->load->model('sale/order');
     foreach ($this->parameters['selectedItems'] as $orderId) {
         RepurchaseOrderDAO::getInstance()->setStatus($orderId, $_REQUEST['statusId']);
         $repurchaseOrder = RepurchaseOrderDAO::getInstance()->getOrder($orderId);
         $modelSaleOrder->verifyOrderCompletion($repurchaseOrder['orderId']);
     }
     $json['newStatusName'] = Status::getStatus($_REQUEST['statusId'], $this->config->get('config_language_id'));
     $this->getResponse()->setOutput(json_encode($json));
 }
 private function setStatus($orderId, $statusId)
 {
     RepurchaseOrderDAO::getInstance()->setStatus($orderId, $statusId);
     $json['newStatusName'] = Status::getStatus($statusId, $this->config->get('config_language_id'));
     //        $this->log->write(print_r($json, true));
     $this->getResponse()->setOutput(json_encode($json));
 }