<div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close no-print" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h6 class="modal-title" style="font-size: 23px; text-align: center;">Register Z - Report</h6>            
        </div>
        <div class="modal-body" style="background-color: #f7f7f7;">
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('business.business_location')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ $register_details->location_name}}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('business.business_location')</p>
                    <p style="float: right; margin: 0 !important;">{{ $register_details->location_name}}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('cash_register.cash_register')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ $register_details->cash_registers_name}}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('cash_register.cash_register')</p>
                    <p style="float: right; margin: 0 !important;">{{ $register_details->cash_registers_name}}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('user.user')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">Opened By {{ auth()->user()->first_name . ' ' . auth()->user()->last_name }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('user.user')</p>
                    <p style="float: right; margin: 0 !important;">Opened By {{ auth()->user()->first_name . ' ' . auth()->user()->last_name }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('cash_register.opening_time')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ $register_details->open_time }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('cash_register.opening_time')</p>
                    <p style="float: right; margin: 0 !important;">{{ $register_details->open_time }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('cash_register.closing_time')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ $close_time }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('cash_register.closing_time')</p>
                    <p style="float: right; margin: 0 !important;">{{ $close_time }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.opening_balance')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->cash_in_hand, 2, '.' ,'') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.opening_balance')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($register_details->cash_in_hand, 2, '.' ,'') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.closing_balance')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->closing_amount,2,'.','') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.closing_balance')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($register_details->closing_amount,2,'.','') }}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.theoretical_closing')</div>
                {{-- <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->cash_in_hand+$register_details->total_sale,2,'.','') }}</div> --}}
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->cash_in_hand+$register_details->total_cash+$sell_no_registers['nonRegister']->total_cash_non_register-($register_details->total_cash_refund > 0 ? $register_details->total_cash_refund : $details['transaction_return']->total_cash_refund),2,'.','') }}</div>
                {{-- <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.theoretical_closing')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format(($register_details->total_cash_refund > 0 ? $register_details->total_cash_refund : $details['transaction_return']->total_cash_refund ),2,'.','') }}</p>
                </div> --}}
            </div>
            <div class="row">
                <div class="col-sm-6 font-weigth-bold font-15" style="margin-top: 5px !important; margin-bottom: 5px !important;">@lang('lang_v1.balance')</div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_sales')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->total_sale, 2, '.', '') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.cash_sales')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($register_details->total_cash, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15 no-print">@lang('lang_v1.cash_refund')</div>
                <div class="col-sm-8 font-weigth-bold font-15 no-print" style="text-align: right;">
                    {{ number_format($register_details->total_refund,2,'.','') }}
                </div>                 --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.cash_refund')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format(($register_details->total_cash_refund > 0 ? $register_details->total_cash_refund : $details['transaction_return']->total_cash_refund ),2,'.','') }}</p>
                </div>
                {{-- <small>
                    @if($register_details->total_cash_refund != 0)
                      Cash: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_cash_refund }}</span><br>
                    @endif
                    @if($register_details->total_cheque_refund != 0) 
                      Cheque: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_cheque_refund }}</span><br>
                    @endif
                    @if($register_details->total_card_refund != 0) 
                      Card: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_card_refund }}</span><br> 
                    @endif
                    @if($register_details->total_bank_transfer_refund != 0)
                      Bank Transfer: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_bank_transfer_refund }}</span><br>
                    @endif
                    @if(array_key_exists('custom_pay_1', $payment_types) && $register_details->total_custom_pay_1_refund != 0)
                        {{$payment_types['custom_pay_1']}}: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_custom_pay_1_refund }}</span>
                    @endif
                    @if(array_key_exists('custom_pay_2', $payment_types) && $register_details->total_custom_pay_2_refund != 0)
                        {{$payment_types['custom_pay_2']}}: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_custom_pay_2_refund }}</span>
                    @endif
                    @if(array_key_exists('custom_pay_3', $payment_types) && $register_details->total_custom_pay_3_refund != 0)
                        {{$payment_types['custom_pay_3']}}: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_custom_pay_3_refund }}</span>
                    @endif
                    @if($register_details->total_other_refund != 0)
                      Other: <span class="display_currency" data-currency_symbol="true">{{ $register_details->total_other_refund }}</span>
                    @endif
                </small> --}}
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_difference')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->closing_amount - ($register_details->cash_in_hand+$register_details->total_sale),2,'.','') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.cash_difference')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($register_details->closing_amount - ($register_details->cash_in_hand+$register_details->total_cash+$sell_no_registers['nonRegister']->total_cash_non_register - $details['transaction_return']->total_cash_refund), 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_sales')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->total_sale, 2, '.', '') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.credit_card_sales')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($register_details->total_card, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_sales')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->total_sale, 2, '.', '') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.credit_card_return')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($details['transaction_return']->total_card_refund, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_sales')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->total_sale, 2, '.', '') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.non_register_paid_sell_total_cash')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($sell_no_registers['nonRegister']->total_cash_non_register, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                {{-- <div class="col-sm-4 font-weigth-bold font-15">@lang('lang_v1.cash_sales')</div>
                <div class="col-sm-8 font-weigth-bold font-15" style="text-align: right;">{{ number_format($register_details->total_sale, 2, '.', '') }}</div> --}}
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left; margin: 0 !important;">@lang('lang_v1.non_register_paid_sell_total_card')</p>
                    <p style="float: right; margin: 0 !important;">{{ number_format($sell_no_registers['nonRegister']->total_card_non_register, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both; background: #3595f6; color: white;">
                    <p style="float: left; margin: 0 !important;" class="info">@lang('lang_v1.net_cash_sales')</p>
                    <p style="float: right; margin: 0 !important;" class="info">{{ number_format($register_details->total_cash + $sell_no_registers['nonRegister']->total_cash_non_register - $details['transaction_return']->total_cash_refund, 2, '.', '') }}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both; background: #3595f6; color: white;">
                    <p style="float: left; margin: 0 !important;" class="info">@lang('lang_v1.net_card_sales')</p>
                    <p style="float: right; margin: 0 !important;" class="info">{{ number_format($register_details->total_card + $sell_no_registers['nonRegister']->total_card_non_register - $details['transaction_return']->total_card_refund, 2, '.', '') }}</p>
                </div>
            </div>
            <hr style="margin: 1px !important;">
            <div class="row">
                <div class="col-sm-12 font-weigth-bold font-15" style="clear: both;">
                    <p style="float: left;">@lang('lang_v1.printed_at')</p>
                    <p style="float: right">{{\Carbon::now('GMT')->format('jS M, Y h:i A')}}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12 font-weigth-bold font-15" style="text-align: right;"> <button type="button" class="btn btn-secondary no-print" 
                    aria-label="Print" 
                      onclick="$(this).closest('div.modal').printThis();" style="
                      width: 40%;
                      color: #ebe7e7 !important;
                      font-size: 15px !important;
                      border-radius: 5px !important;
                      background-color: #555561 !important;
                  "> @lang( 'messages.print' )
                  </button></div>
            </div>
        </div>
    </div>
</div>
<style type="text/css">
    @media print {
      .modal {
          position: absolute;
          left: 0;
          top: 0;
          margin: 0;
          padding: 0;
          overflow: visible!important;
          /* height: 39in; */
          /* width: 155px;
          max-width: 155px; */
      }

      @page {
        size: 5in auto;
      }
  }
  </style>