@extends('layouts.app')

@section('title')
Print | Print Receipt
@stop

@section('css')

 <link href="{{asset('css/print/style.css')}}" rel="stylesheet">
   <!-- Load paper.css for happy printing -->
   <link href="{{asset('css/print/paper.css')}}" rel="stylesheet">
 <!--
 <link href="{{asset('css/print/bootstrap.css')}}" rel="stylesheet"> -->
@stop

@section('content')

<div class="container pad-15 printableArea" id="content1">
    <header class="clearfix header-receipt">
            <div class="col-sm-7 col-xs-7 p-0">
             <div class="">
            <!-- <img src="{{asset('plugins/images/logoColor.png')}}" class="img-responsive logo-size">--></div>
             <h2>Installment payment Receipt</h2>
            </div>
            <div class="col-sm-5 col-xs-5 text-left mt-50">
               <!-- <img src="{{asset('plugins/images/hmLogo.png')}}" class="hm-logo">
                <p>Office# 14, 2nd Floor, Silver City Plaza, G11 Markaz - Islamabad<br>
                    Phone: (051) 2363055 www.hamdardcity.com info@hamdardcity.com

                </p>-->

            </div>
    </header><br><br>
    <div class="receipt-body receipt-body-img">
        <div class="row">
            <div class="col-sm-6 col-xs-6">
                <ul class="pad-left">
                    <li>Recieved&nbsp;From<div class="underline-receipt">&emsp;{{$receipt->property->customer->name}}</div></li>
                    
                    <li>Client&nbsp;ID<div class="underline-receipt">&emsp;{{$receipt->property->membership_no}}</div></li>
                    <li>CNIC<div class="underline-receipt">&emsp;{{$property->customer->cnic}}</div></li>
                    <li>Unit&nbsp;No.<div class="underline-receipt">&emsp;{{$property->inventory->unit_number}}</div></li>
                    <li>Unit&nbsp;Type<div class="underline-receipt">&emsp;{{$property->inventory->type->name}}</div></li>
                    <li>Payment&nbsp;Mode<div class="underline-receipt">&emsp;@if($receipt->payment_mode == \App\Receipt::cash)
                        Cash
                    @elseif($receipt->payment_mode == \App\Receipt::bank)
                        Bank transfer
                    @elseif($receipt->payment_mode == \App\Receipt::cheque)
                        Cheque
                    @elseif($receipt->payment_mode == \App\Receipt::adjustment)
                        Adjustment
                    @endif
                </div></li>
                </ul>
            </div>
            <div class="col-sm-6 col-xs-6">
                <ul>
                    <li>&nbsp;</li>
                    <li>&nbsp;</li>
                    <li>Total&nbsp;Amount&nbsp;Payable<div class="underline-receipt">&emsp;Rs. {{number_format($property->net_pay)}}/-</div></li>
                    <li>Installment&nbsp;No.<div class="underline-receipt">&emsp;{{$installment_no}}</div></li>
                    <li>Installment&nbsp;Paid<div class="underline-receipt">&emsp;Rs. {{number_format($receipt->amount)}}/-</div></li>
                    <li>Total&nbsp;Amount&nbsp;Recieved<div class="underline-receipt">&emsp;Rs. {{number_format($property->net_pay - $balance)}}/-</div></li>
                    <li>Balance&nbsp;Due<div class="underline-receipt">&emsp;Rs. {{number_format($balance)}}/-</div></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="row mt-50">
        <div class="col-xs-8 col-sm-8">
                <div class="box-1">
                   <!-- <div class="qr"><img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->merge('plugins/images/logoColor.png', 0.3, true)
                        ->size(100)->errorCorrection('H')->color(53,208,47)
                        ->generate($property->membership_no .' - '.$receipt->receipt_no . ' - ' . $receipt->amount)) !!} "></div>
                    <p class="mt-44">Date: {{date('d-m-Y', strtotime($receipt->receipt_date)) }} <br>
                        Receipt No. {{$receipt->receipt_no}}
                    </p>-->
                </div>
            </div>
            <div class="col-xs-4 col-sm-4 text-center">
                <p class="mt-64">Authorized Signature</p>
            </div>
    </div>
    <header class="clearfix header-receipt-1">
            <div class="col-sm-7 col-xs-7 p-0">
             <h2>Installment payment Receipt (Office use only)</h2>
            </div>
            <div class="col-sm-5 col-xs-5 text-left p-t-20">
                <div class="box-1">
                    <div class="qr"><img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->merge('plugins/images/logoColor.png', 0.3, true)
                        ->size(100)->errorCorrection('H')->color(53,208,47)
                        ->generate($property->membership_no .' - '.$receipt->receipt_no . ' - ' . $receipt->amount)) !!} " class="mt-m-28"></div>
                    <p class="mt-16">Date: {{date('d-m-Y', strtotime($receipt->receipt_date)) }} <br>
                        Receipt No. {{$receipt->receipt_no}}
                    </p>
                </div>
            </div>
    </header>
    <div class="receipt-body">
        <div class="row">
            <div class="col-sm-6 col-xs-6">
                <ul class="pad-left">
                    <li>Recieved&nbsp;From<div class="underline-receipt">&emsp;{{$receipt->property->customer->name}}</div></li>
                    
                    <li>Client&nbsp;ID<div class="underline-receipt">&emsp;{{$receipt->property->membership_no}}</div></li>
                    <li>CNIC<div class="underline-receipt">&emsp;{{$property->customer->cnic}}</div></li>
                    <li>Unit&nbsp;No.<div class="underline-receipt">&emsp;{{$property->inventory->unit_number}}</div></li>
                    <li>Unit&nbsp;Type<div class="underline-receipt">&emsp;{{$property->inventory->type->name}}</div></li>
                    <li>Payment&nbsp;Mode<div class="underline-receipt">&emsp;@if($receipt->payment_mode == \App\Receipt::cash)
                        Cash
                    @elseif($receipt->payment_mode == \App\Receipt::bank)
                        Bank transfer
                    @elseif($receipt->payment_mode == \App\Receipt::cheque)
                        Cheque
                    @elseif($receipt->payment_mode == \App\Receipt::adjustment)
                        Adjustment
                    @endif
                </div></li>
                </ul>
            </div>
            <div class="col-sm-6 col-xs-6">
                <ul>
                    <li>&nbsp;</li>
                    <li>&nbsp;</li>
                    <li>Total&nbsp;Amount&nbsp;Payable<div class="underline-receipt">&emsp;Rs. {{number_format($property->net_pay)}}/-</div></li>
                    <li>Installment&nbsp;No.<div class="underline-receipt">&emsp;{{$installment_no}}</div></li>
                    <li>Installment&nbsp;Paid<div class="underline-receipt">&emsp;Rs. {{number_format($receipt->amount)}}/-</div></li>
                    <li>Total&nbsp;Amount&nbsp;Recieved<div class="underline-receipt">&emsp;Rs. {{number_format($property->net_pay - $balance)}}/-</div></li>
                    <li>Balance&nbsp;Due<div class="underline-receipt">&emsp;Rs. {{number_format($balance)}}/-</div></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="row mt-50">
        <div class="col-xs-8 col-sm-8">
                &nbsp;
            </div>
            <div class="col-xs-4 col-sm-4 text-center">
                <p>Authorized Signature</p>
            </div>
    </div>
</div>
@stop

@section('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.4/jspdf.min.js"></script>
<script>
 window.setTimeout('window.print()',2000);
window.onafterprint = function(){
   window.close();
}



</script>

@stop
