Example #1
0
 /**
  * @return \Application\Model\Bean\ProductLog
  */
 private function newLog(Product $product, $eventType)
 {
     $now = \Zend_Date::now();
     $log = ProductLogFactory::createFromArray(array('id_product' => $product->getItemCode(), 'id_user' => $this->getUser()->getIdUser(), 'date_log' => $now->get('yyyy-MM-dd HH:mm:ss'), 'event_type' => $eventType, 'note' => ''));
     $this->getCatalog('ProductLogCatalog')->create($log);
     return $log;
 }
 public function newImportMinMax(Product $product, RestockEntry $restockEntry, $quantity)
 {
     $targetPrice = $this->getMinTargetPriceUSDByIdProduct($product->getItemCode());
     $newQuantityMinMax = false;
     if (!$restockEntry->isManualRestock()) {
         $newQuantityMinMax = ceil($quantity / $product->getMcParts()) * $product->getMcParts() * $targetPrice;
     }
     return $newQuantityMinMax;
 }