@extends('layout.base') @section('layout.base.head') @endsection @section('layout.base.header') @endsection @section('layout.base.body')
@if( ! empty( $bills ) && count( $bills ) > 0 ) @foreach( $bills as $billIndex => $bill )
@if( ($bill['payment_status'] ?? '') === 'paid' ) @elseif( ($bill['payment_status'] ?? '') === 'partially_paid' ) @else @endif

{{ __( 'Order' ) }}

{{ $bill['code'] ?? __('No Bill Code') }}

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

{{ __( 'Total Amount' ) }}

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

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

{{ __( 'Paid' ) }}

{{ ns()->currency->define( $bill['totals']['tendered'] ?? 0 ) }}

{{ __( 'Remaining' ) }}: {{ ns()->currency->define( ($bill['totals']['total'] ?? 0) - ($bill['totals']['tendered'] ?? 0) ) }}

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

@if( ($bill['payment_status'] ?? '') === 'partially_paid' ) {{ __( 'Remaining Balance' ) }} @else {{ __( 'Amount to Pay' ) }} @endif

{{ ns()->currency->define( ($bill['payment_status'] ?? '') === 'partially_paid' ? (($bill['totals']['total'] ?? 0) - ($bill['totals']['tendered'] ?? 0)) : ($bill['totals']['total'] ?? 0) ) }}

@else

{{ __( 'Payment Complete' ) }}

{{ __( 'Thank you for your payment!' ) }}

@endif
@endforeach @else

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

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

{{ __( 'Refresh' ) }}
@endif
@endsection