@extends('layout.base') @section('layout.base.head') @endsection @section('layout.base.header')

{{ __( 'Table Bill - :table', [ 'table' => $table->area ? $table->area->name . ' - ' . $table->name : $table->name ] ) }}

@if( $secure_access ?? false ) {{ __( 'Secure table access' ) }} @else {{ __( 'Public table access' ) }} @endif

@endsection @section('layout.base.body')

{{ $table->area ? $table->area->name . ' - ' . $table->name : $table->name }}

{{ __( 'Updated' ) }} {{ Carbon\Carbon::parse( $table->updated_at )->format( 'H:i' ) }}
{{ __( 'Status' ) }}
{{ $table->busy ? __( 'Occupied' ) : __( 'Available' ) }}
@if( ! empty( $bills ) && count( $bills ) > 0 ) @foreach( $bills as $bill )

{{ $bill['code'] }}

@if( $bill['payment_status'] === 'paid' ) {{ __( 'Paid' ) }} @elseif( $bill['payment_status'] === 'partially_paid' ) {{ __( 'Partial' ) }} @else {{ __( 'Unpaid' ) }} @endif

{{ ns()->currency->define( $bill['totals']['total'] ) }}

@if( $bill['totals']['tendered'] > 0 && $bill['payment_status'] !== 'paid' )

{{ __( 'Paid: :amount', [ 'amount' => ns()->currency->define( $bill['totals']['tendered'] ) ] ) }}

@endif
@if( count( $bill['products'] ) > 0 )

{{ __( 'Items' ) }} ({{ count( $bill['products'] ) }})

@foreach( $bill['products'] as $product )
{{ $product['product']['name'] }}
{{ __( 'Qty: :quantity', [ 'quantity' => $product['quantity'] ] ) }} {{ ns()->currency->define( $product['unit_price'] ) }}

{{ ns()->currency->define( $product['total_price'] ) }}

@endforeach
@endif
{{ __( 'Subtotal' ) }} {{ ns()->currency->define( $bill['totals']['subtotal'] ) }}
@if( $bill['totals']['discount'] > 0 )
{{ __( 'Discount' ) }} -{{ ns()->currency->define( $bill['totals']['discount'] ) }}
@endif @if( $bill['totals']['tax'] > 0 )
{{ __( 'Tax' ) }} {{ ns()->currency->define( $bill['totals']['tax'] ) }}
@endif
{{ __( 'Total' ) }} {{ ns()->currency->define( $bill['totals']['total'] ) }}
@if( $bill['payment_status'] !== 'paid' )

{{ __( 'Payment Status' ) }}

@if( $bill['payment_status'] === 'partially_paid' ) {{ __( 'Remaining: :amount', [ 'amount' => ns()->currency->define( $bill['totals']['total'] - $bill['totals']['tendered'] ) ] ) }} @else {{ __( 'Awaiting payment for this order' ) }} @endif

@endif
@endforeach @else

{{ __( 'No Bills Found' ) }}

{{ __( 'This table currently has no pending bills.' ) }}

@endif
@endsection