initial commit
This commit is contained in:
104
resources/views/invoices/show.blade.php
Normal file
104
resources/views/invoices/show.blade.php
Normal file
@@ -0,0 +1,104 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $invoice->invoice_number)
|
||||
@section('page-title', 'Invoice ' . $invoice->invoice_number)
|
||||
@section('page-subtitle', $invoice->title)
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="flex gap-3 mb-6">
|
||||
<a href="{{ route('invoices.edit', $invoice) }}" class="btn-sakura">Edit</a>
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank" class="btn btn-outline rounded-full text-pink-500 border-pink-300">📥 Download PDF</a>
|
||||
<form action="{{ route('invoices.destroy', $invoice) }}" method="POST" onsubmit="return confirm('Delete this invoice?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-ghost rounded-full text-error">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="cat-card p-8">
|
||||
{{-- Invoice Header --}}
|
||||
<div class="flex justify-between items-start mb-8">
|
||||
<div>
|
||||
<div class="text-2xl font-extrabold text-pink-500 flex items-center gap-2">🐱 KOL Manager</div>
|
||||
<div class="text-sm text-gray-400 mt-1">Personal Talent Assistant</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="text-2xl font-bold text-gray-800">{{ $invoice->invoice_number }}</div>
|
||||
<span class="badge {{ $invoice->status->badgeClass() }} mt-1">{{ $invoice->status->label() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Billing Info --}}
|
||||
<div class="grid grid-cols-2 gap-8 mb-8">
|
||||
<div>
|
||||
<h4 class="text-xs font-bold text-gray-400 uppercase mb-2">Bill To</h4>
|
||||
@if($invoice->client)
|
||||
<div class="font-semibold text-gray-800">{{ $invoice->client->name }}</div>
|
||||
@if($invoice->client->company) <div class="text-sm text-gray-500">{{ $invoice->client->company }}</div> @endif
|
||||
@if($invoice->client->email) <div class="text-sm text-gray-500">{{ $invoice->client->email }}</div> @endif
|
||||
@if($invoice->client->full_address) <div class="text-sm text-gray-400">{{ $invoice->client->full_address }}</div> @endif
|
||||
@else
|
||||
<div class="text-gray-500 text-sm">No client</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="text-xs font-bold text-gray-400 uppercase mb-2">Invoice Details</div>
|
||||
<div class="text-sm space-y-1">
|
||||
<div><span class="text-gray-400">Issue:</span> {{ $invoice->issue_date->format('d M Y') }}</div>
|
||||
<div><span class="text-gray-400">Due:</span> <span class="{{ $invoice->due_date->isPast() && $invoice->status->value !== 'paid' ? 'text-red-500 font-bold' : '' }}">{{ $invoice->due_date->format('d M Y') }}</span></div>
|
||||
@if($invoice->paid_date) <div><span class="text-gray-400">Paid:</span> {{ $invoice->paid_date->format('d M Y') }}</div> @endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Line Items --}}
|
||||
<table class="w-full mb-6">
|
||||
<thead class="bg-pink-50">
|
||||
<tr class="text-xs text-gray-500 uppercase">
|
||||
<th class="text-left py-3 px-4 rounded-l-2xl">Description</th>
|
||||
<th class="text-center py-3 px-4">Qty</th>
|
||||
<th class="text-right py-3 px-4">Unit Price</th>
|
||||
<th class="text-right py-3 px-4 rounded-r-2xl">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoice->items as $item)
|
||||
<tr class="border-b border-pink-50">
|
||||
<td class="py-3 px-4 text-sm text-gray-700">{{ $item->description }}</td>
|
||||
<td class="py-3 px-4 text-sm text-center text-gray-600">{{ $item->quantity }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right text-gray-600">Rp {{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
<td class="py-3 px-4 text-sm text-right font-semibold text-gray-800">Rp {{ number_format($item->total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{-- Totals --}}
|
||||
<div class="flex justify-end mb-8">
|
||||
<div class="w-64 space-y-2 text-sm">
|
||||
<div class="flex justify-between text-gray-500">
|
||||
<span>Subtotal</span><span class="font-medium">Rp {{ number_format($invoice->subtotal, 0, ',', '.') }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-gray-500">
|
||||
<span>Tax ({{ $invoice->tax_rate }}%)</span><span class="font-medium">Rp {{ number_format($invoice->tax_amount, 0, ',', '.') }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-base font-bold text-pink-600 pt-2 border-t border-pink-200">
|
||||
<span>Total</span><span>{{ $invoice->formatted_total }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Bank Info --}}
|
||||
@if($invoice->bank_name)
|
||||
<div class="bg-pink-50 rounded-2xl p-4 text-sm">
|
||||
<div class="font-semibold text-gray-700 mb-2">💳 Payment Info</div>
|
||||
<div class="text-gray-600">{{ $invoice->bank_name }} · {{ $invoice->bank_account }} · {{ $invoice->bank_holder }}</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($invoice->notes)
|
||||
<div class="mt-4 text-sm text-gray-500 italic">{{ $invoice->notes }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user