<?php $__env->startSection('content'); ?>
<?php
use App\Models\ProductUnits;
use App\Models\ProductsPurchases;
use App\Models\ProductsStoresTransfers;
use App\Models\ProductsStartPeriods;
use App\Models\OutcomManufacturingModel;
use App\Models\Measuerments;
use App\Models\ProductsQty;
?>
<?php
use App\Models\CompanyData;
$Def=CompanyData::orderBy('id','desc')->first();
?>

<title> <?php echo e(trans('admin.StoresInventory')); ?></title>
<main id="js-page-content" role="main" class="page-content">
   <ol class="breadcrumb page-breadcrumb no-print">
      <li class="breadcrumb-item"><a href="javascript:void(0);"> <?php echo e(trans('admin.Reports')); ?></a></li>
      <li class="breadcrumb-item active">  <?php echo e(trans('admin.StoresInventory')); ?> </li>
      <li class="position-absolute pos-top pos-right d-none d-sm-block"><span
         class="js-get-date"></span></li>
   </ol>
                              <!-- Head Of Print -->
                     <div class="row Headerrr">
                      <div class="col-4">
                            <div id="panel-1" class="panel d-none d-print-block" style="margin-top:30px;">
                      <div class="row invoive-info ">

                                          <div  style="text-align: center;" class="col-md-4 col-sm-4 col-4 invoice-client-info">
                                                <div class="style-info">
                                                    <h1 class="HeaderInvoice" style="text-align: center;font-size:15px" class="m-0">
                                               <?php if(!empty($Def->Name)): ?>
                      <?php echo e($Def->Name); ?>

                      <?php else: ?>
                       <?php echo e(trans('admin.Klar')); ?>

                      <?php endif; ?>
                                                    </h1>
                              <h3  style="text-align: center;font-size:15px" class=" m-10">
                         <?php if(!empty($Def->Print_Text)): ?>
                      <?php echo e($Def->Print_Text); ?>

                      <?php endif; ?>
                                                    </h3>
                                                </div>
                                            </div>

                                        </div>
                                        <hr>
                                        </div>
                                        </div>

                              <div class="col-4 text-center" >
                            <div id="panel-1" class="panel d-none d-print-block" style="margin-top:30px;">
                      <div class="row invoive-info " style="display:flex;  justify-content: center;">

                                            <div style="text-align: center;" class="col-md-5 col-sm-5 col-5 invoice-client-info" style="border:unset;">
                                                <h1 style="text-align: center;" class="HeaderInvoice"> <?php echo e(trans('admin.StoresInventory')); ?> </h1>
                                            </div>

                                        </div>
                                        <hr>
                                        </div>
                                        </div>

                                <div class="col-4">
                            <div id="panel-1" class="panel d-none d-print-block" style="margin-top:30px;">
                      <div class="row invoive-info "style="display:flex;         justify-content: flex-end;">

                                   <div  style="text-align: center; " class="col-md-3 col-sm-3 col-3 invoice-client-info">
                         <div class="style-info">
                       <?php if(!empty($Def->Logo)): ?>
    <img class="logoPri" style="height: 50px; " class="img-fluid" src="<?php echo e(URL::to($Def->Logo)); ?>" alt="Logo" />

                    <?php else: ?>
 <img class="logoPri" style="height: 50px; width: 150px;" class="img-fluid" src="https://klarerp.com/site/img/theme/logo.png" alt="Logo" />
                      <?php endif; ?>

                                       </div>
                                            </div>


                                        </div>
                                        <hr>
                                        </div>
                                        </div>

                                        </div>





   <!-- Data -->
   <div class="row hide-table">
      <div class="col-xl-12">
         <div id="panel-1" class="panel second-color">
            <div class="panel-hdr">
               <h2>
                  <?php echo e(trans('admin.StoresInventory')); ?>

               </h2>
               <div class="panel-toolbar">
                  <button class="btn btn-primary btn-sm" data-toggle="dropdown">Table
                  Style</button>

              <form action="<?php echo e(url('StoresInventoryNewPrint')); ?>" method="get">
                 <?php echo view('honeypot::honeypotFormFields'); ?>
                  <div class="row" style="display: none">




                    <?php if(!empty($group)): ?>

                      <?php for($i=0 ; $i < count($group) ; $i++): ?>
                    <input type="hidden" name="Group[]" value="<?php echo e($group[$i]); ?>">
                      <?php endfor; ?>

                <?php else: ?>
                     <input type="hidden" name="Group" value="">
             <?php endif; ?>
                 <?php if(!empty($brand)): ?>

                      <?php for($i=0 ; $i < count($brand) ; $i++): ?>
                    <input type="hidden" name="Brand[]" value="<?php echo e($brand[$i]); ?>">
                      <?php endfor; ?>

             <?php else: ?>
                     <input type="hidden" name="Brand" value="">
          <?php endif; ?>



                  <input type="hidden" name="Branch" value="<?php echo e($branch); ?>">
                  <input type="hidden" name="Product_Name" value="<?php echo e($product_Name); ?>">
                  <input type="hidden" name="Product_Code" value="<?php echo e($product_Code); ?>">
                  <input type="hidden" name="Zero" value="<?php echo e($zero); ?>">
                    <input type="hidden" name="Store" id="Store" value="<?php echo e($store); ?>">

                  </div>

                     <button type="submit" class="btn btn-primary btn-sm" style="display: none" >
                                                    <i class="fal fa-print"><?php echo e(trans('admin.Print')); ?></i>
                                                    </button>
                </form>

                    <form action="<?php echo e(url('ExportStoresQtyyyRased')); ?>" method="get">
                 <?php echo view('honeypot::honeypotFormFields'); ?>
                  <div class="row" style="display: none">




                    <?php if(!empty($group)): ?>

                      <?php for($i=0 ; $i < count($group) ; $i++): ?>
                    <input type="hidden" name="Group[]" value="<?php echo e($group[$i]); ?>">
                      <?php endfor; ?>

                <?php else: ?>
                     <input type="hidden" name="Group" value="">
             <?php endif; ?>
                 <?php if(!empty($brand)): ?>

                      <?php for($i=0 ; $i < count($brand) ; $i++): ?>
                    <input type="hidden" name="Brand[]" value="<?php echo e($brand[$i]); ?>">
                      <?php endfor; ?>

             <?php else: ?>
                     <input type="hidden" name="Brand" value="">
          <?php endif; ?>



                  <input type="hidden" name="Branch" value="<?php echo e($branch); ?>">
                  <input type="hidden" name="Product_Name" value="<?php echo e($product_Name); ?>">
                  <input type="hidden" name="Product_Code" value="<?php echo e($product_Code); ?>">
                  <input type="hidden" name="Zero" value="<?php echo e($zero); ?>">
                    <input type="hidden" name="Store" id="Store" value="<?php echo e($store); ?>">

                  </div>

                     <button type="submit" class="btn btn-success btn-sm" >
                                                    <i class="fal fa-excel">Excel All Data</i>
                                                    </button>
                </form>

                     <form action="<?php echo e(url('ExportStoresQtyyyRasedSerial')); ?>" method="get">
                 <?php echo view('honeypot::honeypotFormFields'); ?>
                  <div class="row" style="display: none">




                    <?php if(!empty($group)): ?>

                      <?php for($i=0 ; $i < count($group) ; $i++): ?>
                    <input type="hidden" name="Group[]" value="<?php echo e($group[$i]); ?>">
                      <?php endfor; ?>

                <?php else: ?>
                     <input type="hidden" name="Group" value="">
             <?php endif; ?>
                 <?php if(!empty($brand)): ?>

                      <?php for($i=0 ; $i < count($brand) ; $i++): ?>
                    <input type="hidden" name="Brand[]" value="<?php echo e($brand[$i]); ?>">
                      <?php endfor; ?>

             <?php else: ?>
                     <input type="hidden" name="Brand" value="">
          <?php endif; ?>



                  <input type="hidden" name="Branch" value="<?php echo e($branch); ?>">
                  <input type="hidden" name="Product_Name" value="<?php echo e($product_Name); ?>">
                  <input type="hidden" name="Product_Code" value="<?php echo e($product_Code); ?>">
                  <input type="hidden" name="Zero" value="<?php echo e($zero); ?>">
                    <input type="hidden" name="Store" id="Store" value="<?php echo e($store); ?>">

                  </div>

                     <button type="submit" class="btn btn-success btn-sm" >
                                                    <i class="fal fa-excel">Excel All Data (Serail)</i>
                                                    </button>
                </form>

             <?php echo $__env->make('admin.layouts.toolbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
               </div>
            </div>
            <div class="panel-container show">
               <span id="ex"> <?php echo $__env->make('admin.layouts.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></span>
               <div class="panel-content">
                  <!-- datatable start -->
                     <div class="over-flow">
                                        <table id="X"
                                            class="table table-bordered table-hover w-100 table-striped ">
                                            <thead class="bg-highlight">
                                                       <tr>
                                                     <th><?php echo e(trans('admin.Code')); ?> </th>
                                                    <th><?php echo e(trans('admin.Name')); ?> </th>
                                                    <th><?php echo e(trans('admin.Unit')); ?> </th>
                                                    <th><?php echo e(trans('admin.Qty')); ?> </th>

                                                </tr>
                                            </thead>


                                            <tbody>
                                                <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                             <?php
        $units=ProductUnits::where('Product',$rows->Product)->get();
            $rr=ProductUnits::where('Product',$rows->Product)->where('Def',1)->first();
  $plow=ProductUnits::where('Product',$rows->Product)->where('Rate',1)->first();


                                            ?>


             <?php if($rows->Product()->first()->P_Type == 'Completed' or $rows->Product()->first()->P_Type == 'Raw' or $rows->Product()->first()->P_Type == 'Industrial'): ?>
       <tr>

       <td>
      <input type="text" id="CodeStart<?php echo e($rows->id); ?>" class="form-control" value="<?php echo e($rr->Barcode); ?>"  disabled>
      <input type="hidden" id="Product<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Product); ?>" >
      <input type="hidden" id="Store<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Store); ?>" >
       </td>
        <td>


             <?php echo e(app()->getLocale() == 'ar' ?$rows->P_Ar_Name :$rows->P_En_Name); ?>

            <?php if(!empty($rows->Product()->first()->Space)): ?>  (<?php echo e($rows->Product()->first()->Space); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Storage)): ?>  (<?php echo e($rows->Product()->first()->Storage); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Processor)): ?>  (<?php echo e($rows->Product()->first()->Processor); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Camera)): ?>  (<?php echo e($rows->Product()->first()->Camera); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Screen)): ?>  (<?php echo e($rows->Product()->first()->Screen); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->OS)): ?>  (<?php echo e($rows->Product()->first()->OS); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Battery)): ?>  (<?php echo e($rows->Product()->first()->Battery); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Warranty)): ?>  (<?php echo e($rows->Product()->first()->Warranty); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Color)): ?>  (<?php echo e($rows->Product()->first()->Color); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Category)): ?>  (<?php echo e($rows->Product()->first()->Category); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Model)): ?>  (<?php echo e($rows->Product()->first()->Model); ?>) <?php endif; ?>
        </td>

        <td>
             <select class="select2 form-control w-100"   id="UnitStart<?php echo e($rows->id); ?>" onchange="UnitCodeStartt(<?php echo e($rows->id); ?>)">
                <option value=""><?php echo e(trans('admin.Choice_Unit')); ?></option>

            <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $uni): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <?php  $nam=Measuerments::find($uni->Unit); ?>



            <option value="<?php echo e($uni->Unit); ?>";  <?php if($uni->Def == 1): ?>   selected  <?php endif; ?> >    <?php if(!empty($uni->Unit()->first()->Name)): ?>

        <?php echo e(app()->getLocale() == 'ar' ?$uni->Unit()->first()->Name :$uni->Unit()->first()->NameEn); ?>


                <?php endif; ?>  </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
        </td>


         <td>
      <input type="text" id="Qty<?php echo e($rows->id); ?>" class="form-control Qun" value="<?php echo e($rows->Qty / $rr->Rate); ?>"  disabled>
       </td>



        </tr>



        <?php elseif($rows->Product()->first()->P_Type == 'Serial'): ?>

    <?php  $SerialQty=ProductsQty::where('Product',$rows->Product)->where('Store',$rows->Store)->get()->sum('Qty');  ?>

       <tr>

       <td>
           <input type="text" id="CodeStart<?php echo e($rows->id); ?>" class="form-control" value="<?php echo e($rr->Barcode); ?>"  disabled>
      <input type="hidden" id="Product<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Product); ?>" >
              <input type="hidden" id="Store<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Store); ?>" >
       </td>

       <td>
     <?php echo e(app()->getLocale() == 'ar' ?$rows->P_Ar_Name :$rows->P_En_Name); ?>

            <?php if(!empty($rows->Product()->first()->Space)): ?>  (<?php echo e($rows->Product()->first()->Space); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Storage)): ?>  (<?php echo e($rows->Product()->first()->Storage); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Processor)): ?>  (<?php echo e($rows->Product()->first()->Processor); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Camera)): ?>  (<?php echo e($rows->Product()->first()->Camera); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Screen)): ?>  (<?php echo e($rows->Product()->first()->Screen); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->OS)): ?>  (<?php echo e($rows->Product()->first()->OS); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Battery)): ?>  (<?php echo e($rows->Product()->first()->Battery); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Warranty)): ?>  (<?php echo e($rows->Product()->first()->Warranty); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Color)): ?>  (<?php echo e($rows->Product()->first()->Color); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Category)): ?>  (<?php echo e($rows->Product()->first()->Category); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Model)): ?>  (<?php echo e($rows->Product()->first()->Model); ?>) <?php endif; ?>
        </td>

        <td>
             <select class="select2 form-control w-100"   id="UnitStart<?php echo e($rows->id); ?>" onchange="UnitCodeStartt(<?php echo e($rows->id); ?>)">
                <option value="">  <?php echo e(trans('admin.Choice_Unit')); ?></option>

            <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $uni): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php  $nam=Measuerments::find($uni->Unit); ?>

         <option value="<?php echo e($uni->Unit); ?>";  <?php if($uni->Def == 1): ?>   selected  <?php endif; ?> >    <?php if(!empty($uni->Unit()->first()->Name)): ?>

        <?php echo e(app()->getLocale() == 'ar' ?$uni->Unit()->first()->Name :$uni->Unit()->first()->NameEn); ?>


                <?php endif; ?>  </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
        </td>


         <td>
      <input type="text" id="Qty<?php echo e($rows->id); ?>" class="form-control Qun" value="<?php echo e($SerialQty); ?>"  disabled>
       </td>



        </tr>


        <?php elseif($rows->Product()->first()->P_Type == 'Single_Variable'): ?>



       <tr>

       <td>

                  <input type="text" id="CodeStart<?php echo e($rows->id); ?>" class="form-control" value="<?php echo e($rows->P_Code); ?>"  disabled>
      <input type="hidden" id="Product<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Product); ?>" >
              <input type="hidden" id="Store<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Store); ?>" >
       </td>


         <td>

             <?php echo e(app()->getLocale() == 'ar' ?$rows->P_Ar_Name :$rows->P_En_Name); ?>      <?php echo e(app()->getLocale() == 'ar' ?$rows->V1()->first()->Name :$rows->V1()->first()->NameEn); ?>

            <?php if(!empty($rows->Product()->first()->Space)): ?>  (<?php echo e($rows->Product()->first()->Space); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Storage)): ?>  (<?php echo e($rows->Product()->first()->Storage); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Processor)): ?>  (<?php echo e($rows->Product()->first()->Processor); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Camera)): ?>  (<?php echo e($rows->Product()->first()->Camera); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Screen)): ?>  (<?php echo e($rows->Product()->first()->Screen); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->OS)): ?>  (<?php echo e($rows->Product()->first()->OS); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Battery)): ?>  (<?php echo e($rows->Product()->first()->Battery); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Warranty)): ?>  (<?php echo e($rows->Product()->first()->Warranty); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Color)): ?>  (<?php echo e($rows->Product()->first()->Color); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Category)): ?>  (<?php echo e($rows->Product()->first()->Category); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Model)): ?>  (<?php echo e($rows->Product()->first()->Model); ?>) <?php endif; ?>
        </td>

        <td>
             <select class="select2 form-control w-100"   id="UnitStart<?php echo e($rows->id); ?>" onchange="UnitCodeStart(<?php echo e($rows->id); ?>)">
                <option value="">  <?php echo e(trans('admin.Choice_Unit')); ?></option>
            <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $uni): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <?php  $nam=Measuerments::find($uni->Unit); ?>

          <option value="<?php echo e($uni->Unit); ?>";  <?php if($uni->Def == 1): ?>   selected  <?php endif; ?> >    <?php if(!empty($uni->Unit()->first()->Name)): ?>

        <?php echo e(app()->getLocale() == 'ar' ?$uni->Unit()->first()->Name :$uni->Unit()->first()->NameEn); ?>


                <?php endif; ?>  </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
        </td>



        <td>
      <input type="text" id="Qty<?php echo e($rows->id); ?>" class="form-control Qun" value="<?php echo e($rows->Qty / $rr->Rate); ?>"  disabled>
       </td>



        </tr>


        <?php elseif($rows->Product()->first()->P_Type == 'Duble_Variable'): ?>



       <tr>

       <td>

                  <input type="text" id="CodeStart<?php echo e($rows->id); ?>" class="form-control" value="<?php echo e($rows->P_Code); ?>"  disabled>
      <input type="hidden" id="Product<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Product); ?>" >
              <input type="hidden" id="Store<?php echo e($rows->id); ?>"  value="<?php echo e($rows->Store); ?>" >
       </td>


     <td>
     <?php echo e(app()->getLocale() == 'ar' ?$rows->P_Ar_Name :$rows->P_En_Name); ?>      <?php echo e(app()->getLocale() == 'ar' ?$rows->V1()->first()->Name :$rows->V1()->first()->NameEn); ?>

 <?php echo e(app()->getLocale() == 'ar' ?$rows->V2()->first()->Name :$rows->V2()->first()->NameEn); ?>

            <?php if(!empty($rows->Product()->first()->Space)): ?>  (<?php echo e($rows->Product()->first()->Space); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Storage)): ?>  (<?php echo e($rows->Product()->first()->Storage); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Processor)): ?>  (<?php echo e($rows->Product()->first()->Processor); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Camera)): ?>  (<?php echo e($rows->Product()->first()->Camera); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Screen)): ?>  (<?php echo e($rows->Product()->first()->Screen); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->OS)): ?>  (<?php echo e($rows->Product()->first()->OS); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Battery)): ?>  (<?php echo e($rows->Product()->first()->Battery); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Warranty)): ?>  (<?php echo e($rows->Product()->first()->Warranty); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Color)): ?>  (<?php echo e($rows->Product()->first()->Color); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Category)): ?>  (<?php echo e($rows->Product()->first()->Category); ?>) <?php endif; ?>
            <?php if(!empty($rows->Product()->first()->Model)): ?>  (<?php echo e($rows->Product()->first()->Model); ?>) <?php endif; ?>
        </td>

        <td>
             <select class="select2 form-control w-100"   id="UnitStart<?php echo e($rows->id); ?>" onchange="UnitCodeStart(<?php echo e($rows->id); ?>)">
                <option value="">    <?php echo e(trans('admin.Choice_Unit')); ?></option>
            <?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $uni): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <?php  $nam=Measuerments::find($uni->Unit); ?>

    <option value="<?php echo e($uni->Unit); ?>";  <?php if($uni->Def == 1): ?>   selected  <?php endif; ?> >    <?php if(!empty($uni->Unit()->first()->Name)): ?>

        <?php echo e(app()->getLocale() == 'ar' ?$uni->Unit()->first()->Name :$uni->Unit()->first()->NameEn); ?>


                <?php endif; ?>  </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
        </td>


        <td>
      <input type="text" id="Qty<?php echo e($rows->id); ?>" class="form-control Qun" value="<?php echo e($rows->Qty / $rr->Rate); ?>"  disabled>
       </td>


        </tr>


              <?php endif; ?>





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


                                        </table>
                                        </div>

                   <div class="dataTables_paginate paging_simple_numbers" id="X_paginate">
                        <?php echo e($items->Links()); ?>

                   </div>

                  <!-- datatable end -->
                                    <div class="panel-content">
                                             <div id="mobile-overflow">
                                        <table class="table table-bordered table-hover table-striped w-100 mt-4 mobile-width">
                                            <tbody>
                                                <tr>
                                                    <td> <?php echo e(trans('admin.Products_Num')); ?> </td>
                                                    <td  id="PRONUMS"><?php echo e($Products_Num); ?></td>
                                                    <td> <?php echo e(trans('admin.Total_Qty')); ?></td>
                                                    <td  id="TOTALQTY"><?php echo e($Total_Qty); ?></td>

                                                </tr>
                                                <tr>


                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    </div>
           </div>
            </div>
         </div>
      </div>
   </div>


