<!DOCTYPE html>

<html lang="en" class="no-js">

<!-- start: HEAD -->

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php

header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");

header("Cache-Control: post-check=0, pre-check=0", false);

header("Pragma: no-cache");

?>
<title>
<?php



if (isset($sub_menu_name))

    echo strtoupper($sub_menu_name . ' - ');

?>
STOCK MANAGEMENT SYSTEM</title>

<!-- start: META -->



<!--[if IE]><meta http-equiv='X-UA-Compatible' content="IE=edge,IE=9,IE=8,chrome=1" /><![endif]-->

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="description" />
<meta name="author" />

<!--<link rel="stylesheet" href="<?php echo asset_url();?>plugins/bootstrap/css/bootstrap.min.css">
-->
<?php
$this->load->view("common/header"); 
?>


</head>
<div style="top:5px;" class="panel-tools open">
  <button style="display:none" data-toggle="dropdown" class="btn btn-blue dropdown-toggle" onClick="window.print()"><i class="fa fa-print"></i></button>
</div>
<style type="text/css">

th {
	text-align: center !important;
}
.report_view_th {
	color: #000 !important;
	text-align: center !important;
}
body {
	background-color: #fff !important;
	font-size: 15px;
/*	font-family: "serif";*/
	/*, Times, serif; */
	/* font-family:verdana; */
	 /* BPmono helvetica; */
    letter-spacing: 0.5px;
   
     margin-right:10px;
     color:#000 !important;
}
p {
	margin: 0;
}
.print-table td, th {
	padding: 0px;
	vertical-align: top !important;
}
thead {
	display: table-header-group;
}
tfoot {
	display: table-footer-group;
}
</style>
<style type="text/css" media="print">
.print-table {
	width: 100%;
}
.td_border_bottom_1 {
	border-bottom: 1px solid #666 !important;
}
.td_border_bottom_2 {
	border-bottom: 4px double #666 !important;
}
.td_border_top_1 {
	border-top: 1px double #666 !important;
}
.pagebreak {
	page-break-before: always;
}

h1, h2, h3 {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}
h1, .h1, h2, .h2, h3, .h3 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/*
td{
    padding:5px;
}
*/
 @page {
size: auto;   /* auto is the initial value */
margin: 0;  /* this affects the margin in the printer settings */
}

.row {
  padding-left: 20px;
  padding-right: 15px;
}
</style>
<!--  onLoad="window.print(),window.close()" -->
<?php 
//print_r($warehouse_details);
//print_r($transactions_details);



$close_text='';
if($this->session->userdata('ss_warehouse_id')==8){
    
   $close_text='';
}else{
    
    
}

$close_text=',window.close()';
$print_text='window.print()';
if($this->session->userdata('ss_user_id')==1){
	$close_text='';
	$print_text='';
}
$close_text='';
?>
<body onLoad="<?php echo $print_text;?> <?php echo $close_text;?>">
    <br/>
