@extends('admin.layouts.app') @section('page-title', 'Edit Invoice') @section('content')
{{-- Invoice Preview / Overview --}}

Invoice Overview

{{-- Read-only popup: items price/total cannot be edited here --}} @include('admin.popup_invoice', ['invoice' => $invoice, 'shipment' => $shipment])
{{-- Edit Invoice Header Details (POST) --}}

Edit Invoice Details

@csrf
{{-- Invoice Date --}}
{{-- Due Date --}}
{{-- Final Amount (Base) --}}
{{-- Tax Type --}}
tax_type) === 'gst' ? 'checked' : '' }}>
tax_type) === 'igst' ? 'checked' : '' }}>
{{-- Tax Percentage --}}
{{-- Status --}}
{{-- Notes --}}
@php // आता helpers वापरू: totalPaid() आणि remainingAmount() $totalPaid = $invoice->totalPaid(); $remaining = $invoice->remainingAmount(); @endphp {{-- Amount Breakdown (items + GST + groups) --}}
Amount Breakdown
Total Amount Before Tax ₹{{ number_format($invoice->final_amount, 2) }}
Tax Type @if($invoice->tax_type === 'gst') GST (CGST + SGST) @else IGST @endif
Tax Percentage @if($invoice->tax_type === 'gst') {{ $invoice->cgst_percent + $invoice->sgst_percent }}% @else {{ $invoice->igst_percent }}% @endif
GST Amount ₹{{ number_format($invoice->gst_amount, 2) }}
Charge Groups Total ₹{{ number_format($invoice->charge_groups_total, 2) }}
Grand Total (Items + GST + Groups) ₹{{ number_format($invoice->grand_total_with_charges, 2) }}
Total Paid ₹{{ number_format($totalPaid, 2) }}
Remaining ₹{{ number_format(max(0, $remaining), 2) }}
{{-- Installment Summary (top cards) --}}
₹{{ number_format($invoice->grand_total_with_charges, 2) }}
Grand Total (Items + GST + Groups)
₹{{ number_format(max(0, $remaining), 2) }}
Remaining
{{-- Installment Management --}}

Installment Payments

@if($remaining > 0) @endif
{{-- Installment Form --}}

Add New Installment

@csrf
{{-- Installment History --}}
Installment History
No installments found. Click Add Installment to create one.
@foreach($invoice->installments as $i) @endforeach
# Date Payment Method Reference No Amount Action
{{ $loop->iteration }} {{ $i->installment_date }} {{ strtoupper($i->payment_method) }} @if($i->reference_no) {{ $i->reference_no }} @else - @endif ₹{{ number_format($i->amount, 2) }}
@endsection