@extends('user.layouts') @section('title', 'Financial Track') @section('header') @endsection @section('content')
{{-- HEADER --}}

Financial Track

{{-- FILTER --}}
Filter Financial Records
@csrf
{{-- FROM DATE --}}
{{-- TO DATE --}}
{{-- SUMMARY CARDS --}}
@php $cards = [ ['label' => 'Subscription Base', 'value' => $pack_sum ?? 0, 'class' => 'pack'], ['label' => 'GST Collected', 'value' => $tax_sum ?? 0, 'class' => 'tax'], ['label' => 'Customer Paid', 'value' => $customer_paid_sum ?? 0, 'class' => 'customer'], ['label' => 'Agent Commission', 'value' => $agent_sum ?? 0, 'class' => 'agent'], ['label' => 'Sponsor Commission', 'value' => $sponsor_sum ?? 0, 'class' => 'sponsor'], ['label' => 'Razorpay Fee', 'value' => $razorpay_fee_sum ?? 0, 'class' => 'razorpay'], ['label' => 'Razorpay GST', 'value' => $razorpay_gst_sum ?? 0, 'class' => 'tax'], ['label' => 'Razorpay Total Cost', 'value' => $razorpay_total_sum ?? 0, 'class' => 'razorpay'], ['label' => 'Admin Revenue', 'value' => $total_revenue ?? 0, 'class' => 'revenue'], ]; @endphp @foreach($cards as $card)

{{ $card['label'] }}

₹{{ number_format((float) $card['value'], 2) }}
@endforeach
{{-- TABLE --}}
@php $sn = 1; @endphp @foreach ($business as $finance) @php $data = $check_vendor[$finance->id] ?? [ 'packPrice' => 0, 'taxAmount' => 0, 'customerPaid' => 0, 'agentCommission' => 0, 'sponsorCommission' => 0, 'razorpayFee' => 0, 'razorpayGst' => 0, 'razorpayTotal' => 0, 'transactionTime' => '-', 'transactionSort' => null, 'transactionCount' => 0, 'revenue' => 0, ]; @endphp @if( !empty($from_date) && !empty($to_date) && ($data['transactionCount'] ?? 0) == 0 ) @continue @endif {{-- SN --}} {{-- USER DETAILS --}} {{-- TRANSACTION TIME --}} {{-- REFERRAL --}} {{-- PACK PRICE --}} {{-- GST --}} {{-- CUSTOMER PAID --}} {{-- AGENT --}} {{-- SPONSOR --}} {{-- RAZORPAY FEE --}} {{-- RAZORPAY GST --}} {{-- RAZORPAY TOTAL --}} {{-- ADMIN REVENUE --}} @endforeach
SN USER DETAILS TRANSACTION TIME REFERRAL ID PACK PRICE GST CUSTOMER PAID AGENT SPONSOR RAZORPAY FEE RAZORPAY GST RAZORPAY TOTAL ADMIN REVENUE
{{ $sn++ }}
{{ $finance->name ?? '-' }}
{{ $finance->phone_number ?? '-' }}
{{ ucfirst( optional($finance->user)->type ?? 'Self' ) }} {{ optional($finance->user)->agent_code ?? '-' }}
@if( !empty($data['transactionTime']) && $data['transactionTime'] !== '-' )
{{ $data['transactionTime'] }}
@if(($data['transactionCount'] ?? 0) > 1)
{{ $data['transactionCount'] }} transactions
@endif @else - @endif
{{ optional($finance->user)->to_reffer ?? '-' }} ₹ {{ number_format( (float) ($data['packPrice'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['taxAmount'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['customerPaid'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['agentCommission'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['sponsorCommission'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['razorpayFee'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['razorpayGst'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['razorpayTotal'] ?? 0), 2 ) }} ₹ {{ number_format( (float) ($data['revenue'] ?? 0), 2 ) }}
@endsection @section('footer') @endsection