@extends('layouts.'.env('THEME')) @section('moreStyle') @include('staff.schedule.style') @endsection @section('content')
{!! Form::open(['route' => 'admin.billing_reportv2', 'method' => 'get']) !!}
From: {!! Form::datetimeLocal('from', $from, ['id' => 'from_input']) !!} To: {!! Form::datetimeLocal('to', $to, ['id' => 'to_input']) !!}
Types (comma separated): {!! Form::text('types', implode(',', $types), ['id' => 'types_input', 'class' => 'wide-input']) !!}
adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, payout_minimum_balance_hold, payout_minimum_balance_release, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, stripe_balance_payment_debit, stripe_balance_payment_debit_reversal, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund
available types
States (comma separated): {!! Form::text('types', implode(',', $states), ['id' => 'states_input', 'class' => 'wide-input']) !!}
available, pending
available states
Description match: {!! Form::text('match_desc', $match_desc, ['id' => 'match_desc_input', 'class' => 'wide-input']) !!}
Show all, Subscription update, Subscription creation, Yealink Handset, Number port
Common descriptions
{!! Form::close() !!}

Transactions from Stripe

@php $count = 0; $totals = [ 'amount' => 0, 'fee' => 0, 'net' => 0, ]; @endphp @foreach($stripe_transactions as $txn) @php $count++; $totals['amount'] += $txn->amount; $totals['fee'] += $txn->fee; $totals['net'] += $txn->net; $style = $txn->status === 'pending' ? 'background-color: #FBC02D;' : ''; @endphp @endforeach
# Created State Type Description Customer Amount Fee Net
{{ $count }} {{ \Carbon\Carbon::parse($txn->created)->format('d/m/Y') }} {{ $txn->status }} {{ $txn->type }} {{ $txn->description }} @if($txn->related_customer) {{ $txn->related_customer }} @endif {{ number_format((float)$txn->amount / 100, 2, '.', '') }} {{ number_format((float)$txn->fee / 100, 2, '.', '') }} {{ number_format((float)$txn->net / 100, 2, '.', '') }}
Totals: {{ number_format((float)$totals['amount'] / 100, 2, '.', '') }} {{ number_format((float)$totals['fee'] / 100, 2, '.', '') }} {{ number_format((float)$totals['net'] / 100, 2, '.', '') }}

Internal record of paying customers

Customers we expect payment from.
Filters applied: Install State Check
  • Only include leads where install_state is installed_live.
Service End Date Check Only include leads where the service hasn’t ended, meaning:
  • The service_end_date is missing (null),
  • or the service_end_date is in the future (after {{ \Carbon\Carbon::parse($from)->format('d/m/Y') }}).
Billing Exemption Check Only include leads where either:
  • There is an exempt_expire_date and it has passed (before {{ \Carbon\Carbon::parse($to)->format('d/m/Y') }}),
  • or the lead has no billing exemption (billing_exempt is null).
Package start date check
  • Return leads where package_start is either not set (null),
  • Or it is set to a date before {{ \Carbon\Carbon::parse($to)->format('d/m/Y') }}.
filter details
@php $count = 0; $flagged = 0; $totals = [ 'sub' => 0, 'discount' => 0, 'net' => 0, ]; @endphp @foreach($leads as $lead) @php $count++; $net = $lead->package->price - $lead->discount_applied; $totals['sub'] += $lead->package->price; $totals['discount'] += $lead->discount_applied; $totals['net'] += $net; $style = ''; if(empty($lead->stripe_id)){ $style = 'background-color: #ffbfbf;'; $flagged++; } if($lead->missing_transaction){ $style = 'background-color: #ffbfbf;'; $flagged++; } @endphp @endforeach
# ID Name Stripe ID Sub Discount Net
{{ $count }} {{ $lead->lead_id }} {{ $lead->fullname }} @if($lead->cus_stripe_id) {{ $lead->cus_stripe_id }} @endif {{ $lead->package->price }} {{ $lead->discount_applied }} {{ $net }}
Totals: {{ number_format((float)$totals['sub'], 2, '.', '') }} {{ number_format((float)$totals['discount'], 2, '.', '') }} {{ number_format((float)$totals['net'], 2, '.', '') }}
Flagged: {{ $flagged }}
@endsection @section('script') @endsection