@extends('layouts.dashboard')

@section('page_title')
	Bill and Payments
@endsection

@section('page_header_title')
Bill and Payments
@endsection

@section('page_body')

{{ Breadcrumbs::render('billandpayments') }}

<div class="row row-cards row-deck">
            <div class="col-12">
              <div class="card">
                <div class="card-header">
             <h3 class="card-title">Payable Detail</h3>
          </div>

                <div class="card-status card-status-left bg-blue"></div>
                <div class="row" style="padding:50px;">
                <div class="col-md-12">
                  <table class="table table-bordered">

                    <tr>
                      <th>Category</th>
                      <td> {{$curr_payable->category->name}} </td>
                    </tr>
                    <tr>
                      <th>Sub-Category</th>
                      <td> {{$curr_payable->subcategory->name}} </td>
                    </tr>
                    <tr>
                      <th>Laibility Type</th>
                      <td> {{$curr_payable->laibility_type}} </td>
                    </tr>
                      <tr>
                        <th>Payable Type</th>
                        <td> {{$curr_payable->payable_type}} </td>
                      </tr>
                      <tr>
                        <th>Total Amount</th>
                        <td> {{EF::numberFormat($curr_payable->amount)}} </td>
                      </tr>
                      <tr>
                        <th>Description</th>
                        <td> {{$curr_payable->description}} </td>
                      </tr>
                      @if($curr_payable->payable_type == 'Reoccuring')
                      <tr>
                        <th>No of Month</th>
                        <td>{{$curr_payable->no_of_month}} </td>
                      </tr>
                      <tr>
                        <th>Monthly amount</th>
                        <td> {{EF::numberFormat($curr_payable->month_amount)}} </td>
                      </tr>
                              @endif
                      <tr>
                
                        <th>Created At</th>
                        <td> {{EF::dateFormat($curr_payable->created_at)}} </td>
                      </tr>

                  </table>
                </div>
              </div>
              </div>
            </div>
        </div>
<div class="row row-cards row-deck">
						<div class="col-12">
							<div class="card">
								<div class="card-header">
                  <h5>Installments</h5>
					</div>

								<div class="card-status card-status-left bg-blue"></div>
								<div class="table-responsive table-height">

									<table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
										<thead>
											<tr>
												<th>Sr #</th>
												<th>Installment No</th>
												<th>Total Amount</th>
                        <th>Paid Amount</th>
                        <th>Unpaid Amount</th>
												<th>Action</th>
											</tr>
										</thead>
										<tbody>
										@foreach($curr_installments as $row)
										<tr>
											<td>{{$loop->iteration}}</td>
                      <td>Installment No. {{$row->installment_no}}</td>
											<td>{{EF::numberFormat($row->amount)}}</td>
											<td>{{EF::numberFormat($row->paid_amount)}}</td>
											<td>{{EF::numberFormat($row->to_pay)}}</td>
											<td> 
                        @if(false)
                          <a href="{{route('show_bill_installments',['id' => Crypt::encrypt($row->id)])}}" class="btn-sm btn-success"><i class="fa fa-cash"></i> Pay</a>
                        @endif
											</td>
										</tr>
										@endforeach
										</tbody>
										<tfoot>

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


@endsection

@section('page_modal')
@endsection

@section('page_script')
@endsection
