public function renderExport(Varien_Object $row)
 {
     $warehouseIds = $row->getWarehouseId();
     $warehouseIds = explode(',', $warehouseIds);
     $names = array();
     foreach ($warehouseIds as $warehouseId) {
         $names[] = Mage::getModel('inventoryplus/warehouse')->load($warehouseId)->getWarehouseName();
     }
     return implode(', ', $names);
 }
Esempio n. 2
0
 public function render(Varien_Object $row)
 {
     $html = '';
     $permission = Mage::helper('inventoryplus')->getPermission($row->getWarehouseId(), 'can_physical');
     if ($row->getPhysicalStatus() == 0 && $permission) {
         $html = '<a href="' . $this->getUrl('inventoryphysicalstocktakingadmin/adminhtml_physicalstocktaking/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryphysicalstocktaking')->__('Edit') . '</a>';
     } else {
         $html = '<a href="' . $this->getUrl('inventoryphysicalstocktakingadmin/adminhtml_physicalstocktaking/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryphysicalstocktaking')->__('View') . '</a>';
     }
     return $html;
 }
Esempio n. 3
0
 public function render(Varien_Object $row)
 {
     $html = '';
     $permission = Mage::helper('inventoryplus')->getPermission($row->getWarehouseId(), 'can_adjust');
     if ($row->getAdjustStatus() == 0) {
         $html = '<a href="' . $this->getUrl('adminhtml/inp_adjuststock/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryplus')->__('Edit') . '</a>';
     } else {
         $html = '<a href="' . $this->getUrl('adminhtml/inp_adjuststock/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryplus')->__('View') . '</a>';
     }
     return $html;
 }
 public function render(Varien_Object $row)
 {
     if ($row->getWarehouseId()) {
         $requestData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('top_filter'));
         if (empty($requestData)) {
             $requestData = Mage::Helper('inventoryreports')->getDefaultOptionsWarehouse();
         }
         $warehouse = $row->getWarehouseId();
         $gettime = Mage::Helper('inventoryreports')->getTimeSelected($requestData);
         $datefrom = $gettime['date_from'];
         $dateto = $gettime['date_to'];
         $warehouse_product = Mage::getModel('inventoryplus/warehouse_product')->getCollection()->addFieldToFilter('warehouse_id', $warehouse);
         $supplyneeds = array();
         $total_supplyneeds = 0;
         foreach ($warehouse_product as $value) {
             $product_id = $value->getProductId();
             $method = Mage::getStoreConfig('inventory/supplyneed/supplyneeds_method');
             if ($datefrom && $dateto && $method == 2 && strtotime($datefrom) <= strtotime($dateto)) {
                 $max_needs = Mage::helper('inventorysupplyneeds')->calMaxAverage($product_id, $datefrom, $dateto, $warehouse);
             } elseif ($datefrom && $dateto && $method == 1 && strtotime($datefrom) <= strtotime($dateto)) {
                 $max_needs = Mage::helper('inventorysupplyneeds')->calMaxExponential($product_id, $datefrom, $dateto, $warehouse);
             } else {
                 $max_needs = 0;
             }
             if ($max_needs > 0) {
                 $supplyneeds[$product_id] = $max_needs;
                 $total_supplyneeds += $max_needs;
             }
         }
     }
     if ($total_supplyneeds == 0) {
         return '0';
     } else {
         return $total_supplyneeds;
     }
 }
 /**
  * Display Warehouse name from order_id
  * 
  * @param Varien_Object $row
  * @return string
  */
 public function render(Varien_Object $row)
 {
     $orderId = $row->getData('entity_id');
     $warehouseOrder = Mage::getModel('inventoryplus/warehouse_order')->getCollection()->addFieldToFilter('order_id', $orderId);
     // Check if all warehouse_order's order_id are the same
     // If not, return "Online"
     $warehouseId = $warehouseOrder->getFirstItem()->getWarehouseId();
     foreach ($warehouseOrder as $row) {
         if ($row->getWarehouseId() != $warehouseId) {
             return "Online";
         }
     }
     // If all order_id are the same, get warehouse name
     $warehouse = Mage::getModel('inventoryplus/warehouse')->load($warehouseId);
     if ($warehouse->getId()) {
         return $warehouse->getWarehouseName();
     }
     // If can not find warehouse name, return "Online"
     return "Online";
 }