updated client payment, file upload and notes

This commit is contained in:
Kwesi Banson Jnr
2026-08-08 20:47:45 +00:00
parent daf7d9b9dc
commit 6cce100e62
17 changed files with 508 additions and 94 deletions

View File

@@ -16,6 +16,7 @@
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Code Type</label>
<select name="code_type" class="form-select" required>
<option value="" selected disabled>-- Select --</option>
<option value="sms">SMS</option>
<option value="ussd">USSD</option>
<option value="voice">Voice</option>
@@ -23,16 +24,44 @@
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Short Code / Number</label>
<input type="text" name="shortcode" class="form-control" placeholder="e.g. 1234 or *123#" required>
<input type="number" name="shortcode" class="form-control" placeholder="e.g. 5678" required>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Network</label>
<input type="text" name="network" class="form-control" placeholder="e.g. MTN, Vodafone, AirtelTigo">
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Monthly Fee</label>
<input type="text" name="monthly_fee" class="form-control" placeholder="">
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Toll Free</label>
<select name="toll_free" class="form-select" required>
<option value="" selected disabled>-- Select --</option>
<option value="yes">YES</option>
<option value="no">NO</option>
</select>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Status</label>
<select name="status" class="form-select" required>
<option value="" selected disabled>-- Select --</option>
<option value="active">Active</option>
<option value="inactive">Inactive</option>
</select>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Launch Date</label>
<input type="date" name="launch_date" class="form-control">
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Expiry Date</label>
<input type="date" name="expiry_date" class="form-control">
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Remarks</label>
<textarea name="remarks" class="form-control"></textarea>
</div>
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
@@ -63,6 +92,13 @@
<label class="form-label text-muted small fw-bold">Invoice / Reference Number</label>
<input type="text" name="invoice_number" class="form-control" placeholder="e.g. INV-2026-001" required>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Services</label>
<select name="services[]" id="paymentServicesSelect" class="form-select" multiple="multiple" required>
<!-- Options will be loaded dynamically via AJAX -->
</select>
<div class="form-text text-muted">Select one or more services associated with this payment.</div>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Amount</label>
<input type="number" step="0.01" name="invoice_amount" class="form-control" placeholder="0.00" required>
@@ -91,35 +127,78 @@
<!-- ========================================== -->
<!-- 3. UPLOAD DOCUMENT MODAL -->
<!-- 3. UPLOAD DOCUMENT MODAL (MULTI-FILE) -->
<!-- ========================================== -->
<div class="modal fade" id="uploadDocumentModal" tabindex="-1" aria-labelledby="uploadDocumentModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form id="documentForm" action="{{ route('client-files.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<input type="hidden" name="client_id" value="{{ $showclient->id }}">
<div class="modal-header">
<h5 class="modal-title fw-bold" id="uploadDocumentModalLabel"><i class="bi bi-file-earmark-arrow-up text-primary me-2"></i>Upload Client Document</h5>
<h5 class="modal-title fw-bold" id="uploadDocumentModalLabel"><i class="bi bi-file-earmark-arrow-up text-primary me-2"></i>Upload Client Documents</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Document Name / Title</label>
<input type="text" name="name" class="form-control" placeholder="e.g. Signed Service Agreement" required>
</div>
<div class="mb-3">
<label class="form-label text-muted small fw-bold">Select File</label>
<input type="file" name="file" class="form-control" required>
<div class="form-text text-muted">Accepted formats: PDF, DOC, DOCX, JPG, PNG (Max size depends on server config).</div>
<div id="fileRowsContainer">
<!-- Initial Row -->
<div class="file-row card border bg-light p-3 mb-3 position-relative">
<div class="row g-2 align-items-center">
<div class="col-md-5">
<label class="form-label text-muted small fw-bold">Document Name / Title</label>
<input type="text" name="names[]" class="form-control" placeholder="e.g. Signed Service Agreement" required>
</div>
<div class="col-md-6">
<label class="form-label text-muted small fw-bold">Select File</label>
<input type="file" name="files[]" class="form-control" required>
</div>
<div class="col-md-1 text-end d-flex align-items-end">
<!-- Delete button hidden for the first row -->
<button type="button" class="btn btn-outline-danger btn-sm remove-row-btn mt-4" style="display: none;"><i class="bi bi-trash"></i></button>
</div>
</div>
</div>
</div>
<!-- Add More Button -->
<button type="button" id="addRowBtn" class="btn btn-sm btn-outline-secondary fw-bold mt-1">
<i class="bi bi-plus-circle me-1"></i> Add Another Document
</button>
<div class="form-text text-muted mt-2">Accepted formats: PDF, DOC, DOCX, JPG, PNG. You can upload multiple files at once.</div>
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-sm px-4">Upload Document</button>
<button type="submit" class="btn btn-primary btn-sm px-4">Upload All Documents</button>
</div>
</form>
</div>
</div>
</div>
<!-- Client Note Modal -->
<div class="modal fade" id="addNoteModal" tabindex="-1" aria-labelledby="addNoteModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form id="noteForm" action="{{ route('client-notes.store') }}" method="POST">
@csrf
<input type="hidden" name="client_id" value="{{ $showclient->id }}">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fw-bold">Add Note</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<textarea name="note" class="form-control" rows="4" placeholder="Enter notes here..." required></textarea>
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-sm">Save Note</button>
</div>
</div>
</form>
</div>
</div>