2025-11-06 17:09:52 +05:30
|
|
|
@extends('admin.layouts.app')
|
|
|
|
|
|
2025-11-17 10:33:11 +05:30
|
|
|
@section('page-title', 'Invoice List')
|
2025-11-06 17:09:52 +05:30
|
|
|
|
|
|
|
|
@section('content')
|
2025-11-17 10:33:11 +05:30
|
|
|
|
2025-11-06 17:09:52 +05:30
|
|
|
<div class="card shadow-sm">
|
2025-11-17 10:33:11 +05:30
|
|
|
<div class="card-header bg-light">
|
|
|
|
|
<h4 class="mb-0">All Invoices</h4>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card-body table-responsive">
|
|
|
|
|
<table class="table table-bordered table-striped align-middle text-center">
|
|
|
|
|
<thead class="table-light">
|
|
|
|
|
<tr>
|
|
|
|
|
<th>#</th>
|
|
|
|
|
<th>Invoice Number</th>
|
|
|
|
|
<th>Customer</th>
|
|
|
|
|
<th>Final Amount (₹)</th>
|
|
|
|
|
<th>GST %</th>
|
|
|
|
|
<th>Total w/GST (₹)</th>
|
|
|
|
|
<th>Status</th>
|
|
|
|
|
<th>Invoice Date</th>
|
|
|
|
|
<th>Due Date</th>
|
|
|
|
|
<th>Action</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach($invoices as $i => $invoice)
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{{ $i + 1 }}</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<a href="#"
|
|
|
|
|
class="text-primary fw-bold open-invoice-popup"
|
|
|
|
|
data-id="{{ $invoice->id }}">
|
|
|
|
|
{{ $invoice->invoice_number }}
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>{{ $invoice->customer_name }}</td>
|
|
|
|
|
|
|
|
|
|
<td>₹{{ number_format($invoice->final_amount, 2) }}</td>
|
|
|
|
|
<td>{{ $invoice->gst_percent }}%</td>
|
|
|
|
|
<td>₹{{ number_format($invoice->final_amount_with_gst, 2) }}</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<span class="badge
|
|
|
|
|
@if($invoice->status=='paid') bg-success
|
|
|
|
|
@elseif($invoice->status=='overdue') bg-danger
|
|
|
|
|
@else bg-warning text-dark @endif">
|
|
|
|
|
{{ ucfirst($invoice->status) }}
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>{{ $invoice->invoice_date }}</td>
|
|
|
|
|
<td>{{ $invoice->due_date }}</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<a href="{{ route('admin.invoices.edit', $invoice->id) }}"
|
|
|
|
|
class="btn btn-sm btn-primary">
|
|
|
|
|
Edit
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2025-11-06 17:09:52 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-17 10:33:11 +05:30
|
|
|
|
|
|
|
|
{{-- POPUP MODAL --}}
|
|
|
|
|
<div class="modal fade" id="invoiceModal" tabindex="-1">
|
|
|
|
|
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h5 class="modal-title">Invoice Details</h5>
|
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal-body" id="invoiceModalBody">
|
|
|
|
|
<p class="text-center text-muted">Loading...</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener('click', function(e) {
|
|
|
|
|
if (e.target.closest('.open-invoice-popup')) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
const id = e.target.closest('.open-invoice-popup').dataset.id;
|
|
|
|
|
const modal = new bootstrap.Modal(document.getElementById('invoiceModal'));
|
|
|
|
|
|
|
|
|
|
document.getElementById('invoiceModalBody').innerHTML =
|
|
|
|
|
"<p class='text-center text-muted'>Loading...</p>";
|
|
|
|
|
|
|
|
|
|
modal.show();
|
|
|
|
|
|
|
|
|
|
fetch(`/admin/invoices/${id}/popup`)
|
|
|
|
|
.then(res => res.text())
|
|
|
|
|
.then(html => {
|
|
|
|
|
document.getElementById('invoiceModalBody').innerHTML = html;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2025-11-06 17:09:52 +05:30
|
|
|
@endsection
|