</main>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('js'); ?>
   <link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/datagrid/datatables/datatables.bundle.css')); ?>">
    <link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/formplugins/summernote/summernote.css')); ?>">
    <link rel="stylesheet" media="screen, print" href="<?php echo e(asset('Admin/css/formplugins/select2/select2.bundle.css')); ?>">

 <script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.export.js')); ?>"></script>
    <script src="<?php echo e(asset('Admin/js/datagrid/datatables/datatables.bundle.js')); ?>"></script>
    <script src="<?php echo e(asset('Admin/js/formplugins/summernote/summernote.js')); ?>"></script>
    <script src="<?php echo e(asset('Admin/js/formplugins/select2/select2.bundle.js')); ?>"></script>
<script type="text/javascript" src="https://unpkg.com/xlsx@0.15.1/dist/xlsx.full.min.js"></script>
    <script>
        //_fnFeatureHtmlLength();
        $(document).ready(function () {
            // Setup - add a text input to each footer cell
            $('#dt-basic-example thead tr').clone(true).appendTo('#dt-basic-example thead');
            $('#dt-basic-example thead tr:eq(1) th').each(function (i) {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control form-control-sm" placeholder="Search ' + '" />');

                $('input', this).on('keyup change', function () {
                    if (table.column(i).search() !== this.value) {
                        table
                            .column(i)
                            .search(this.value)
                            .draw();
                    }
                });
            });
            var table = $('#dt-basic-example').DataTable(
                {
                    // responsive: true,
                    orderCellsTop: true,
                    fixedHeader: true,
                    lengthChange: true,

                    dom: "<'row mb-3'<'col-sm-12 col-md-3 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-9 d-flex align-items-center justify-content-end'B>>" +
                        "<'row'<'col-sm-12'tr>>" +
                        "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",

                    buttons: [
                        {
                            extend: 'pageLength',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'colvis',
                            text: 'Column Visibility',
                            titleAttr: 'Col visibility',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'pdfHtml5',
                            text: 'PDF',
                            titleAttr: 'Generate PDF',
                            className: 'btn-outline-danger btn-sm mr-1'
                        },
                        {
                            extend: 'excelHtml5',
                            exportOptions: {
                                format: {
                                    body: function ( inner, rowidx, colidx, node ) {
                                        if ($(node).children("select").length > 0) {
                                            // we are in a cell containing a "select" drop-down - so, get it:
                                            var selectNode = node.firstElementChild;
                                            var txt = selectNode.options[selectNode.selectedIndex].text;
                                            //var txt = selectNode.options[selectNode.selectedIndex].text;
                                            return txt;
                                        } else {

                                            if ($(node).children("input").length > 0) {
                                                return $(node).children("input").first().val();
                                            } else {
                                                return inner;
                                            }


                                        }
                                    }
                                }
                            },
                            text: 'Excel',
                            titleAttr: 'Generate Excel',
                            className: 'btn-outline-success btn-sm mr-1'
                        },
                        {
                            extend: 'csvHtml5',
                            text: 'CSV',
                            titleAttr: 'Generate CSV',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'copyHtml5',
                            text: 'Copy',
                            titleAttr: 'Copy to clipboard',
                            className: 'btn-outline-primary btn-sm mr-1'
                        },
                        {
                            extend: 'print',
                            text: 'Print',
                            titleAttr: 'Print Table',
                            className: 'btn-outline-primary btn-sm'
                        }
                    ],
                });
            $('.js-thead-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example thead').removeClassPrefix('bg-').addClass(theadColor);
            });

            $('.js-tbody-colors a').on('click', function () {
                var theadColor = $(this).attr("data-bg");
                console.log(theadColor);
                $('#dt-basic-example').removeClassPrefix('bg-').addClass(theadColor);
            });

        });

    </script>
     <script>

        var autoSave = $('#autoSave');
        var interval;
        var timer = function()
        {
            interval = setInterval(function()
            {
                //start slide...
                if (autoSave.prop('checked'))
                    saveToLocal();

                clearInterval(interval);
            }, 3000);
        };

        //save
        var saveToLocal = function()
        {
            localStorage.setItem('summernoteData', $('#saveToLocal').summernote("code"));
            console.log("saved");
        }

        //delete
        var removeFromLocal = function()
        {
            localStorage.removeItem("summernoteData");
            $('#saveToLocal').summernote('reset');
        }

        $(document).ready(function()
        {
            //init default
            $('.js-summernote').summernote(
            {
                height: 200,
                tabsize: 2,
                placeholder: "Type here...",
                dialogsFade: true,
                toolbar: [
                    ['style', ['style']],
                    ['font', ['strikethrough', 'superscript', 'subscript']],
                    ['font', ['bold', 'italic', 'underline', 'clear']],
                    ['fontsize', ['fontsize']],
                    ['fontname', ['fontname']],
                    ['color', ['color']],
                    ['para', ['ul', 'ol', 'paragraph']],
                    ['height', ['height']]
                    ['table', ['table']],
                    ['insert', ['link', 'picture', 'video']],
                    ['view', ['fullscreen', 'codeview', 'help']]
                ],
                callbacks:
                {
                    //restore from localStorage
                    onInit: function(e)
                    {
                        $('.js-summernote').summernote("code", localStorage.getItem("summernoteData"));
                    },
                    onChange: function(contents, $editable)
                    {
                        clearInterval(interval);
                        timer();
                    }
                }
            });

            //load emojis
            $.ajax(
            {
                url: 'https://api.github.com/emojis',
                async: false
            }).then(function(data)
            {
                window.emojis = Object.keys(data);
                window.emojiUrls = data;
            });

            //init emoji example
            $(".js-hint2emoji").summernote(
            {
                height: 100,
                toolbar: false,
                placeholder: 'type starting with : and any alphabet',
                hint:
                {
                    match: /:([\-+\w]+)$/,
                    search: function(keyword, callback)
                    {
                        callback($.grep(emojis, function(item)
                        {
                            return item.indexOf(keyword) === 0;
                        }));
                    },
                    template: function(item)
                    {
                        var content = emojiUrls[item];
                        return '<img src="' + content + '" width="20" /> :' + item + ':';
                    },
                    content: function(item)
                    {
                        var url = emojiUrls[item];
                        if (url)
                        {
                            return $('<img />').attr('src', url).css('width', 20)[0];
                        }
                        return '';
                    }
                }
            });

            //init mentions example
            $(".js-hint2mention").summernote(
            {
                height: 100,
                toolbar: false,
                placeholder: "type starting with @",
                hint:
                {
                    mentions: ['jayden', 'sam', 'alvin', 'david'],
                    match: /\B@(\w*)$/,
                    search: function(keyword, callback)
                    {
                        callback($.grep(this.mentions, function(item)
                        {
                            return item.indexOf(keyword) == 0;
                        }));
                    },
                    content: function(item)
                    {
                        return '@' + item;
                    }
                }
            });

        });

    </script>

