feat: add custom signature image and signer details support to invoices and settings

This commit is contained in:
I-Fun
2026-04-05 12:03:11 +07:00
parent 64092d3abc
commit 12d44cbecc
15 changed files with 510 additions and 196 deletions

View File

@@ -7,7 +7,7 @@
@section('content')
<div class="max-w-3xl mx-auto">
<div class="cat-card p-4 lg:p-8" x-data="invoiceEditForm()">
<form action="{{ route('invoices.update', $invoice) }}" method="POST">
<form action="{{ route('invoices.update', $invoice) }}" method="POST" enctype="multipart/form-data">
@csrf @method('PUT')
{{-- Header fields --}}
@@ -146,9 +146,39 @@
</div>
<div class="mb-5">
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes</label>
<label class="block text-sm font-semibold text-gray-700 mb-1">Notes / Payment Terms</label>
<textarea name="notes" rows="2" class="input-soft resize-none">{{ old('notes', $invoice->notes) }}</textarea>
</div>
<div class="mb-5" x-data="{
removeSign() {
if (!confirm('Remove the signature from this invoice?')) return;
$refs.removeSignInput.value = '1';
this.$el.closest('form').submit();
}
}">
<label class="block text-sm font-semibold text-gray-700 mb-1">Custom Signature Image (Optional)</label>
<p class="text-xs text-gray-400 mb-3">Upload a specific signature for this invoice. Leave blank to keep the current one.</p>
@if($invoice->signature_image)
<div class="flex items-center gap-4 mb-3 p-3 bg-white rounded-xl border border-pink-100">
<img src="{{ '/storage/' . $invoice->signature_image }}" alt="Signature" class="h-16 object-contain">
<div>
<input type="hidden" name="remove_signature" value="0" x-ref="removeSignInput">
<button type="button" @click="removeSign()" class="text-xs px-3 py-1.5 rounded-full border border-red-200 text-red-400 hover:bg-red-50">
🗑️ Remove
</button>
</div>
</div>
@endif
<input type="file" name="signature_image" accept="image/*" class="w-full text-sm text-gray-600
file:mr-3 file:py-1.5 file:px-4
file:rounded-full file:border-0
file:text-xs file:font-semibold
file:bg-pink-50 file:text-pink-600
hover:file:bg-pink-100 cursor-pointer">
</div>
<div class="flex flex-col sm:flex-row gap-3">
<button type="submit" class="btn-sakura flex-1 py-3">💾 Save Changes</button>