@extends('admin.layouts.inventory') @section('title', $project->customer_name) @push('head') @endpush @section('content') @php $f = $financials ?? []; $fmt = fn ($n) => '₹'.number_format((float) ($n ?? 0), 2); $status = $project->status ?? '—'; $tabUrl = fn (string $name) => route('admin.inventory.projects.show', ['project' => $project, 'tab' => $name]); $tabs = [ 'overview' => 'Overview', 'payments' => 'Payments', 'payouts' => 'Payouts', 'materials' => 'Material on site', 'revisions' => 'Revisions', 'photos' => 'Photos', ]; @endphp
Tenant income
{{ $fmt($f['tenant_total_income'] ?? 0) }}
Commission + remaining GST
Commission
{{ $fmt($f['commission_amount'] ?? 0) }}
Company commission
GST amount
{{ $fmt($f['gst_amount'] ?? 0) }}
On bill to customer
GST liability
{{ $fmt($f['remaining_gst_liability'] ?? 0) }}
Remaining after GST payouts
Bill to customer
{{ $fmt($f['bill_to_customer'] ?? 0) }}
Project cost {{ $fmt($f['project_cost'] ?? 0) }}
Contract margin
{{ $fmt($f['margin_amount'] ?? 0) }}
Bill − project cost
Material purchase amount
{{ $fmt($f['material_purchase_amount'] ?? $f['material_received_cost'] ?? 0) }}
What you paid (incl. tax)
Material dispatch amount
{{ $fmt($f['material_dispatch_amount'] ?? $f['material_issued_cost'] ?? 0) }}
Charged to site (incl. tax)
Material margin
{{ $fmt($f['material_margin'] ?? 0) }}
Dispatch − purchase
Customer received
{{ $fmt($f['customer_received'] ?? 0) }}
Receivable left {{ $fmt($f['customer_receivable_remaining'] ?? 0) }}
Paid to service user
{{ $fmt($f['paid_to_service_user'] ?? 0) }}
Pending hold {{ $fmt($f['pending_payout_hold'] ?? 0) }}
Cash balance
{{ $fmt($f['cash_balance'] ?? 0) }}
Received − paid out
Available to request
{{ $fmt($f['available_to_request'] ?? 0) }}
Service user can request
@if ($tab === 'overview')

Site income snapshot

This project’s income for the company is roughly {{ $fmt($f['tenant_total_income'] ?? 0) }} (commission {{ $fmt($f['commission_amount'] ?? 0) }} + remaining GST {{ $fmt($f['remaining_gst_liability'] ?? 0) }}). Material purchase is {{ $fmt($f['material_purchase_amount'] ?? $f['material_total_cost'] ?? 0) }} vs dispatch/charge {{ $fmt($f['material_dispatch_amount'] ?? $f['material_issued_cost'] ?? 0) }} (margin {{ $fmt($f['material_margin'] ?? 0) }} = dispatch − purchase).

Customer phone {{ $project->customer_phone ?: '—' }}
Customer email {{ $project->customer_email ?: '—' }}
Address {{ $project->address ?: '—' }}
Payable to service user (cap) {{ $fmt($f['payable_to_service_user'] ?? 0) }}
Still payable to service user {{ $fmt($f['service_user_payable_remaining'] ?? 0) }}
GST recovered via payouts {{ $fmt($f['gst_recovered_via_payouts'] ?? 0) }}
@endif @if ($tab === 'payments')

Customer payments (credits)

{{ $payments->count() }} {{ str('payment')->plural($payments->count()) }}
@if ($payments->isEmpty())

No customer payments recorded for this project.

@else @foreach ($payments as $payment) @endforeach
Date Receiver Amount UTR / Ref Description
{{ $payment->payment_date?->format('d M Y') ?? '—' }} {{ $payment->receiver_name ?: '—' }} {{ $fmt($payment->amount) }} {{ $payment->utr_or_reference ?: '—' }} {{ $payment->description ?: '—' }}
@endif
@endif @if ($tab === 'payouts')

Payout requests

{{ $payouts->count() }} {{ str('request')->plural($payouts->count()) }}
@if ($payouts->isEmpty())

No payout requests for this project.

@else @foreach ($payouts as $payout) @php $pStatus = $payout->status ?? 'pending'; @endphp @endforeach
Requested By Type Amount Net GST TDS Method Status UTR
{{ $payout->created_at?->format('d M Y') ?? '—' }} {{ $payout->requestedBy?->name ?? '—' }} {{ str($payout->payout_type ?? '—')->replace('_', ' ')->title() }} {{ $fmt($payout->amount) }} {{ $fmt($payout->net_amount) }} {{ $fmt($payout->gst_amount) }} {{ $fmt($payout->tds_amount) }} {{ strtoupper($payout->payout_method ?? '—') }} {{ str($pStatus)->title() }} {{ $payout->utr_or_reference ?: ($payout->payment?->utr_or_reference ?: '—') }}
@endif
@endif @if ($tab === 'materials')

Dispatches to site

{{ $dispatches->count() }} {{ str('dispatch')->plural($dispatches->count()) }}
@if ($dispatches->isEmpty())

No material dispatches to this project yet.

@else @foreach ($dispatches as $dispatch) @php $dStatus = $dispatch->status?->value ?? $dispatch->status; $totals = \App\Support\InventoryDocumentTotals::for($dispatch, 'sell'); @endphp @endforeach
Document From warehouse Date Status Gross Tax Total amount Action
{{ $dispatch->document_number }} {{ $dispatch->sourceWarehouse?->name ?? '—' }} {{ $dispatch->transaction_date?->format('d M Y') ?? '—' }} {{ $dStatus }} {{ $fmt($totals['gross']) }} {{ $fmt($totals['tax']) }} {{ $fmt($totals['total']) }} @include('admin.inventory.partials.action_icons', [ 'view' => route('admin.inventory.dispatches.show', $dispatch), ])
@endif

Direct site receipts (GRN to project)

{{ $siteReceipts->count() }} {{ str('receipt')->plural($siteReceipts->count()) }}
@if ($siteReceipts->isEmpty())

No goods receipts delivered directly to this project site.

@else @foreach ($siteReceipts as $receipt) @php $rStatus = $receipt->status?->value ?? $receipt->status; $totals = \App\Support\InventoryDocumentTotals::for($receipt, 'sell'); @endphp @endforeach
Document Supplier Date Status Gross Tax Total amount Action
{{ $receipt->document_number }} {{ $receipt->supplier?->name ?? '—' }} {{ $receipt->transaction_date?->format('d M Y') ?? '—' }} {{ $rStatus }} {{ $fmt($totals['gross']) }} {{ $fmt($totals['tax']) }} {{ $fmt($totals['total']) }} @include('admin.inventory.partials.action_icons', [ 'view' => route('admin.inventory.goods-receipts.show', $receipt), ])
@endif
@endif @if ($tab === 'revisions')

Project revisions

Manage revisions
@if ($revisions->isEmpty())

No revisions yet. Create one.

@else @foreach ($revisions as $revision) @endforeach
# Document Current Status
{{ $revision->revision_number }} {{ $revision->document_number }} {{ $revision->is_current ? 'Yes' : 'No' }} {{ $revision->status?->value ?? $revision->status }}
@endif

Open material plans (BOM)

@endif @if ($tab === 'photos')

Installation photos

Manage photos

Upload and review site blank, structure, solar plate, and meter photos from the media page.

Open installation photos
@endif @endsection