2 namespace Stock\Controller;
5 class StockController extends \Zend\Mvc\Controller\AbstractActionController
8 public function updateAction()
10 \Utility\Registry::setServiceManager($this->serviceLocator);
11 \Utility\Registry::addDynamicConfig(
12 \Utility\Registry::getEntityManager()
13 ->getRepository('Config\Entity\Config')
17 $service = new \Stock\Service\Import();
18 $service->setWorkflow($this->serviceLocator->get('Stock'));
19 $filename = $this->getRequest()->getParam('filename');
20 $service->scriptUpdateVehicleData($filename);
24 public function bulkImportAction()
26 \Utility\Registry::setServiceManager($this->serviceLocator);
27 \Utility\Registry::addDynamicConfig(
28 \Utility\Registry::getEntityManager()
29 ->getRepository('Config\Entity\Config')
33 $service = new \Stock\Service\BulkImport();
34 $service->setWorkflow($this->serviceLocator->get('Stock'));
35 $filename = $this->getRequest()->getParam('filename');
36 $importType = $this->getRequest()->getParam('importType');
37 $userId = $this->getRequest()->getParam('userId');
38 $companyId = $this->getRequest()->getParam('companyId');
39 $service->scriptUpdateVehicleData($filename,$importType,$userId,$companyId);
43 public function pushChangeAction()
45 \Utility\Registry::setServiceManager($this->serviceLocator);
46 \Utility\Registry::addDynamicConfig(
47 \Utility\Registry::getEntityManager()
48 ->getRepository('Config\Entity\Config')
52 $service = new \Stock\Service\Stock();
53 $service->setWorkflow($this->serviceLocator->get('Stock'));
54 $changeCode = $this->getRequest()->getParam('changeCode');
55 $id = $this->getRequest()->getParam('id');
56 $skipId = $this->getRequest()->getParam('skipId');
57 $service->pushChange($changeCode, $id, $skipId);
61 public function imageUploadAction()
63 \Utility\Registry::setServiceManager($this->serviceLocator);
64 \Utility\Registry::addDynamicConfig(
65 \Utility\Registry::getEntityManager()
66 ->getRepository('Config\Entity\Config')
70 $service = new \Stock\Service\Stock();
71 $service->setWorkflow($this->serviceLocator->get('Stock'));
72 $service->uploadImages();
76 public function cleanUpStockAndValuationDatabaseAction()
78 \Utility\Registry::setServiceManager($this->serviceLocator);
79 \Utility\Registry::addDynamicConfig(
80 \Utility\Registry::getEntityManager()
81 ->getRepository('Config\Entity\Config')
86 $valuationDate = $this->getRequest()->getParam('valuationDate');
87 $stockDate = $this->getRequest()->getParam('stockDate');
89 $service = new \Stock\Service\Stock();
90 $service->setWorkflow($this->serviceLocator->get('Stock'));
91 $service->cleanUpStockAndValuationDatabase($valuationDate,$stockDate);
94 public function cleanUpStockAndValuationDatabaseWorkerAction()
96 \Utility\Registry::setServiceManager($this->serviceLocator);
97 \Utility\Registry::addDynamicConfig(
98 \Utility\Registry::getEntityManager()
99 ->getRepository('Config\Entity\Config')
104 $id = $this->getRequest()->getParam('id');
105 $currentStatus = $this->getRequest()->getParam('currentStatus');
106 $table = $this->getRequest()->getParam('table');
108 $service = new \Stock\Service\Stock();
109 $service->setWorkflow($this->serviceLocator->get('Stock'));
110 $service->cleanUpStockAndValuationDatabaseWorker($id,$currentStatus,$table);
113 public function exportDataForGemsAction()
115 \Utility\Registry::setServiceManager($this->serviceLocator);
116 \Utility\Registry::addDynamicConfig(
117 \Utility\Registry::getEntityManager()
118 ->getRepository('Config\Entity\Config')
123 $service = new \Stock\Service\Stock();
124 $service->setWorkflow($this->serviceLocator->get('Stock'));
125 $service->exportDataForGems();