IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Supplier</strong></h2>
</div>
<div class="body table-responsive">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\Stock\VendorPayments@index'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-2"></div>
<div class="col-sm-2 form-control-label">
<label for="classname">Financial Year</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idFinancialYear',fys(),null,['class' => 'form-control show-tick ms']); ?>
</div>
</div>
<div class="col-sm-2">
<?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
</div>
</div>
<?php echo Form::close(); ?>
<br>
<table class="table table-bordered table-striped table-hover dataTable js-basic-example">
<thead>
<tr>
<th>S. No.</th>
<th>Vendor Name</th>
<th>Bussiness Name</th>
<th>GSTIN</th>
<th>Contact Number</th>
<th>Total Amount</th>
<th>Paid Amount</th>
<th>Balance Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th scope="row"><?php echo e($i); ?></th>
<td><?php echo e($var->contactPerson); ?></td>
<td><?php echo e($var->bussinessName); ?></td>
<td><?php echo e($var->gstNo); ?></td>
<td><?php echo e($var->contactNo); ?></td>
<?php
$received = \App\ProductReceived::join('product_received_details','product_received.idProductReceived','=','product_received_details.idProductReceived')->where('idSupplier',$var->idSupplier)->get();
$totalAmount = 0;
foreach($received as $receive){
$details = \App\PurchaseOrderDetail::where('idPurchaseOrder',$receive->idPurchaseOrder)->where('idProduct',$receive->idProduct)->first();
if($details != null){
$amount = $details->rate * $receive->quantity;
$taxAmount = ($amount * $details->tax) / 100;
}
$totalAmount = $totalAmount + $taxAmount + $amount;
}
$paidAmount = \App\ProductReceived::join('product_payment','product_received.idProductReceived','=','product_payment.idProductReceived')->where('idSupplier',$var->idSupplier)->sum('amountPaid');
?>
<td><?php echo e($totalAmount); ?></td>
<td><?php echo e($paidAmount); ?></td>
<td><?php echo e($totalAmount - $paidAmount); ?></td>
<td>
<a href="<?php echo e(url('school/vendor-payments/'.$var->idSupplier)); ?>" class="btn btn-sm btn-warning">Pay</a>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -