IMMREX7
@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<!--<div class="card">-->
<div class="body">
<button class="btn btn-raised btn-warning btn-round waves-effect" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Advance Search</button>
<div class="collapse" id="collapseExample">
<div class="well">
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Purchase Report</strong></h2>
</div>
<div class="body">
{!! Form::open(['method' => 'GET', 'action' => ['School\Stock\StockReportController@purchaseReport'], 'class' => 'form-horizontal']) !!}
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">Product Category</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::select('idProductCategory',$categories,null,['class' => 'form-control show-tick ms']) !!}
</div>
</div>
<div class="col-sm-2 form-control-label">
<label for="classname">Supplier</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::select('idSupplier',$suppliers,null,['class' => 'form-control show-tick ms']) !!}
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">From Date</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::text('fromDate',null,['class' => 'form-control datepicker']) !!}
</div>
</div>
<div class="col-sm-2 form-control-label">
<label for="classname">To Date</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::text('toDate',null,['class' => 'form-control datepicker']) !!}
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
{!! Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
{!! Form::close() !!}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--</div>-->
</div>
</div>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Purchase Report </strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover dataTable js-exportable">
<thead>
<tr>
<th>S. No.</th>
<th>Date</th>
<th>Vendor Name</th>
<th>Purchase No</th>
<th>Good Received No</th>
<th>Items</th>
<th>Total Amount</th>
<th>Paid </th>
<th>Balance</th>
<th>Payment Mode</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
@foreach($goods as $var)
<tr>
<th scope="row">{{$i}}</th>
<td>{{$var->receivedDate}}</td>
<td>{{$var->bussinessName}}</td>
<td>{{$var->poNo}}</td>
<td>{{$var->receiptNo}}</td>
<td>{{$var->products}}</td>
<td>{{$var->payableAmount}}</td>
<td>{{$var->amountPaid}}</td>
<td>{{$balance = $var->payableAmount - $var->amountPaid}}</td>
<td>{{$var->paymentMode}}</td>
<td>
<a href="{{url('school/purchaseorder/'.$var->idPurchaseOrder)}}" target="_blank" class="btn btn-sm btn-success">Re-Print</a>
<a href="#" class="btn btn-sm btn-danger">Cancel Receipt</a>
@if($balance > 0)
<a href="#" target="_blank" class="btn btn-sm btn-warning">Pay Balance Amount</a>
@endif
</td>
</tr>
<?php $i++; ?>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@stop
@section('script')
<script>
$(document).ready(function() {
$('select[name="idProductCategory"]').on('change', function() {
var categoryID = $(this).val();
if(categoryID!='All') {
$.ajax({
url: "{{url('/school/product-category') }}"+'/' +categoryID + "/products",
type: "GET",
dataType: "json",
success:function(data) {
$('#idProduct').empty();
$('#idProduct').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-all" id="selectall"></div>');
$.each(data, function(key, value) {
$('#idProduct').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="products[]" value="'+key+'" class="productclass"></div>');
});
}
});
}else{
$('select[name="idProduct"]').empty();
}
});
});
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if(checkAll === true){
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
}else{
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
}
});
</script>
@stop
Copyright © 2021 -