<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Inventoryreport extends Admin_Controller {

    function __construct() {
        parent::__construct();
    }

    function index() {
        if (!$this->rbac->hasPrivilege('class', 'can_view')) {
            access_denied();
        }
        $this->session->set_userdata('top_menu', 'Inventory Report');
        $this->session->set_userdata('sub_menu', 'inventoryreport/index');
        $data['title_list'] = 'Inventory Report';
 	 
         $data['receivedqnty']=$this->inventory_model->getInventoryQnty($query);  
         $data['soldqnty']=$this->inventory_model->getInventoryQntyIssued($query1);  
         $data['leftqnty']=$this->inventory_model->getInventoryQntyLeft($qnty_on_hand);  


        $item_result = $this->item_model->get();

        $data['itemlist'] = $item_result;

		$itemcategory = $this->itemissue_model->get();    																 																		 
        $data['itemissueList'] = $itemcategory;

        $this->load->view('layout/header', $data);
        $this->load->view('inventoryreport/inventoryreport', $data);
        $this->load->view('layout/footer', $data);
																 
																 

    }    
	
	function printInventoryReport() {
        if (!$this->rbac->hasPrivilege('class', 'can_view')) {
            access_denied();
        }
		        $setting_result = $this->setting_model->get();
                $data['settinglist'] = $setting_result;
				
         $data['receivedqnty']=$this->inventory_model->getInventoryQnty($query);  
         $data['soldqnty']=$this->inventory_model->getInventoryQntyIssued($query1);  
         $data['leftqnty']=$this->inventory_model->getInventoryQntyLeft($qnty_on_hand);  


        $item_result = $this->item_model->get();

        $data['itemlist'] = $item_result;

		$itemcategory = $this->itemissue_model->get();    																 																		 
        $data['itemissueList'] = $itemcategory;

         $this->load->view('print/printInventoryReport', $data);
																 
																 

    }

  
}

?>