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

Invoice Details

@include('admin.popup_invoice', [ 'invoice' => $invoice, 'shipment' => $shipment, 'embedded' => true ])

Edit Invoice

@csrf
tax_type === 'gst')>
tax_type === 'igst')>
@php $totalPaid = $invoice->installments->sum('amount'); $remaining = $invoice->final_amount_with_gst - $totalPaid; @endphp

Installment Payments

@if($remaining > 0) @endif

Add Installment

@csrf
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) }}

Total Invoice Amount (Including GST): ₹{{ number_format($invoice->final_amount_with_gst, 2) }}

Total Paid: ₹{{ number_format($totalPaid, 2) }}
Remaining: ₹{{ number_format($remaining, 2) }}

Installment History

@foreach($invoice->installments as $i) @endforeach
# Date Payment Method Reference No Amount Action
{{ $loop->iteration }} {{ $i->installment_date }} {{ ucfirst($i->payment_method) }} {{ $i->reference_no }} ₹{{ number_format($i->amount, 2) }}
@endsection