@extends('layouts.app')
@section('content')

    <?php $pageTitle = 'Invoice'?>

    <div class="row nomargins print">
        <div class="panel panel-black hidden-print">
            <div class="panel-heading">
                <a href="{{route('storeSell', Session('store_id'))}}" class="btn btn-primary btn-raised ">Sell</a>
                <a href="{{route('storeSales', Session('store_id'))}}" class="btn btn-primary btn-raised ">Sales</a>
            </div>
        </div>
        <div class="col-md-1"></div>
        <div class="table-responsive col-md-10 mb-3" id="invoiceBox" style="border: 1px solid #ddd; padding-top: 15px;">
            <div class="row">
                <div class="row center-block clearfix mb-1 text-center">
                    <img src="{{asset('assets/img/logo-150.jpg')}}">
                </div>
                <div class="row nomargins mb-2" style="border-bottom: 1px solid #f25f43">
                    <address class="no-mb text-center">
                            <i class="color-danger-light zmdi zmdi-pin">81 Adeniji Jones Ikeja, Lagos</i>&nbsp;&nbsp;
                            <i class="color-info-light zmdi zmdi-email "></i>&nbsp;&nbsp;
                            <a href="mailto:sales@happyworldmealgate.org">sales@happyworldmealate.org</a>&nbsp;&nbsp;

                            <i class="color-royal-light zmdi zmdi-phone">(+234)809 183 0700</i>
                    </address>
                </div>
            </div>
            <div class="row nomargins">
                <div class="col-md-7 col-sm-7 col-xs-7">
                    <p class="bold">Customer Name: <span>{{$sale->Customer_Name}}</span>&nbsp;</p>
                    <p class="bold">Address: &nbsp;<span>{{$sale->Address}}</span></p>
                    <p class="bold">Phone Number: <span>{{$sale->Phone}}</span>&nbsp;</p>

                </div>
                <div class="col-md-5 col-sm-5 col-xs-5">
                    <p class="bold">Invoice Number: <span>#{{$sale->Code}}</span></p>


                    <p class="bold">Date: <span>{{$sale->created_at}}</span></p>&nbsp;

                </div>
            </div>
            <hr>

            <table class="table table-responsive table-bordered">
                <tbody>
                <tr>
                    <th>SN</th>
                    <th>Item</th>
                    <th>Description</th>
                    <th>Quantity</th>
                    <th>Amount (NGN)</th>
                </tr>
                <tr>
                    <td>#1</td>
                    <td>Pins</td>
                    <td colspan="">Registration</td>
                    <td>{{$sale->Quantity}}</td>
                    <td>{{number_format($sale->Amount, 2)}}</td>
                </tr>
                <tr>
                    <th colspan="5">
                        <p class="text-heading text-center">
                            Welcome Pack
                        </p>
                    </th>
                </tr>
                <tr>
                    <td>#2</td>
                    <td colspan="">
                        <select id="wel_pack" class="form-control">
                            @foreach($products as $product)
                                <option value="{{$product->id}}">
                                    {!! $product->name !!}
                                </option>
                            @endforeach

                        </select>
                    </td>
                    <td>
                            <span id="U_amount">
                            </span>
                    </td>
                    <td id="quantity">{{$sale->Quantity}}</td>
                </tr>
                <tr>
                    <td>#3</td>
                    <td colspan="">
                        <select id="product2" class="form-control">
                            @foreach($products as $product)
                                <option value="{{$product->id}}">
                                    {!! $product->name !!}
                                </option>
                            @endforeach

                        </select>
                    </td>
                    <td>
                            <span id="metric">
                            </span>
                    </td>
                    <td>{{$sale->Quantity}}</td>
                </tr>
                <tr>
                    <td colspan="5"></td>
                </tr>
                <tr>
                    <td colspan="3"></td>
                    <td class="" style="font-weight: bold;">Total Amount</td>
                    <td class="" style="font-weight: bold;">NGN {{number_format($sale->Amount, 2)}}</td>
                </tr>
                </tbody>
            </table>
            <div class="container success">
                <h1>PAID</h1>
                <p class="wp-text">
                    <span id="salesStatus">
                        WP yet to be issued.
                    </span>
                </p>
                <i class="fa fa-check-o" style="color: #ff2288; font-weight: bolder; font-size: 30px;"></i><br>
                <button class="issue btn btn-primary btn-raised hidden-print" id="issueWp" data-id="{{ $sale->Code}}">
                    Issue W/P
                </button>
            </div>
            <div class="pull-right hidden-print">
                <a href="{{url('/sales')}}" class="btn btn-primary btn-raised ">Back</a>
                <button class="btn btn-primary btn-raised" onclick="print();">Print</button>
            </div>
        </div>
        <div class="col-md-1">
        </div>
    </div>
@endsection
