@extends('layout.app') @section('content') @foreach ($list as $r)

{{ $page_title }} ({{ $r->clients_status }})

@can('money-receipt-entry') @if ($r->client_approval == 'approved' && !globalPermission('payment-bill-by-bill')) @include('billing.extra.paymentModal') @endif @endcan @can('add_other_bill') @include('billing.extra.addBill') @endcan @can('customer-balance-adjust' && !globalPermission('payment-bill-by-bill')) @if ($r->client_approval == 'approved') @include('billing.extra.customerBalanceAdjustModal') @endif @endcan
ID Name User ID Address Mobile No Speed Taka C. Date E. Date Pop/Zone Action
@php(printf('CID%04d', $r->id)) {{ $r->clients_name }} {{ $r->userid }} Flat No: {{ $r->flat_no ?? '' }} , Building Name: {{ $r->building_name ?? '' }} , Road No: {{ $r->road_no ?? '' }} , Block/Sector: {{ $r->block_sector ?? '' }} , Area : {{ $r->area ?? '' }}, Box : {{ $r->box ?? '' }} {{ $r->contact_no }} {{ $r->package_name }} Rate: {{ $r->package_rate }} @if (checkSettings('parmanent_discount') == 'enable')
P Dis: {{ $r->parmanent_discount }} @endif
{{ date('d-M-Y', strtotime($r->created_at)) }} {{ date('d-M-Y', strtotime($r->expire_date)) }} {{ $r->popname }} @if ($r->bill_generate == 'yes' && getBillingType() != 'day_to_day')
@csrf
@endif

Edit @if ($r->client_approval == 'approved') @if ($r->clients_status != 'deactive') @can('customer-deactivated') {{-- Deactive --}} {{-- --}} Deactive @endcan @else @can('customer-reactivate') {{-- Reactive --}} Reactive @endcan @endif @endif
@if ($r->bill_generate == 'yes')

Payment Information

Service Amount Paid Amount Current Balance OTC Due Total Due Amount

{{ $r->package_rate }}

{{ $r->totalPaid }}

@if ($r->dueAmount < 0) {{ abs($r->dueAmount) ?? 0 }} @else {{ 0 }} @endif

{{ $r->otc_due ?? 0 }}

@if ($r->dueAmount < 0) {{ 0 }} @else {{ $r->dueAmount }} @endif

@endif @endforeach

Bill History

@if (globalPermission('payment-bill-by-bill')) @endif @foreach ($bill_history->get() as $history) @if (globalPermission('payment-bill-by-bill')) @endif @endforeach @if (globalPermission('payment-bill-by-bill')) @endif
Id Description Date AmountPaid Amount
@if (globalPermission('payment-bill-by-bill')) @can('money-receipt-entry') @if ($history->paid_amount < $history->bill_amount)
@endif @endcan @if ( ( auth()->user()->id == 1 || auth()->user()->can('delete-generated-bill-full-permission') || ( $history->created_at >= today()->firstOfMonth() && $history->created_at <= today()->lastOfMonth()->addDays(1) ) ) && $history->billing_type != 'deleted' && siteinfo()->bill_by_payment_start_time <= $history->created_at ) Delete @endif @else @if ( (auth()->user()->id == 1 || auth()->user()->can('delete-generated-bill-full-permission')) && $history->billing_type != 'deleted') Delete @elseif ( $history->created_at >= today()->firstOfMonth() && $history->created_at <= today()->lastofMonth()->addDays(1) && $history->billing_type != 'deleted') @can('delete-generated-bill') Delete @endcan @endif @endif {{ $history->id }}
{{ $history->description }} @if ($history->deleted_at)
Deleted BY: {{ user_list()->where('id',$history->deleted_by)->first()->name }}
Delete Time: {{ $history->deleted_at }} @endif
{{ $history->created_at }} {{ $history->bill_amount }}{{ $history->paid_amount }}
Total {{ $bill_history->sum('bill_amount') }}TK{{ $bill_history->sum('bill_amount') - $bill_history->sum('paid_amount')}}TK
@can('customer-balance-adjust')

Last 10 Balance Adjustment History

@foreach ($balance_adjustment->get() as $history) @endforeach
Id Description Date Adjust by Amount
{{-- @if (auth()->user()->id == 1) Delete @endif --}} {{ $history->id }} {{ $history->description }} {{ $history->created_at }} {{ $history->user->name }} {{ $history->amount }}
Total {{ $balance_adjustment->sum('amount') }}TK
@endcan
@endsection @section('ajax') @endsection