<?php $__env->startSection('content'); ?>
<?php
use App\Models\ProductSales;
use App\Models\ReciptVoucherDetails;
use App\Models\PaymentVoucherDetails;
use App\Models\CompanyData;
use App\Models\GeneralDaily;
$Def=CompanyData::orderBy('id','desc')->first();
?>

  <title><?php echo e(trans('admin.Shifts_Details')); ?></title>
  	<style>
	@media  print {



	}
	</style>
<style>
 @media  print{
    .PopNo{
        display:block;
    }
     .PopYes{
         display:none;
     }
    .col-md-2 {
             -webkit-box-flex: 0;
        -ms-flex: 0 0 16.66667%;
        flex: 0 0 16.66667%;
        max-width: 10%;


        }
         .col-lg-2{
             -webkit-box-flex: 0;
        -ms-flex: 0 0 16.66667%;
        flex: 0 0 16.66667%;
        max-width: 10%;


        }
        .overr{
            overflow:unset;
        }
        .modal-header{
            display:none;
        }

 }
</style>

     <main id="js-page-content" role="main" class="page-content">
                    <ol class="breadcrumb page-breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0);"><?php echo e(trans('admin.Sales')); ?></a></li>
                        <li class="breadcrumb-item active"> <?php echo e(trans('admin.Shifts_Details')); ?> </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 " id="yes-pop">
                      <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-4 col-sm-4 col-4 invoice-client-info" style="border:unset;">
                                                <h1 style="text-align: center;" class="HeaderInvoice"> <?php echo e(trans('admin.Shifts_Details')); ?> </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-4 col-sm-4 col-4 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>

                     <!-- Filter -->
                   <div class="row" id="no-pop">
                        <div class="col-lg-12">
                            <div id="panel-2" class="panel">
                                <div class="panel-hdr">
                                    <h2>
                                        <span class="fw-300"><i> <?php echo e(trans('admin.Shifts_Details')); ?>  </i></span>
                                    </h2>
                                </div>
                                <div class="panel-container show">
                                    <div class="panel-content">
                                        <form action="<?php echo e(url('FilterShiftDetails')); ?>" method="get" class="form-row">
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="simpleinput"><?php echo e(trans('admin.From')); ?></label>
                                                <input type="date" value="<?php echo e(date('Y-m-d')); ?>" name="From" class="form-control" required>
                                            </div>
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="simpleinput"><?php echo e(trans('admin.To')); ?></label>
                                                <input type="date" value="<?php echo e(date('Y-m-d')); ?>" name="To" class="form-control" required>
                                            </div>
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.Store')); ?> </label>
                                                <select class="select2 form-control w-100" name="Store">
                                            <option value=""> <?php echo e(trans('admin.Store')); ?></option>
                                            <?php $__currentLoopData = $Stores; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($stor->id); ?>">
                                              <?php echo e(app()->getLocale() == 'ar' ?$stor->Name :$stor->NameEn); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.Safe')); ?> </label>
                                                <select class="select2 form-control w-100" name="Safe">
                                             <option value=""> <?php echo e(trans('admin.Safe')); ?></option>
                                            <?php $__currentLoopData = $Safes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $safe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($safe->id); ?>">
                                                  <?php echo e(app()->getLocale() == 'ar' ?$safe->Name :$safe->NameEn); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                            <div class="form-group col-md-2">
                                                <label class="form-label" for="">  <?php echo e(trans('admin.Emp')); ?>  </label>
                                       <select  class="js-data-example-ajax form-control w-100" id="Emp"  name="Emp" >

                                            </select>
                                            </div>
                                            <div class="form-group col-lg-2">
                                      <label class="form-label" for="simpleinput"><?php echo e(trans('admin.Shift_Code')); ?> </label>
                                                <input type="text" name="Code" class="form-control">
                                            </div>

                                            <div class="form-group col-md-2">
                                                <div class="buttons mt-4">
    <button type="submit" class="btn btn-primary show-table w-100"> <i class="fal fa-folder"></i> <?php echo e(trans('admin.Show')); ?></button>
                                                </div>
                                            </div>

                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
            <!-- Data -->
                    <div class="row hide-table" id="no-pop2">
                        <div class="col-xl-12">
                            <div id="panel-1" class="panel">
                                <div class="panel-hdr">
                                    <h2>
                                    <?php echo e(trans('admin.Shifts_Details')); ?>

                                    </h2>

                                    <div class="panel-toolbar">
                                <button class="btn btn-sm btn-primary waves-effect waves-themed " onclick="popp()" style="margin-left:3px"><i class="fal fa-print"></i>  <?php echo e(trans('admin.Print')); ?></button>

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

                                        <?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 style="overflow:auto;" class="overr">
        <table id="" class="table table-bordered table-hover table-striped table-width" >
                                            <thead class="bg-highlight">
                                                <tr>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>
                                                    <th><?php echo e(trans('admin.Type')); ?></th>
                                                    <th><?php echo e(trans('admin.Date')); ?></th>
                                                    <th> <?php echo e(trans('admin.Emp')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Safe')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Store')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Shift_Code')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Total_Price')); ?> </th>
                                                    <th><?php echo e(trans('admin.Details')); ?></th>

                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td><?php echo e($item->Code); ?></td>
                                                    <td><?php echo e(trans('admin.Sales')); ?></td>
                                                    <td><?php echo e($item->Date); ?></td>


                                                        <td>
                                                                <?php if(!empty($item->emp()->first()->Name)): ?>


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

                                                    <?php endif; ?>
                                                    </td>


                                                      <td>

                                                          <?php if(!empty($item->Safe()->first()->Name)): ?>

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

                                                          <?php endif; ?>
                                                       </td>

                                                                        <td>


                                                                            <?php if(!empty($item->Store()->first()->Name)): ?>
                                               <?php echo e(app()->getLocale() == 'ar' ?$item->Store()->first()->Name :$item->Store()->first()->NameEn); ?>

                                                                            <?php endif; ?>
                                                    </td>
                                                      <td>

                                               <?php echo e($item->Shift_Code); ?>

                                                    </td>

                                                    <td>
                                               <?php echo e($item->Total_Price); ?>

                                                    </td>
                                                    <td>
                                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#default-example-modal-center-open<?php echo e($item->id); ?>">
                                                            <?php echo e(trans('admin.Details')); ?>

                                                        </button>
                                                    </td>

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

                                            <?php $__currentLoopData = $Recipts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $res): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>

                                                    <td><?php echo e($res->Code); ?></td>
                                                         <td><?php echo e(trans('admin.Receipt_Voucher')); ?></td>
                                                    <td><?php echo e($res->Date); ?></td>

                                                        <td>
                                                                <?php if(!empty($res->User)): ?>


                                                   <?php echo e(app()->getLocale() == 'ar' ?$res->User()->first()->name :$res->User()->first()->nameEn); ?>


                                                    <?php endif; ?>
                                                    </td>


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


                                                       </td>

                                                    <td>
                                                    <?php if(!empty($res->Store()->first()->Name)): ?>


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

                                                                <?php endif; ?>
                                                    </td>
                                                      <td>

                                               <?php echo e($res->Shift); ?>

                                                    </td>

                                                    <td>
                                               <?php echo e($res->Total_Creditor); ?>

                                                    </td>
                                                    <td>
                                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#recipt<?php echo e($res->id); ?>">
                                                            <?php echo e(trans('admin.Details')); ?>

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

                                            <?php $__currentLoopData = $Payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                     <tr>

                                                    <td><?php echo e($pay->Code); ?></td>
                                                         <td><?php echo e(trans('admin.Payment_Voucher')); ?></td>
                                                    <td><?php echo e($pay->Date); ?></td>


                                                        <td>
                                                                <?php if(!empty($pay->User)): ?>


                                                     <?php echo e(app()->getLocale() == 'ar' ?$pay->User()->first()->name :$pay->User()->first()->nameEn); ?>

                                                    <?php endif; ?>
                                                    </td>


                                                      <td>

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

                                                       </td>

                                                    <td>
                                                    <?php if(!empty($pay->Store()->first()->Name)): ?>
                                            <?php echo e(app()->getLocale() == 'ar' ?$pay->Store()->first()->Name :$pay->Store()->first()->NameEn); ?>

                                                                <?php endif; ?>
                                                    </td>
                                                      <td>

                                               <?php echo e($pay->Shift); ?>

                                                    </td>

                                                    <td>
                                               <?php echo e($pay->Total_Debaitor); ?>

                                                    </td>
                                                    <td>
                                                        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#pay<?php echo e($pay->id); ?>">
                                                            <?php echo e(trans('admin.Details')); ?>

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

                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                    <th><?php echo e(trans('admin.Code')); ?></th>
                                                     <th><?php echo e(trans('admin.Type')); ?></th>
                                                    <th><?php echo e(trans('admin.Date')); ?></th>
                                                    <th> <?php echo e(trans('admin.Emp')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Safe')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Store')); ?> </th>
                                                    <th> <?php echo e(trans('admin.Total_Price')); ?> </th>
                                                    <th><?php echo e(trans('admin.Details')); ?></th>
                                                </tr>
                                            </tfoot>

                                        </table>

                                        <?php echo e($items->Links()); ?>

                                        </div>
                                        <!-- datatable end -->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </main>

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

                        <!-- Modal Details -->
    <div class="modal fade d-lg-no-print" id="default-example-modal-center-open<?php echo e($item->id); ?>" tabindex="-1" role="dialog"
                aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title">
                               <?php echo e(trans('admin.Details')); ?>

                            </h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true"><i class="fal fa-times"></i></span>
                            </button>
                        </div>
                        <div class="modal-body">


                <?php
                $details=ProductSales::where('Sales',$item->id)->get();
                ?>
                        <div class="mt-3">
                             <div>
                            <table id="XXX"
                            class="table table-bordered table-hover table-striped table-width">
                            <thead>
                                <tr>
                                    <th><?php echo e(trans('admin.Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Name')); ?> </th>
                                            <th><?php echo e(trans('admin.Group')); ?> </th>
                                    <th><?php echo e(trans('admin.Brand')); ?> </th>
                                     <th><?php echo e(trans('admin.Unit')); ?> </th>
                                    <th><?php echo e(trans('admin.AvQty')); ?> </th>
                                    <th><?php echo e(trans('admin.Qty')); ?> </th>
                                    <th><?php echo e(trans('admin.Price')); ?> </th>
                                    <th><?php echo e(trans('admin.Discount')); ?> </th>
                                    <th><?php echo e(trans('admin.Total_Bf_Tax')); ?> </th>
                                    <th><?php echo e(trans('admin.Total_Tax')); ?> </th>
                                    <th><?php echo e(trans('admin.Total')); ?> </th>
                                    <th><?php echo e(trans('admin.Store')); ?> </th>
                                    <th><?php echo e(trans('admin.Exp_Date')); ?> </th>
                                </tr>
                            </thead>
                            <tbody id="">
                                <?php $__currentLoopData = $details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($detail->Product_Code); ?></td>
                                    <td>



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


                                <?php if(!empty($detail->V1)): ?>    (  <?php echo e(app()->getLocale() == 'ar' ?$detail->V1()->first()->Name :$detail->V1()->first()->NamEn); ?>   )  <?php endif; ?>
                                  <?php if(!empty($detail->V2)): ?>   (  <?php echo e(app()->getLocale() == 'ar' ?$detail->V2()->first()->Name :$detail->V2()->first()->NamEn); ?>   )  <?php endif; ?>
                                    </td>
                                                <td>

                                                 <?php if(!empty($detail->Product()->first()->Group()->first()->Name)): ?>
                                 <?php echo e(app()->getLocale() == 'ar' ?$detail->Product()->first()->Group()->first()->Name :$detail->Product()->first()->Group()->first()->NameEn); ?>                    <?php endif; ?>
                                    </td>
                                         <td>
                                            <?php if(!empty($detail->Product()->first()->Brand)): ?>

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


                                            <?php endif; ?>
                                    </td>
                                    <td>

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

                                    </td>
                                    <td><?php echo e($detail->AvQty); ?></td>
                                    <td><?php echo e($detail->Qty); ?></td>
                                    <td><?php echo e($detail->Price); ?></td>
                                    <td><?php echo e($detail->Discount); ?></td>
                                    <td><?php echo e($detail->Total_Bf_Tax); ?></td>
                                    <td><?php echo e($detail->Total_Tax); ?></td>
                                    <td><?php echo e($detail->Total); ?></td>
                                    <td>

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

                                    </td>
                                    <td><?php echo e($detail->Exp_Date); ?></td>

                                </tr>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                            <tfoot>
                                <tr>
                                  <th><?php echo e(trans('admin.Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Name')); ?> </th>
                                            <th><?php echo e(trans('admin.Group')); ?> </th>
                                    <th><?php echo e(trans('admin.Brand')); ?> </th>
                                     <th><?php echo e(trans('admin.Unit')); ?> </th>
                                    <th><?php echo e(trans('admin.AvQty')); ?> </th>
                                    <th><?php echo e(trans('admin.Qty')); ?> </th>
                                    <th><?php echo e(trans('admin.Price')); ?> </th>
                                    <th><?php echo e(trans('admin.Discount')); ?> </th>
                                    <th><?php echo e(trans('admin.Total_Bf_Tax')); ?> </th>
                                    <th><?php echo e(trans('admin.Total_Tax')); ?> </th>
                                    <th><?php echo e(trans('admin.Total')); ?> </th>
                                    <th><?php echo e(trans('admin.Store')); ?> </th>
                                    <th><?php echo e(trans('admin.Exp_Date')); ?> </th>
                                </tr>
                            </tfoot>
                        </table>
                        </div>
                        <div >
                        <table id="XXXX" class="table table-bordered table-hover table-striped table-width mt-4" >
                            <tbody>
                                <tr>
                                    <td><?php echo e(trans('admin.Product_Numbers')); ?></td>
                                    <td><?php echo e($item->Product_Numbers); ?></td>

                                    <td><?php echo e(trans('admin.Total_Qty')); ?></td>
                                    <td><?php echo e($item->Total_Qty); ?></td>

                                    <td><?php echo e(trans('admin.Total_Discount')); ?></td>
                                    <td><?php echo e($item->Total_Discount); ?></td>

                                     <td><?php echo e(trans('admin.Total_Bf_Taxes')); ?></td>
                                    <td><?php echo e($item->Total_BF_Taxes); ?></td>

                                    <td><?php echo e(trans('admin.Total_Taxes')); ?></td>
                                    <td><?php echo e($item->Total_Taxes); ?></td>

                                    <td><?php echo e(trans('admin.Total_Price')); ?></td>
                                    <td><?php echo e($item->Total_Price); ?></td>

                                    <td><?php echo e(trans('admin.Paid')); ?></td>
                                    <td><?php echo e($item->Pay); ?></td>

                                </tr>
                            </tbody>
                        </table>
                        </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo e(trans('admin.Close')); ?></button>
                            <a class="btn btn-primary" href="#" onclick="printpop()"> <i class="fal fa-print"></i> <?php echo e(trans('admin.Print')); ?></a>

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

            </div>



               <!-- Modal Installment -->
    <div class="modal fade d-lg-no-print" id="Installment<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title">

                                    <div class="row">
                                                <div class="col-md-3">
                                            <label><?php echo e(trans('admin.Presenter')); ?></label>
                                                <span><?php echo e($item->presenter); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.annual_interest')); ?></label>
                                                <span><?php echo e($item->annual_interest); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.monthly_installment')); ?></label>
                                                <span><?php echo e($item->monthly_installment); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.Years_Number')); ?></label>
                                                <span><?php echo e($item->Years_Number); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.total')); ?></label>
                                                <span><?php echo e($item->total); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.installment_Num')); ?></label>
                                                <span><?php echo e($item->installment_Num); ?></span>
                                                    </div>

                                                          <div class="col-md-3">
                                            <label><?php echo e(trans('admin.Date_First_installment')); ?></label>
                                                <span><?php echo e($item->Date_First_installment); ?></span>
                                                    </div>

                                                        </div>



                                    </h4>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true"><i class="fal fa-times"></i></span>
                                    </button>
                                </div>

                                <div class="modal-footer">
                         <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.No')); ?></button>
                                </div>
                            </div>
                        </div>
                    </div>


             <!-- Modal Check -->
    <div class="modal fade d-lg-no-print " id="Check<?php echo e($item->id); ?>" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title">

                                    <div class="row">
                                                <div class="col-md-4">
                                            <label><?php echo e(trans('admin.Check_Type')); ?></label>
                                                <?php if(!empty($item->Check_Type)): ?>
                                                <span>

                                               <?php echo e(app()->getLocale() == 'ar' ?$item->Check_Type()->first()->Arabic_Name :$item->Check_Type()->first()->English_Name); ?>

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

                                                          <div class="col-md-4">
                                            <label><?php echo e(trans('admin.Due_Date')); ?></label>
                                                <span><?php echo e($item->Due_Date); ?></span>
                                                    </div>

                                                          <div class="col-md-4">
                                            <label><?php echo e(trans('admin.Check_Number')); ?></label>
                                                <span><?php echo e($item->Check_Number); ?></span>
                                                    </div>


                                                        </div>



                                    </h4>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true"><i class="fal fa-times"></i></span>
                                    </button>
                                </div>

                                <div class="modal-footer">
                         <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.No')); ?></button>

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



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



        <?php $__currentLoopData = $Recipts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $res): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                     <!-- Modal Details -->
                <div class="modal fade" id="recipt<?php echo e($res->id); ?>" tabindex="-1" role="dialog"
                aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title">
                               <?php echo e(trans('admin.Details')); ?>

                            </h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true"><i class="fal fa-times"></i></span>
                            </button>
                        </div>
                        <div class="modal-body">


                <?php
                $details=ReciptVoucherDetails::where('RV_ID',$res->id)->get();
                $count=ReciptVoucherDetails::where('RV_ID',$res->id)->get()->count();
                ?>
                        <div class="mt-3">
                            <table id=""
                            class="table table-bordered table-hover table-striped w-100">





                            <thead>
                                <tr>
                                    <th><?php echo e(trans('admin.Creditor')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Name')); ?> </th>
                                    <th><?php echo e(trans('admin.Statement')); ?> </th>

                                </tr>
                            </thead>
                            <tbody id="">
                                <?php $__currentLoopData = $details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($detail->Creditor); ?></td>
                                    <td><?php echo e($detail->Account()->first()->Code); ?></td>
                                    <td>

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

                                    </td>
                                    <td><?php echo e($detail->Statement); ?></td>
                                </tr>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                            <tfoot>
                                <tr>
                                    <th><?php echo e(trans('admin.Creditor')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Name')); ?> </th>
                                    <th><?php echo e(trans('admin.Statement')); ?> </th>

                                </tr>
                            </tfoot>
                        </table>
                        <table class="table table-bordered table-hover table-striped table-width mt-4">
                            <tbody>
                                <tr>
                                    <td><?php echo e(trans('admin.Numbers')); ?></td>
                                    <td><?php echo e($count); ?></td>
                                    <td><?php echo e(trans('admin.Total_Creditor')); ?></td>
                                    <td><?php echo e($res->Total_Creditor); ?></td>
                                </tr>
                            </tbody>
                        </table>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.Close')); ?></button>
                               <a class="btn btn-primary" href="#" onclick="printpop()"> <i class="fal fa-print"></i> <?php echo e(trans('admin.Print')); ?></a>
                        </div>
                    </div>
                </div>
            </div>

            </div>


<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
           <?php $__currentLoopData = $Payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <!-- Modal Details -->
                <div class="modal fade" id="pay<?php echo e($pay->id); ?>" tabindex="-1" role="dialog"
                aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h4 class="modal-title">
                               <?php echo e(trans('admin.Details')); ?>

                            </h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true"><i class="fal fa-times"></i></span>
                            </button>
                        </div>
                        <div class="modal-body">


                <?php
                $details=PaymentVoucherDetails::where('PV_ID',$pay->id)->get();
                $count=PaymentVoucherDetails::where('PV_ID',$pay->id)->get()->count();

                ?>
                        <div class="mt-3">
                            <table id=""
                            class="table table-bordered table-hover table-striped w-100">





                            <thead>
                                <tr>
                                    <th><?php echo e(trans('admin.Debitor')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Name')); ?> </th>
                                    <th><?php echo e(trans('admin.Statement')); ?> </th>

                                </tr>
                            </thead>
                            <tbody id="">
                                <?php $__currentLoopData = $details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($detail->Debitor); ?></td>
                                    <td><?php echo e($detail->Account()->first()->Code); ?></td>
                                    <td>     <?php echo e(app()->getLocale() == 'ar' ?$detail->Account()->first()->Name :$detail->Account()->first()->NameEn); ?></td>
                                    <td><?php echo e($detail->Statement); ?></td>
                                </tr>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                            <tfoot>
                                <tr>
                                 <th><?php echo e(trans('admin.Debitor')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Code')); ?> </th>
                                    <th><?php echo e(trans('admin.Account_Name')); ?> </th>
                                    <th><?php echo e(trans('admin.Statement')); ?> </th>

                                </tr>
                            </tfoot>
                        </table>
                        <table class="table table-bordered table-hover table-striped w-100 mt-4">
                            <tbody>
                                <tr>
                                    <td><?php echo e(trans('admin.Numbers')); ?></td>
                                    <td><?php echo e($count); ?></td>
                                    <td><?php echo e(trans('admin.Total_Debitor')); ?></td>
                                    <td><?php echo e($pay->Total_Debaitor); ?></td>
                                </tr>
                            </tbody>
                        </table>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(trans('admin.Close')); ?></button>
                               <a class="btn btn-primary" href="#" onclick="printpop()"> <i class="fal fa-print"></i> <?php echo e(trans('admin.Print')); ?></a>

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

            </div>

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






<?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')); ?>">


    <style>
        th{
            width:135px!important;
        }
    </style>

 <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>
        //_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',
                            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>



    <!-- 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,
                        };


              $.ajax({
                              url: 'AllEmpsJ/'+params.term,
                              type:"GET",
                              dataType:"json",
                              beforeSend: function(){
                                  $('#loader').css("visibility", "visible");
                              },

                              success:function(data) {
                                          $('#Emp').empty();
                                  $.each(data, function(key, value){

                         $('#Emp').append('<option value="'+ key +'">' + value + '</option>');

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



        }
                },
            });

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

<!-- Account Balance -->
<script>
    function priiiint() {

                      var countryId = $('#Credit').val();
                      if(countryId) {
                          $.ajax({
                              url: 'AccountBalanceFilter/'+countryId,
                              type:"GET",
                              dataType:"json",
                              beforeSend: function(){
                                  $('#loader').css("visibility", "visible");
                              },

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

                    $('#AccountCredit').text(parseFloat(key).toFixed(2));
                    $('#AccountCredit').text(parseFloat(value).toFixed(2));



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

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

    }
</script>
<script>
    function printpop(){
          $('#yes-pop').addClass("PopNo");
             $('#no-pop').addClass("PopYes");
                      $('#no-pop2').addClass("PopYes");
               window.print();
              /* $(".container-fluid").removeClass("dark-mode");*/
    }
</script>
<script>
      function  popp(){
    $("#no-pop").removeClass("PopYes");
       $("#no-pop2").removeClass("PopYes");
       window.print();
      }
</script>

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

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