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

Invoice Overview

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

Amount Breakdown

@php $totalPaid = $invoice->installments->sum('amount'); $remaining = $invoice->final_amount_with_gst - $totalPaid; // Calculate GST/IGST percentage dynamically $taxPercentage = $invoice->tax_type === 'gst' ? ($invoice->cgst_percent + $invoice->sgst_percent) : $invoice->igst_percent; @endphp
Total Amount (Before Tax): ₹{{ number_format($invoice->final_amount, 2) }}
@if($invoice->tax_type === 'gst') GST ({{ number_format($taxPercentage, 2) }}%) @else IGST ({{ number_format($taxPercentage, 2) }}%) @endif: ₹{{ 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) }}
Total Amount Due (Including Tax): ₹{{ number_format($customerTotalDue, 2) }}
₹{{ number_format($invoice->final_amount_with_gst, 2) }}
Total Amount
₹{{ number_format($remaining, 2) }}
Remaining

Edit Invoice Details

@csrf
tax_type === 'gst')>
tax_type === 'igst')>
@can('invoice.edit') @endcan

Installment Payments

@can('invoice.add_installment') @if($remaining > 0) @endif @endcan

Add New Installment

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