IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/f9827457c676dd3f63d95485c14894a9337486f6.php

<?php $__env->startSection('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>Issued Inventory Report</strong></h2>

                                </div>

                                <div class="body">

                                    <?php echo Form::open(['method' => 'GET',  'action' => ['School\Stock\StockReportController@inventoryReport'], '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">

                                                <?php echo Form::select('idProductCategory',$categories,null,['class' => 'form-control show-tick ms']); ?>


                                            </div>

                                        </div>

                                        <div class="col-sm-2 form-control-label required">

                                            <label for="classname">Product</label>

                                        </div>

                                        <div class="col-sm-3">

                                            <div class="form-group">

                                                <div id="idProduct" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">



                                                </div>

                                            </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">

                                                <?php echo 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">

                                                <?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>


                                            </div>

                                        </div>

                                    </div>

                                    <div class="row clearfix">

                                        <div class="col-sm-8 offset-sm-2">

                                            <?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>


                                            <?php echo 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>Issued Inventory Report</strong></h2>

            </div>

            <div class="body table-responsive">

                <table class="table table-bordered table-striped table-hover" id="js-inventory">

                    <thead>

                        <tr>

                            <th>S. No.</th>

                            <th>Date</th>

                            <th>Ec No.</th>

                            <th>Name</th>

                            <th>Invoice No</th>

                            <th>Items-Quantity</th>

                            <th>Total Amount</th>

                            <th>Paid Amount</th>

                            <th>Balance</th>

                            <th>Note</th>

                            <th>Salesperson</th>

                            <th>Payment Mode</th>

                            <th>Account Details</th>

                            <th>Action</th>

                        </tr>

                    </thead>

                    <tbody>

                        <?php $i = 1; $b = 0;?>

                        <?php $__currentLoopData = $invoice; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php 
                            $paidAmount = DB::table('stock_invoicepayment')->where('paymentStatus','!=','Cancelled')->where('idInvoice',$var->idInvoice)->sum('paidAmount');
                            $discountAmount = DB::table('stock_invoicepayment')->where('paymentStatus','!=','Cancelled')->where('idInvoice',$var->idInvoice)->sum('discount');
                            $b =  $var->amountPayable - ($paidAmount+ $discountAmount);
                            $payments = DB::table('stock_invoicepayment')->where('paymentStatus','!=','Cancelled')->where('idInvoice',$var->idInvoice)->get();
                        ?>

                        <tr>

                            <th scope="row"><?php echo e($i); ?></th>

                            <td><?php echo e($var->invoiceDate); ?></td>

                            <?php if($var->customerType == "Customer"): ?>
                            <?php $customer = DB::table('customers')->where('idCustomer',$var->idCustomer)->first();?>
                            <td><?php echo e($customer->customerNumber); ?></td>
                            <td><?php echo e($customer->customerName); ?></td>
                            <?php else: ?>
                            <?php if($var->customerType == "Student"): ?>
                            <?php $customer = DB::table('students')->where('idStudent',$var->idCustomer)->first();?>
                            <td><?php echo e($customer->ecNo); ?></td>
                            <td><?php echo e($customer->firstName); ?> <?php echo e($customer->lastName); ?></td>
                            <?php else: ?>
                            <?php $customer = DB::table('employees')->where('idEmployee',$var->idCustomer)->first();?>
                            <td><?php echo e($customer->enrollmentNo); ?></td>
                            <td><?php echo e($customer->firstName); ?>  <?php echo e($customer->lastName); ?></td>
                            <?php endif; ?>
                            <?php endif; ?>

                            <td><?php echo e($var->invoiceNo); ?></td>

                            <?php $products = DB::table('invoice_details')->join('products','invoice_details.idProduct','=','products.idProduct')->where('idInvoice',$var->idInvoice)->get(); ?>
                            <td>
                                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <p><?php echo e($product->productName); ?> - x(<?php echo e($product->quantity); ?>)</p>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>

                            <td><?php echo e($var->amountPayable); ?></td>

                            <td><?php echo e($paidAmount); ?></td>

                            <td><?php if($b >= 0): ?><?php echo e($b); ?> <?php else: ?> 0.00 <?php endif; ?></td>

                            <td><?php echo e($var->notes); ?></td>

                            <td><?php echo e($var->salesperson); ?></td>

                            <td>
                            <?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if($pay->paymentMode != "Unpaid"): ?>
                            <?php echo e($pay->paymentMode); ?> (<?php echo e($pay->paidAmount); ?>)<br>
                            <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>
                            <td style="text-transform: uppercase;">
                            <?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if($pay->paymentMode == "IMPS"): ?>
                            <?php $account = DB::table('account_paid')->where('idAccount',$pay->idAccount)->first(); ?>
                                <?php echo e($account->accountName); ?><br>
                                <?php echo e($account->accountNo); ?><br>
                                 <?php echo DB::table('banks')->where('idBank',$account->idPayBank)->first()->bankName;?>
                            <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </td>

                            <td>

                                <a href="<?php echo e(url('school/invoices/'.$var->idInvoice.'/print')); ?>" target="_blank" class="btn btn-sm btn-success">Reprint</a> 

                                <a href="<?php echo e(url('school/invoices/'.$var->idInvoice.'/receipts')); ?>"  class="btn btn-sm btn-danger">Cancel Receipt</a> 

                                <?php if($b>0): ?>

                                <a href="<?php echo e(url('school/invoices/'.$var->idInvoice.'/paybalance')); ?>" class="btn btn-sm btn-warning">Pay Balance Amount</a>

                                <?php endif; ?>
                                

                            </td>

                        </tr>

                        <?php $i++; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        

                    </tbody>

                </table>

            </div>

        </div>

    </div>

</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>

<script>
$('#js-inventory').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
    } );    

$(document).ready(function() {

    $('select[name="idProductCategory"]').on('change', function() {

        var categoryID = $(this).val();

        if(categoryID!='All') {

            $.ajax({

                url: "<?php echo e(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>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7