@extends('layouts.master') @section('title') billing @endsection @section('css') @endsection @section('content') {{-- @component('components.breadcrumb') @slot('li_1') Dashboard @endslot @slot('title') Finance @endslot @endcomponent --}}

Finance

PAYMENTS OVERVIEW

{{ date('F') }} Payments

{{ $transactions[0]->deposit_sum ?? '0' }}

M-Pesa Payments

{{ $mpesa[0]->sum ?? '0' }}

Other Payments

{{ ($transactions[0]->deposit_sum ?? 0) - ($mpesa[0]->sum ?? 0) }}

Paid Services

{{ abs($transactions[0]->withdraw_sum ?? 0) }}
@foreach($growth as $key => $value)

{{ $value->months }}

Payments

{{ $value->deposit_sum }} Ksh

Paid Services

{{ abs($value->withdraw_sum) }} Ksh

Growth

@if($key == 0)
base
@else @php $previous = $growth[$key-1]; $previous_month_sum = $previous->deposit_sum - $previous->withdraw_sum; $current_month_sum = $value->deposit_sum - $value->withdraw_sum; $growth_percentage = ($previous_month_sum != 0) ? (($current_month_sum - $previous_month_sum) / abs($previous_month_sum)) * 100 : 0; @endphp @if($growth_percentage > 0)
{{ number_format($growth_percentage, 2) }}%
@elseif($growth_percentage < 0)
{{ number_format(abs($growth_percentage), 2) }}%
@else
No Change
@endif @endif
@endforeach
Monthly Transactions (graph)
Top 5 Payers
{{--
Revenue growth (graph)
--}} @endsection @section('script') {{-- --}} {{-- --}} {{-- --}} @endsection