<script type="text/javascript">
   $(".show-table").click(function(){
       $(".hide-table").show();
   });

</script>
<style>
   @media  print {
   /*body * {*/
   /*	visibility: hidden;*/
   /*}*/
   .modal-content * {
   visibility: visible;
   overflow: visible;
   }
   .main-page  {
   display: none!important;
   }
   .modal {
   position: absolute;
   left: 0;
   top:-130px;
   right:0;
   margin: 0;
   padding: 0;
   /*min-height: 550px;*/
   /*visibility: visible;*/
   overflow: visible !important; /* Remove scrollbar for printing. */
   font-size:20px!important;
   }
   .modal-dialog {
   /*visibility: visible !important;*/
   overflow: visible !important; /* Remove scrollbar for printing. */
   }
   body{
   position:relative;
   }

</style>
<!-- Search Selecet -->
<script>
   $(document).ready(function () {
       $(function () {
           $(".select2").select2();

           $(".select2-placeholder-multiple").select2({
               placeholder: "Select State",
           });
           $(".js-hide-search").select2({
               minimumResultsForSearch: 1 / 0,
           });
           $(".js-max-length").select2({
               maximumSelectionLength: 2,
               placeholder: "Select maximum 2 items",
           });
           $(".select2-placeholder").select2({
               placeholder: "Select a state",
               allowClear: true,
           });

           $(".js-select2-icons").select2({
               minimumResultsForSearch: 1 / 0,
               templateResult: icon,
               templateSelection: icon,
               escapeMarkup: function (elm) {
                   return elm;
               },
           });

           function icon(elm) {
               elm.element;
               return elm.id ? "<i class='" + $(elm.element).data("icon") + " mr-2'></i>" + elm.text : elm.text;
           }

           $("#Emp").select2({
               placeholder: "select...",
               ajax: {
                   type: "GET",
                   dataType: "json",
                   url: "AllEmps",
                   processResults: function (data) {
                       return {
                           results: $.map(data, function (obj, index) {
                               return { id: index, text: obj };
                           }),
                       };

                       console.log(data);
                   },
                   data: function (params) {
                       var query = {
                           search: params.term,
                       };
                       if (params.term == "*") query.items = [];
                       return { json: JSON.stringify(query) };
                   },
               },
           });

           $("#Emp").on("select2:select", function (e) {
               console.log("select done", e.params.data);
           });
       });
   });
</script>

   <!-- Unit Code and Name V -->
   <script>
       function  UnitCodeStart(x){

           var countryId = $('#UnitStart'+x).val();
           var Pro = $('#Product'+x).val();
           var code = $('#CodeStart'+x).val();
           var Small = $('#SMALLAVG'+x).val();
           var store = $('#Store').val();
           if(countryId) {
               $.ajax({
                   url: 'UnitNameCodeInventoryFilterTWO',
                   type:"GET",
                   data:{
                       id:countryId,
                       Pro:Pro,
                       code:code,
                       store:store,
                       small:Small,
                   },
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },

                   success:function(data) {
                       $.each(data, function(key, value){

                           $('#Qty'+x).val(data.qty);
                           $('#AVG'+x).val(parseFloat(data.price));
                           var AVG=  $('#AVG'+x).val();
                           var Qty=  $('#Qty'+x).val();

                           var Rsu = parseFloat(Qty) * parseFloat(AVG) ;

                           $('#COST'+x).val(parseFloat(Rsu));



                           $.fn.rowCount = function() {
                               return $('tr', $(this).find('tbody')).length;
                           };

                           var rowctr = $('#X').rowCount();

                           var sumQ = 0;
                           $('.Qun').each(function(){
                               sumQ += parseFloat($(this).val());
                           });

                           var sumT = 0;
                           $('.Tot').each(function(){
                               sumT += parseFloat($(this).val());
                           });

                           $('#PRONUMS').text(parseFloat(rowctr));
                           $('#TOTALQTY').text(parseFloat(sumQ));
                           $('#TOTALCOST').text(parseFloat(sumT));

                       });

                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {

               $('select[name="state"]').empty();
           }

       }
   </script>

   <!-- Unit Code and Name -->
   <script>
       function  UnitCodeStartt(x){

           var countryId = $('#UnitStart'+x).val();
           var Pro = $('#Product'+x).val();
           var code = $('#CodeStart'+x).val();
           var store = $('#Store').val();
           var Small = $('#SMALLAVG'+x).val();
           if(countryId) {
               $.ajax({
                   url: 'UnitNameCodeInventoryFilterTWO',
                   type:"GET",
                   data:{
                       id:countryId,
                       Pro:Pro,
                       code:code,
                       store:store,
                       small:Small,
                   },
                   dataType:"json",
                   beforeSend: function(){
                       $('#loader').css("visibility", "visible");
                   },

                   success:function(data) {
                       $.each(data, function(key, value){

                           $('#Qty'+x).val(data.qty);
                           $('#CodeStart'+x).val(data.code);
                           $('#AVG'+x).val(parseFloat(data.price));
                           var AVG=  $('#AVG'+x).val();
                           var Qty=  $('#Qty'+x).val();

                           var Rsu = parseFloat(Qty) * parseFloat(AVG) ;

                           $('#COST'+x).val(parseFloat(Rsu));

                           $.fn.rowCount = function() {
                               return $('tr', $(this).find('tbody')).length;
                           };

                           var rowctr = $('#X').rowCount();

                           var sumQ = 0;
                           $('.Qun').each(function(){
                               sumQ += parseFloat($(this).val());
                           });

                           var sumT = 0;
                           $('.Tot').each(function(){
                               sumT += parseFloat($(this).val());
                           });

                           $('#PRONUMS').text(parseFloat(rowctr));
                           $('#TOTALQTY').text(parseFloat(sumQ));
                           $('#TOTALCOST').text(parseFloat(sumT));


                       });

                   },
                   complete: function(){
                       $('#loader').css("visibility", "hidden");
                   }
               });
           } else {

               $('select[name="state"]').empty();
           }

       }
   </script>

<script>

   var table = $('#X').DataTable(
                {

                    retrieve: true,
                    responsive: true,
                    orderCellsTop: true,
                    fixedHeader: false,
                    lengthChange: true,
                     pageLength : 10,
                    dom: 'Bfrtip',

                    buttons: [
                        {
                            extend: 'pageLength',
                            className: 'btn-outline-default'
                        },
                        {
                            extend: 'colvis',
                            text: 'Column Visibility',
                            titleAttr: 'Col visibility',
                            className: 'btn-outline-default'
                        },

                        {
                            extend: 'excelHtml5',
                            text: 'Excel',
                            titleAttr: 'Generate Excel',
                             exportOptions: {
                modifier: {
                  page: 'all',
                  search: 'none'
                }
                             },
                            className: 'btn-outline-success btn-sm mr-1'
                        },


                        {
                            extend: 'print',
                            text: 'Print',
                            titleAttr: 'Print Table',
                                       exportOptions: {
                modifier: {
                  page: 'all',
                  search: 'none'
                },
                             },
                            className: 'btn-outline-primary btn-sm'
                        }
                    ],
                });


</script>


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

<?php echo $__env->make('admin.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/limraerp/public_html/orient.limraerp.com/resources/views/admin/Reports/StoresInventoryNewFilter.blade.php ENDPATH**/ ?>