
<?php $__env->startSection('title','All Units Summary'); ?>
<?php $__env->startSection('css'); ?>
    <style>
        body {
            overflow-y: hidden;
            /*font-family: "Times New Roman";*/
            color: #000000;
        }
        .table-bordered td, .table-bordered th {
            border: 0.1rem solid rgba(8, 8, 8, 0.33) !important;
        !important;
        }

        h5.heading-title {
            text-transform: initial;
            font-weight: bold;
            letter-spacing: 1px;
        }

        tr th, tr td {
            line-height: 1.0;
            font-size: 15px;
            padding: 7px !important;

        }

        tr th, span strong, div span {
            text-transform: initial;
            font-weight: bold;
        }

        @media  print {
            @page  {
                size: A4 landscape;
                padding: 0 !important;
                margin: 0 !important;
            }
            .table-bordered td, .table-bordered th {
                border: 0.1rem solid rgba(8, 8, 8, 0.50) !important;
            }

            body{
                overflow: hidden !important;
                color: #000000;
            }

            div.card-body{
                margin: auto 20px;
            }

            div.card-body{
                padding-top: 0;
            }
            .table .thead-dark th {
                color: #000 !important;
                background-color: #dadada !important;
                /*border-color: #32383e !important;*/
            }
            /*body {*/
            /*-webkit-print-color-adjust: exact;*/
            /*}*/

        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Stock Register</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="#">Report</a></li>
                        <li class="breadcrumb-item active">Stock Register</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <section class="content no-print">
        <div class="container-fluid">
            
            <div class="col-lg-12 col-sm-8 col-md-6 col-xs-12">
                <div class="card card-primary card-outline">
                    <div class="card-body " style="padding-bottom:0">
                        <?php echo e(Form::open(['route'=>'all-units-summary','method'=>'get'])); ?>


                        <div class="form-row">
                            <div class="form-group col-md-2" >
                                <label>From</label>
                                <input type=""  name="from" class="form-control " value=" <?php echo e(date('d-m-Y', strtotime($from))); ?>">
                            </div>
                            <div class="form-group col-md-2" >
                                <label>To</label>
                                <input type="" name="to" class="form-control " value="<?php echo e(date('d-m-Y', strtotime($to))); ?>">
                            </div>
                            <div class="form-group col-md-3" >
                                <label>Select Unit</label>
                                <?php echo e(Form::select('unit_id',$units,$unit_id,['id'=>'unit_id','class'=>'form-control','placeholder'=>'All Units'])); ?>

                            </div>
                            
                            <div class="form-group col-md-2" style="margin-top: 30px">
                                <button type="submit" class="btn btn-info btn-md btn-block"><i class="fa fa-search"></i>&nbsp;Search</button>
                                
                            </div>
                            <div class="form-group col-md-2" style="margin-top: 30px">
                                <button class="btn btn-success btn-md btn-block" onclick="window.print(); return false;"><i class="fa fa-print"></i>&nbsp;Print</button>
                            </div>

                        </div>
                        <?php echo e(Form::close()); ?>

                    </div>
                </div>
                <!-- /.card -->
            </div>
        </div>
    </section>
    <?php if($unit_stock != null): ?>
    <section class="content">
        <div class="col-lg-12">
            <div class="card"><br>
                <div class="card-body">

                    <div class="row">
                        <div class="col-md-12 text-center">
                            
                            <h3><b>INVENTORY REGISTER</b></h3>
                            <h5>Transaction Type : Purchase</h5>
                            <h6>Report From <?php echo e(dateFormat($from)); ?> To <?php echo e(dateFormat($to)); ?></h6>
                        </div>
                    </div>
                    
                    <table class="table table-hover table-bordered table-condensed text-center" width="100% ">
                        <thead>
                        <tr>
                            <th width="10%" class="text-center">#SL</th>
                            <th width="40%">Unit Name</th>
                            <th width="15%">Cash (BDT)</th>
                            <th width="15%">Credit (BDT)</th>
                            <th width="20%">Total (BDT)</th>
                        </tr>
                        </thead>
                        <tbody>
                            <?php
                                $total_cash = 0;
                                $total_credit = 0;
                            ?>
                            <?php if($all_units != null): ?>
                                <?php $__currentLoopData = $all_units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($key+1); ?></td>
                                        <td class="text-left"><?php echo e($unit->name); ?></td>
                                        <td class="text-right"><?php echo e(number_format($unit_stock[$unit->id]['cash'], 2)); ?></td>
                                        <td class="text-right"><?php echo e(number_format($unit_stock[$unit->id]['credit'], 2)); ?></td>
                                        <td class="text-right"><?php echo e(number_format($unit_stock[$unit->id]['cash'] + $unit_stock[$unit->id]['credit'], 2)); ?></td>
                                    </tr>
                                    <?php
                                    $total_cash += $unit_stock[$unit->id]['cash'];
                                    $total_credit += $unit_stock[$unit->id]['credit'];
                                ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                        </tbody>
                        <tfoot>
                            
                            <tr>
                                <td colspan="2" class="text-right"><b>Grand Total (BDT)</b></td>
                                <td class="text-right"><b><?php echo e(number_format($total_cash,2)); ?></b></td>
                                <td class="text-right"><b><?php echo e(number_format($total_credit,2)); ?></b></td>
                                <td class="text-right"><b><?php echo e(number_format($total_cash + $total_credit,2)); ?></b></td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </section>
    <div class="page_break"></div>
    <?php endif; ?>

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

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

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


<?php $__env->startSection('plugin'); ?>
    <!-- DataTables -->
    <script src="<?php echo e(asset('plugins/datatables/jquery.dataTables.js')); ?>"></script>
    <script src="<?php echo e(asset('plugins/datatables/dataTables.bootstrap4.js')); ?>"></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js'></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.4/jquery-confirm.min.js"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <!-- page script -->
    <script type="text/javascript">
        $('.select2').select2()
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.fixed', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/welluugs/purchase.wellgrouperp.com/resources/views/inventory/goodsin/all_units_summary.blade.php ENDPATH**/ ?>