2025-11-25 13:14:53 +05:30
|
|
|
{{-- INVOICE CONTENT (NO POPUP WRAPPERS HERE) --}}
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
INVOICE HEADER
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="mb-4">
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
2025-11-18 14:35:58 +05:30
|
|
|
<div class="col-md-6">
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
<h2 class="fw-bold text-primary mb-1">
|
2025-11-25 13:14:53 +05:30
|
|
|
<i class="fas fa-file-invoice me-2"></i> INVOICE
|
2025-11-18 14:35:58 +05:30
|
|
|
</h2>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
<h4 class="fw-bold text-dark mb-0">{{ $invoice->invoice_number }}</h4>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
{{-- ORDER + SHIPMENT INFO --}}
|
|
|
|
|
<div class="mt-2 small">
|
|
|
|
|
|
|
|
|
|
{{-- ORDER ID --}}
|
|
|
|
|
@if($invoice->order_id)
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Order ID:</strong>
|
|
|
|
|
{{ $invoice->order->order_id ?? $invoice->order_id }}
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
{{-- SHIPMENT ID --}}
|
|
|
|
|
@if(isset($shipment) && $shipment)
|
|
|
|
|
<div>
|
|
|
|
|
<strong>Shipment ID:</strong> {{ $shipment->shipment_id }}
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
<div class="col-md-6 text-end">
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
<span class="badge fs-6 px-3 py-2
|
|
|
|
|
@if($invoice->status=='paid') bg-success
|
|
|
|
|
@elseif($invoice->status=='overdue') bg-danger
|
|
|
|
|
@elseif($invoice->status=='pending') bg-warning text-dark
|
|
|
|
|
@else bg-secondary @endif">
|
|
|
|
|
|
|
|
|
|
<i class="fas
|
|
|
|
|
@if($invoice->status=='paid') fa-check-circle
|
|
|
|
|
@elseif($invoice->status=='overdue') fa-exclamation-circle
|
|
|
|
|
@elseif($invoice->status=='pending') fa-clock
|
|
|
|
|
@else fa-question-circle @endif me-1"></i>
|
|
|
|
|
|
|
|
|
|
{{ ucfirst($invoice->status) }}
|
|
|
|
|
</span>
|
|
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-17 10:33:11 +05:30
|
|
|
|
2025-11-25 13:14:53 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
DATES SECTION
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="card border-0 shadow-sm mb-4">
|
|
|
|
|
<div class="card-body py-3">
|
|
|
|
|
|
|
|
|
|
<div class="row text-center align-items-center">
|
|
|
|
|
|
|
|
|
|
<div class="col-md-5">
|
|
|
|
|
<small class="text-muted fw-semibold">INVOICE DATE</small>
|
|
|
|
|
<div class="fw-bold text-dark">
|
|
|
|
|
{{ \Carbon\Carbon::parse($invoice->invoice_date)->format('M d, Y') }}
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-17 10:33:11 +05:30
|
|
|
|
2025-11-25 13:14:53 +05:30
|
|
|
<div class="col-md-2">
|
|
|
|
|
<i class="fas fa-arrow-right text-muted"></i>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-5">
|
|
|
|
|
<small class="text-muted fw-semibold">DUE DATE</small>
|
|
|
|
|
<div class="fw-bold {{ $invoice->status=='overdue' ? 'text-danger' : 'text-dark' }}">
|
|
|
|
|
{{ \Carbon\Carbon::parse($invoice->due_date)->format('M d, Y') }}
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
</div>
|
2025-11-17 10:33:11 +05:30
|
|
|
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
CUSTOMER DETAILS
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="card border-0 shadow-sm mb-4">
|
|
|
|
|
|
|
|
|
|
<div class="card-header bg-light py-2">
|
|
|
|
|
<h6 class="fw-bold mb-0"><i class="fas fa-user me-2"></i> Customer Details</h6>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<h6 class="fw-bold text-primary">{{ $invoice->customer_name }}</h6>
|
|
|
|
|
|
|
|
|
|
@if($invoice->company_name)
|
|
|
|
|
<p class="mb-1"><strong>Company:</strong> {{ $invoice->company_name }}</p>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<p class="mb-1"><strong>Mobile:</strong> {{ $invoice->customer_mobile }}</p>
|
|
|
|
|
<p class="mb-1"><strong>Email:</strong> {{ $invoice->customer_email }}</p>
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<p class="mb-1"><strong>Address:</strong><br>{{ $invoice->customer_address }}</p>
|
|
|
|
|
<p class="mb-1"><strong>Pincode:</strong> {{ $invoice->pincode }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-17 10:33:11 +05:30
|
|
|
|
2025-11-25 13:14:53 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
INVOICE ITEMS
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="card border-0 shadow-sm mb-4">
|
|
|
|
|
|
|
|
|
|
<div class="card-header bg-light py-2">
|
|
|
|
|
<h6 class="fw-bold mb-0"><i class="fas fa-list me-2"></i> Invoice Items</h6>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
|
|
|
|
|
<table class="table table-bordered table-hover align-middle mb-0">
|
|
|
|
|
|
|
|
|
|
<thead class="table-light">
|
|
|
|
|
<tr>
|
|
|
|
|
<th>#</th>
|
|
|
|
|
<th>Description</th>
|
|
|
|
|
<th>CTN</th>
|
|
|
|
|
<th>QTY</th>
|
|
|
|
|
<th>TTL/QTY</th>
|
|
|
|
|
<th>Unit</th>
|
|
|
|
|
<th>Price</th>
|
|
|
|
|
<th>TTL Amount</th>
|
|
|
|
|
<th>CBM</th>
|
|
|
|
|
<th>TTL CBM</th>
|
|
|
|
|
<th>KG</th>
|
|
|
|
|
<th>TTL KG</th>
|
|
|
|
|
<th>Shop No</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
@foreach($invoice->items as $i => $item)
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="text-center fw-bold">{{ $i + 1 }}</td>
|
|
|
|
|
<td>{{ $item->description }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->ctn }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->qty }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->ttl_qty }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->unit }}</td>
|
|
|
|
|
<td class="text-center">₹{{ number_format($item->price,2) }}</td>
|
|
|
|
|
<td class="text-center fw-bold text-primary">₹{{ number_format($item->ttl_amount,2) }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->cbm }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->ttl_cbm }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->kg }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->ttl_kg }}</td>
|
|
|
|
|
<td class="text-center">{{ $item->shop_no }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforeach
|
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
FINAL SUMMARY
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6 offset-md-6">
|
|
|
|
|
|
|
|
|
|
<div class="card border-0 bg-light">
|
|
|
|
|
|
|
|
|
|
<div class="card-header bg-dark text-white py-2">
|
|
|
|
|
<h6 class="fw-bold mb-0"><i class="fas fa-calculator me-2"></i> Final Summary</h6>
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
|
|
<div class="d-flex justify-content-between mb-2 border-bottom pb-1">
|
|
|
|
|
<span class="fw-semibold">Amount:</span>
|
|
|
|
|
<span class="fw-bold">₹{{ number_format($invoice->final_amount, 2) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if($invoice->tax_type === 'gst')
|
|
|
|
|
{{-- CGST --}}
|
|
|
|
|
<div class="d-flex justify-content-between mb-2 border-bottom pb-1">
|
|
|
|
|
<span class="fw-semibold">CGST ({{ $invoice->cgst_percent }}%):</span>
|
|
|
|
|
<span class="fw-bold text-danger">₹{{ number_format($invoice->gst_amount/2, 2) }}</span>
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
{{-- SGST --}}
|
|
|
|
|
<div class="d-flex justify-content-between mb-2 border-bottom pb-1">
|
|
|
|
|
<span class="fw-semibold">SGST ({{ $invoice->sgst_percent }}%):</span>
|
|
|
|
|
<span class="fw-bold text-danger">₹{{ number_format($invoice->gst_amount/2, 2) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@elseif($invoice->tax_type === 'igst')
|
|
|
|
|
{{-- IGST --}}
|
|
|
|
|
<div class="d-flex justify-content-between mb-2 border-bottom pb-1">
|
|
|
|
|
<span class="fw-semibold">IGST ({{ $invoice->igst_percent }}%):</span>
|
|
|
|
|
<span class="fw-bold text-danger">₹{{ number_format($invoice->gst_amount, 2) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<div class="d-flex justify-content-between pt-1">
|
|
|
|
|
<span class="fw-bold text-dark">Total Payable:</span>
|
|
|
|
|
<span class="fw-bold text-success">₹{{ number_format($invoice->final_amount_with_gst, 2) }}</span>
|
2025-11-18 14:35:58 +05:30
|
|
|
</div>
|
2025-11-25 13:14:53 +05:30
|
|
|
|
2025-11-17 10:33:11 +05:30
|
|
|
</div>
|
2025-11-18 14:35:58 +05:30
|
|
|
|
2025-11-25 13:14:53 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
FOOTER — DOWNLOAD & SHARE
|
|
|
|
|
============================ -->
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
|
|
|
|
|
@if($invoice->pdf_path)
|
|
|
|
|
<a href="{{ asset($invoice->pdf_path) }}" class="btn btn-primary" download>
|
|
|
|
|
<i class="bi bi-download me-1"></i> Download PDF
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<button class="btn btn-success" onclick="shareInvoice()">
|
|
|
|
|
<i class="bi bi-share me-1"></i> Share
|
|
|
|
|
</button>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<!-- <button class="btn btn-secondary" data-bs-dismiss="modal">Close</button> -->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================
|
|
|
|
|
SHARE SCRIPT
|
|
|
|
|
============================ -->
|
|
|
|
|
<script>
|
|
|
|
|
function shareInvoice() {
|
|
|
|
|
const shareData = {
|
|
|
|
|
title: "Invoice {{ $invoice->invoice_number }}",
|
|
|
|
|
text: "Sharing invoice {{ $invoice->invoice_number }}",
|
|
|
|
|
url: "{{ asset($invoice->pdf_path) }}"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (navigator.share) {
|
|
|
|
|
navigator.share(shareData).catch(() => {});
|
|
|
|
|
} else {
|
|
|
|
|
navigator.clipboard.writeText(shareData.url);
|
|
|
|
|
alert("Link copied! Sharing not supported on this browser.");
|
|
|
|
|
}
|
2025-11-18 14:35:58 +05:30
|
|
|
}
|
2025-11-25 13:14:53 +05:30
|
|
|
</script>
|