{{ __('billing.header.index') }}
@if (isset($message))
× {{ $message }}
@else
× {{ $data->total() }} billings found. Name: {{ $search['name'] ?? 'All' }} Address: {{ $search['address'] ?? 'All' }} Status: {{ $search['status'] ?? 'All' }} Bulan: {{ $search['month'] ?? 'All' }} Tahun: {{ $search['year'] ?? 'All' }}
@endif
{{ $data->withQueryString()->links() }} @if ($totalPrice > 0)
Total Bill: @moneyIDR($totalPrice)
@endif @if ($data->isNotEmpty()) @foreach ($data as $key => $billing) @endforeach
{{ __('billing.table.no') }} {{ __('billing.table.customer-name') }} {{ __('billing.table.customer_id') }} {{ __('billing.table.address') }} {{ __('billing.table.periode') }} {{ __('billing.table.bill') }} {{ __('billing.table.bill-state') }} {{ __('Payment Methode') }} {{ __('customer.table.action') }}
{{ ++$i }} {{ $billing->customer_name ?? 'no name' }} {{ $billing->customer->customer_id ?? 'no customer id' }} {{ $billing->customer->address ?? 'no address' }} {{ Carbon\Carbon::parse($billing->billing_periode->name)->translatedFormat('M Y') ?? 'no periode' }} @if ($billing->paket_price === 0) {{ __('Free') }} @else @moneyIDR($billing->paket_price + $billing->tax) @endif @php $billingsUnpaid = App\Models\Billing\Billing::where( 'customer_id', $billing->customer_id, ) ->where('status', '!=', 'LS') ->get(); @endphp @if ($billing->status === 'LS') {{ __('billing.state.lunas') }} @elseif ($billing->status === 'PL') @php $otherDate = Carbon\Carbon::parse($billing->pay_later); $nowDate = Carbon\Carbon::now(); $result = $nowDate->gt($otherDate); @endphp {{ __('billing.state.paylater') . ' ' . Carbon\Carbon::parse($billing->pay_later)->translatedFormat('d M Y') }} @else @php $activationDate = Carbon\Carbon::now()->translatedFormat('Y-m') . '-' . Carbon\Carbon::parse($billing->customer->activation_date)->translatedFormat( 'd', ) . ' ' . Carbon\Carbon::now()->translatedFormat('H:i:s'); $nowDate = Carbon\Carbon::now(); $result = $nowDate->gt($activationDate); @endphp {{ __('billing.state.belum-lunas') }} {{ Carbon\Carbon::parse($billing->due_date)->translatedFormat('d M Y') }} @endif @php $countBillingCustomerUnpaid = count( $data->where('customer_id', $billing->customer_id)->where('status', '!=', 'LS'), ); @endphp @if (count($billingsUnpaid) - $countBillingCustomerUnpaid > 0)
{{ __('billing.state.belum-lunas-lainnya', ['count_bill_unpaid' => count($billingsUnpaid) - $countBillingCustomerUnpaid]) }} @endif
@if ($billing->status != 'LS' && $billing->paket_price > 0) {!! Form::model($billing, [ 'method' => 'PATCH', 'route' => ['billings.payment', $billing->slug], 'id' => 'form-pay-' . $billing->slug, ]) !!} {!! Form::close() !!} @elseif ($billing->status === 'LS' && $billing->paket_price > 0) {{ $billing->receipt->payment_methode ?? '' }} on {{ Carbon\Carbon::parse($billing->payment_time)->translatedFormat('d M Y') }} @endif @can('billing-edit') @if ($billing->status != 'LS') @if ($billing->customer->activation === 'true') {{ __('billing.button.pay') }} @else
@csrf @method('put') {{ __('billing.button.activation') }}
@endif @elseif ($billing->status === 'LS' && $billing->paket_price > 0) {!! Form::model($billing, ['method' => 'PATCH', 'route' => ['billings.unpayment', $billing->slug]]) !!} {{ __('billing.button.unpay') }} {!! Form::close() !!} @endif @endcan
@else
No billing found!
@endif {{ $data->withQueryString()->links() }}
@section('custom_styles') @endsection