<br/><div class="print_area print" style="width:100%;">
  <div class="row">
    <div class="col-xs-12" style="text-align:center">
      <center>
        <div style="display:none; border:solid 3px; border-radius:50px; width:13%; padding:15px; line-height:1"><span style="font-size:31px;font-weight:bold">SO</span> <span style="font-size:14px;font-weight:bold">Yummy</span></div>
      </center>
      
      
      <H2 style="font-size:25px; margin-bottom:0px; font-weight: bold; margin-top: 1px; line-height: 0.9;"> <?php echo $warehouse_details['name']; ?></H2> 
      
      
      <!-- 
      <p class="text-center" style="font-weight:bold; font-size:17px;">Mobile Phone & Accessories</p> -->
      <p style="font-size:15px"><?php echo $warehouse_details['address']; ?></p>
      <?php if($warehouse_details['email']) //echo $warehouse_details['email']."<br>"; ?>
      <?php if($warehouse_details['phone']) echo "<span style=\"font-size:15px\">  ".$warehouse_details['phone']."</span><br>"; ?>
      
      <p style="padding:3px; font-weight:bold;">PETTY CASH</p>
      
    <!-- <p style="font-size:15px">INVOICE<P/>-->
     <div style="height:2px; border-bottom: 0px dashed black;"></div>
     
    
    </div>
    
    <!--col-xs-12--> 
    
  </div>
  
  <?php 
                  //get total cash sale
                  $total_cash=0;
                // $total_cash=$this->Sales_Model->get_total_paid_cash_by_date_and_user_id($transactions_details['added_date_time'],$transactions_details['user_id'],$transactions_details['acctrnss_id'],'Cash');
                 
                 $total_cash=$this->Sales_Model->get_total_cash_shift($transactions_details['acctrnss_id'],'Cash');
                 
                 $total_return_payment=0;
                 
                 $total_return_payment=$this->Sales_Model->get_total_cash_sales_return_shift($transactions_details['acctrnss_id'],'Return Payment');
                 
                 $total_return_cash_payment=0;
                 
                 $total_return_cash_payment=$this->Sales_Model->get_total_cash_sales_return_shift($transactions_details['acctrnss_id'],'Cash');
                 
                 
                 
                 //echo "test:".$total_cash_2;
                 
                 
                 
                //echo  $this->db->last_query();
                 
                 $total_credit_card=$this->Sales_Model->get_total_paid_cash_by_date_and_user_id($transactions_details['added_date_time'],$transactions_details['user_id'],$transactions_details['acctrnss_id'],'Credit Card');
                 $mc_total=$this->Sales_Model->get_total_paid_cash_by_date_and_user_id($transactions_details['added_date_time'],$transactions_details['user_id'],$transactions_details['acctrnss_id'],'Credit Card','MasterCard');
                 $vc_total=$this->Sales_Model->get_total_paid_cash_by_date_and_user_id($transactions_details['added_date_time'],$transactions_details['user_id'],$transactions_details['acctrnss_id'],'Credit Card','Visa');
                 //echo "vc_total:$vc_total";
                 //	echo $this->db->last_query();
                 
                 //$total_cheque=$this->Sales_Model->get_total_paid_cash_by_date_and_user_id($transactions_details['added_date_time'],$transactions_details['user_id'],$transactions_details['acctrnss_id'],'Cheque');
                 
                 $total_cheque=$this->Sales_Model->get_total_cash_shift($transactions_details['acctrnss_id'],'Cheque');;
                 
                 
    // echo "total_cash:
         
       //  echo $total_cash;
       
       
       
         ?>
         
         
  <div class="row">
    <div class="col-xs-12" style="margin-left:0px;">
      <div class="" style="margin-left:0px; padding-left:0;">
          <div class="col-xs-6">
              <?php
              //print_r($transactions_details);
              
              ?>
          <table>
              <tr>
                  <td>Ref. No</td>
                  <td>:</td>
                  <td><?php echo $transactions_details['acctrnss_id']; ?></td>
              </tr>
              <tr>
                  <td>Amount</td>
                  <td>:</td>
                  <td><?php echo $transactions_details['acctrnss_amount']; ?></td>
              </tr>
               <tr>
                  <td>Type</td>
                  <td>:</td>
                  <td><?php echo $transactions_details['fxd_ass_name']; ?> <?php if($transactions_details['etp_name']) echo " / ". $transactions_details['etp_name']; ?></td>
              </tr>
              
              <tr>
                  <td>Date</td>
                  <td>:</td>
                  <td> <?php echo site_date_time($transactions_details['added_date_time']); //date("Y-m-d", strtotime($sale_details['sale_datetime'])); ?></td>
              </tr>
              <!-- 
              <tr>
                  <td>Opening Balance</td>
                  <td>:</td>
                  <td> <?php echo $transactions_details['acctrnss_amount']; ?></td>
              </tr> -->
              <!-- 
              <tr>
                  <td>Cash In Hand</td>
                  <td>:</td>
                  <td> <?php 
                  echo $transactions_details['cash_in_hand']; ?></td>
              </tr> -->
              
              <!--
               <tr>
                  <td>Total of Cash</td>
                  <td>:</td>
                  <td> 
                  
                  
                  
                  
                  </td>
              </tr>
              -->
              <!-- 
              <tr>
                  <td>Variance</td>
                  <td>:</td>
                  <td>
                      <?php
                      $variance=0;
                      $variance=$transactions_details['acctrnss_amount']+$total_cash-$transactions_details['cash_in_hand'];
                      echo $variance;
                      ?>
                      
                      
                  </td>
              </tr> -->
              
             
              
               <tr>
                  <td>User </td>
                  <td>:</td>
                  <td><?php echo $transactions_details['user_first_name']; ?></td>
              </tr>
          </table>
       
       </div>
       
       
       
       
      </div>
      
    </div>
  </div>
  
  
  <!-- start payment methord -->
         <div class="row col-md-12">
   <div class="col-md-6" style="display:none">
    <table>
        <tr>
            <td width="10%">5000</td>
            <td width="10%">x</td>
            <td width="10%"><?php echo $transactions_details['count_5000']; ?></td>
            <td width="10%">=</td>
            <td width="10%"><?php echo  number_format($transactions_details['count_5000']*5000, 2, '.', ',') ;?></td>
        </tr>
       
        <tr>
            <td>1000</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_1000']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_1000']*1000, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>500</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_500']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_500']*1000, 2, '.', ',') ;?></td>
        </tr>
        <!--
        <tr>
            <td>200</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_200']; ?></td>
            <td>=</td>
            <td></td>
        </tr> -->
        <tr>
            <td>100</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_100']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_100']*100, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>50</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_50']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_50']*50, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>20</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_20']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_20']*20, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>10</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_10']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_10']*10, 2, '.', ',') ;?></td>
        </tr>
        <!--
        <tr>
            <td>10 (C)</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_10_c']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_10_c']*10, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>5</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_5']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_5']*5, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>2</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_2']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_2']*2, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>1</td>
            <td>x</td>
            <td><?php echo $transactions_details['count_1']; ?></td>
            <td>=</td>
            <td><?php echo  number_format($transactions_details['count_1']*1, 2, '.', ',') ;?></td>
        </tr>
        -->
    </table>
    
    
    <br/>
    
    <!-- 
   <h4>Credit Card Details</h4> 
    <table>
       
        <tr>
            <td width="10%"><h4>Card Type</h4></td>
            <td width="10%"><h4>Physical</h4></td>
            <td width="10%"><h4>System</h4></td>
        </tr>
       <tr>
            <td>MAST</td>
            
            <td><?php echo  number_format($transactions_details['mc_amount'], 2, '.', ',') ;?></td>
            <td><?php echo  number_format($mc_total, 2, '.', ',') ;?></td>
        </tr>
        <tr>
            <td>VISA</td>
            
            <td><?php echo  number_format($transactions_details['vc_amount'], 2, '.', ',') ;?></td>
            <td><?php echo  number_format($vc_total, 2, '.', ',') ;?></td>
        </tr>
         
    </table>
    
    -->
    
    </div>
     <div class="col-md-6">
         
       
        
        <!-- 
        <br/>
        <h4>Cash Receipt</h4> 
    <table>
       
        <tr>
            <td width="10%"><h4>Receipt No</h4></td>
            <td width="10%"><h4>Amount</h4></td>
            <td width="10%"><h4>Remarks</h4></td>
        </tr>
       <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
    
              -->
        <br/> 
       
    <br/>
    
    
    
  
        
    </div>
    </div>
       <!-- end payment methad -->
       
       
  <div class="print-start">
    <?php //print_r($sale_details);?>
    <div class="row col-md-12">
   
    </div>
  </div>
</div>
<!--
<div class="pagebreak"> - </div>
-->



<!--print-start-->

</body>
<!-- <script src="<?php echo asset_url(); ?>plugins/jQuery-lib/2.0.3/jquery.min.js"></script>-->
<script type="text/javascript">
jQuery(document).ready(function() {
    
    setTimeout(
  function() 
  {
    //do something special
  }, 2000);
	//alert();
//window.close();
				// $("#modal_ajax_sales_payment_btn").trigger("click");
				//fbs_click('<?php //echo $sale_id ?>')
				//Main.init();
				//TableData.init();
				//UIModals.init();

			});
			
			</script>
