/**
  * add method
  *
  * @return void
  */
 public function add()
 {
     $this->layoutOpt['left_nav_selected'] = "add_material";
     if ($this->request->is('post')) {
         if ($this->Material->save($this->request->data)) {
             $this->Session->setFlash(__('The Material has been saved'));
             $this->redirect(array('controller' => 'materials', 'action' => DETAIL, $this->Material->id));
         } else {
             $this->Session->setFlash(__('The Material could not be saved. Please, try again.'));
         }
     } else {
         App::import('Model', 'Inventory.MaterialGroup');
         $materialgroup = new MaterialGroup();
         $data = $materialgroup->find('first', array('conditions' => array('MaterialGroup.default' => 1)));
         $this->set(compact('data'));
     }
 }
 function getItemMaterialForReport($id = null)
 {
     App::import("Model", "Inventory.MaterialGroup");
     $MaterialGroup_model = new MaterialGroup();
     return $MaterialGroup_model->find("first", array('conditions' => array('MaterialGroup.id' => $id)));
 }