public function run()
 {
     spl_autoload_register(function ($sClass) {
         $sClass = str_replace("_", "/", $sClass);
         include $sClass . '.php';
     });
     try {
         $this->worker->addData(array('receiptId' => $this->_receiptId));
         $this->worker->addData(array('locationId' => $this->_locationId));
         $call = new LivePos_Job_GetRecord(false);
         $call->sendRequest('GetReceiptDetails', $this->_sessionId, array('intReceiptNumber' => $this->_receiptId));
         if ($call->isOk()) {
             $aResponse = $call->getResponse();
             $this->_getReceiptType($aResponse);
             $this->worker->addData(array('code' => $aResponse['code']));
             $this->worker->addData(array('data' => $aResponse['data']));
         } else {
             $aResponse = $call->getResponse();
             $this->worker->addData(array('code' => $aResponse['code']));
             $this->worker->addData(array('data' => $aResponse['data']));
             $this->worker->addData(array('error' => implode(',', $call->getErrors())));
         }
     } catch (Exception $e) {
         LivePos_Db_Model::logError($e->getMessage());
         $this->worker->addData(array('receiptId' => $this->_receiptId));
         $this->worker->addData(array('code' => $aResponse['code']));
         $this->worker->addData(array('data' => $call->getResponse()));
         $this->worker->addData(array('error' => $e->getMessage()));
     }
 }
 public function run()
 {
     spl_autoload_register(function ($sClass) {
         $sClass = str_replace("_", "/", $sClass);
         include $sClass . '.php';
     });
     try {
         $call = new LivePos_Job_GetRecord(false);
         $call->sendRequest('GetProductDetails', $this->_sessionId, array('strProductSKU' => $this->_productId));
         if ($call->isOk()) {
             $aResponse = $call->getResponse();
             $product = LivePos_Maps_MapFactory::create('product', json_decode($aResponse['data'], true));
             $this->worker->addData(array('code' => $aResponse['code']));
             $this->worker->addData(array('product' => $product->getPublicVars()));
             $this->worker->addData(array('error' => implode(',', $this->_errors)));
         } else {
             $aResponse = $call->getResponse();
             $this->worker->addData(array('productId' => $this->_productId));
             $this->worker->addData(array('code' => $aResponse['code']));
             $this->worker->addData(array('error' => implode(',', $call->getErrors())));
         }
     } catch (Exception $e) {
         LivePos_Db_Model::logError($e->getMessage());
         $this->worker->addData(array('productId' => $this->_productId));
         $this->_errors[] = $e->getMessage();
         $this->worker->addData(array('error' => implode(',', $this->_errors)));
     }
 }