

<?php $__env->startSection('title', 'Cash Closing'); ?>

<?php $__env->startPush('css'); ?>
	<link rel="stylesheet" href="<?php echo e(asset('myfile/backend/assets/datepicker/zebra_datepicker.min.css')); ?>" type="text/css">
	<link rel="stylesheet" href="<?php echo e(asset('myfile/backend/assets/datepicker/examples.css')); ?>" type="text/css">
	<style type="text/css">
		#search-btn{
			margin-top:24px;
		}
	</style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<div class="right_col" role="main">
	<div class="row">
		<div class="col-xs-12 col-sm-12">
			<div class="x_panel">
				<div class="x_title">
					<h2 class="widget-title">
						<a href="<?php echo e(route('cash.closing_index')); ?>" calss="btn" >
							<i class="fa fa-mail-reply"></i>
						</a>
						Cash Closing Report</h2>
					<ul class="nav navbar-right panel_toolbox">
						<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
							<ul class="dropdown-menu" role="menu">
								<li><a href="#">Settings 1</a>
								</li>
								<li><a href="#">Settings 2</a>
								</li>
							</ul>
						</li>
						<li><a class="close-link"><i class="fa fa-close"></i></a>
						</li>
					</ul>
					<div class="clearfix"></div>
				</div>
				<div class="x_content">
					<div class="widget-main">
						<form id="demo-form2" action="<?php echo e(route('cash.closing_search')); ?>" method="post" data-parsley-validate class="form" enctype="multipart/form-data" >
							<?php echo e(csrf_field()); ?>

							<div class="row">
								<div class="col-sm-2"></div>
								<div class="col-sm-3">
									<div class="form-group">
										<label>From</label>
										<input id="datepicker-range-start" type="text" name="from_date"  class="form-control" value="<?php echo e(date('d-m-Y', strtotime($from_date))); ?>" data-zdp_readonly_element="false" placeholder="yyyy-mm-dd">
									</div>
								</div>
								<div class="col-sm-3">
									<div class="form-group">
										<label>To</label>
										<input id="datepicker-range-end" type="text" name="to_date"  class="form-control"value="<?php echo e(date('d-m-Y', strtotime($to_date))); ?>" data-zdp_readonly_element="false" placeholder="yyyy-mm-dd">
									</div>
								</div>
								<div class="col-sm-2">
									<div class="form-group">
										<button class="btn btn-success btn-xs" id="search-btn">
											<i class="ace-icon fa fa-search fa-2x icon-only"></i>
										</button>
									</div>
								</div>
								<div class="col-sm-2">
									<a href="#" id="search-btn" class="btn btn-xs btn-info" onclick="printDiv('printableArea')">
										<i class="ace-icon fa fa-print fa-2x icon-only"></i>
									</a>
								</div>
							</div>
						</form>
						<hr/>
						<div class="row">
							<div class="col-md-12 col-sm-12 col-xs-12">
								<div class="x_content" id="printableArea">
									<div class="row">
										<div class="col-xs-12 col-sm-12">
											<div class="row">
												<div class="col-xs-1"></div>
												<div class="col-xs-1">
													<img src="<?php echo e(asset('storage/about/'.about()->logo)); ?>" class="img-responsive img-thumbnail" alt="logo" width="85px" height="75px" >
												</div>
												<div class="col-xs-8">
													<div class="text-center">
														<h4><?php echo e(about()->english_name); ?></h4>
														<h5>Cash Closing Report</h5>
														<p>From: <?php echo e(date("d-m-Y", strtotime($from_date))); ?> - <?php echo e(date("d-m-Y", strtotime($to_date))); ?></p>
													</div>
												</div>
												<div class="col-xs-2"></div>
											</div>
											<table class="table table-bordered">
												<thead>
													<tr>
														<th>SL</th>
														<th>Date</th>
														<th>Lastday Balance</th>
														<th>Receipt</th>
														<th>Payment</th>
														<th>Balance</th>
													</tr>
												</thead>
												<tbody>
													<?php 
														$receipt = 0;
														$payment = 0;
													 ?>
												<?php $__currentLoopData = $cashs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$cs): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
													<?php 
														$receipt = $receipt + $cs->receipt;
														$payment = $payment + $cs->payment;
													 ?>
													<tr>
														<td><?php echo e($key + 1); ?></td>
														<td><?php echo e(date("d-m-Y", strtotime($cs->closing_date))); ?></td>
														<td><?php echo e($cs->lastday_balance); ?></td>
														<td><?php echo e($cs->receipt); ?></td>
														<td><?php echo e($cs->payment); ?></td>
														<td><?php echo e($cs->balance); ?></td>
													</tr>
												<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
													<tr>
														<th colspan="2"></th>
														<th>Total=</th>
														<th><?php echo e($receipt); ?></th>
														<th><?php echo e($payment); ?></th>
														<th><?php echo e($receipt - $payment); ?></th>
													</tr>
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
<!-- Jquery Plugin For Date Calender-->
<script type="text/javascript" src="<?php echo e(asset('myfile/backend/assets/datepicker/zebra_datepicker.src.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('myfile/backend/assets/datepicker/examples.js')); ?>"></script>
<script>
	 function printDiv(divName) {
		 var printContents = document.getElementById(divName).innerHTML;
		 var originalContents = document.body.innerHTML;

		 document.body.innerHTML = printContents;

		 window.print();

		 document.body.innerHTML = originalContents;
		}
</script>
<?php $__env->stopPush(); ?>									
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>