/**
  * view section method
  *
  * @param string $id
  * @return void
  */
 public function detail_section($customer_id = null, $section = null)
 {
     $this->layoutOpt['left_nav_selected'] = "view_builder";
     $this->Customer->id = $customer_id;
     if (!$this->Customer->exists()) {
         throw new NotFoundException(__('Invalid customer'));
     }
     $customer = $this->Customer->find('first', array('conditions' => array('Customer.customer_type_id' => array('2', '3'), 'Customer.id' => $customer_id)));
     App::uses("CustomerSalesRepresentetives", "CustomerManager.Model");
     $sales = new CustomerSalesRepresentetives();
     $sales_representatives = $sales->find("all", array("conditions" => array("CustomerSalesRepresentetives.customer_id" => $customer_id)));
     App::uses("BuilderSupplyTypesList", "CustomerManager.Model");
     $builder_supply_types_list = new BuilderSupplyTypesList();
     $builder_supply_types = $builder_supply_types_list->find("all", array("conditions" => array("BuilderSupplyTypesList.builder_account_id" => $customer['BuilderAccount']['id'])));
     $edit = 'false';
     $this->set(compact('customer', 'section', 'sales_representatives', 'builder_supply_types', 'edit'));
 }
 public function print_detail($id = null)
 {
     $this->layoutOpt['layout'] = 'report';
     $this->Customer->id = $id;
     if (!$this->Customer->exists()) {
         throw new NotFoundException(__('Invalid item'));
     }
     $customer = $this->Customer->find("first", array("conditions" => array("Customer.id" => $id)));
     App::import('Model', 'CustomerManager.BuilderAccount');
     $this->BuilderAccount = new BuilderAccount();
     $builder_account_info = $this->BuilderAccount->find('all', array('conditions' => array('BuilderAccount.customer_id' => $id)));
     $reportTitle = "Customer Information Sheet";
     $reportDate = date('l, F d, Y');
     App::uses("CustomerSalesRepresentetives", "CustomerManager.Model");
     $sales = new CustomerSalesRepresentetives();
     $sales_representatives = $sales->find("all", array("conditions" => array("CustomerSalesRepresentetives.customer_id" => $id)));
     $this->set(compact('customer', '$builder_account_info', 'reportTitle', 'reportDate', 'sales_representatives'));
 }