5.1 KiB
5.1 KiB
Dev Log — 2026-03-27
Non-EB Claims Module — Session 4
1. Edit Page: Policy & Account Details — Read-Only (Section 1 & 2)
- Replaced all dropdowns (Client, Branch, Policy, ACM) in Section 1 with readonly text inputs showing stored values
- Added hidden form inputs for
branch_idandacm_idto ensure values are submitted on update - Removed all AJAX-based client/branch/policy population JS (appendBranches, appendPolicies, resetBranch, resetPolicy, resetContact, formatDate, existingBranchId, existingPolicyId, client_select/branch_id/client_policy_id change handlers)
- Removed client/branch/ACM/contact validation from
validateNonEbForm()since sections are non-editable - Made Section 2 (Insured Contact Details) fully readonly — all 3 inputs get
readonly+readonly-colorclass
Model: Added branch_name to getTicketDataByTicketID select + JOIN client_branch cb so branch name is available in $td
2. Remove policy_section & policy_period
- Removed from
non_eb_claim_edit.phpSection 1 (already done previous session) - Removed
tm.policy_section,tm.policy_periodfromclaimSearch()select in controller - Removed both validation rules from
getValidationRules() - Removed from
NonEbTicketMasterModelallowedFields - Removed hidden
<th>and<td>columns fromnon_eb_claim_list.php - Added commented-out DROP COLUMN statements to
db.mdfor future cleanup
3. Policy Start Date & Policy Expiry Date
- Added
policy_start_date VARCHAR(20)andpolicy_end_date VARCHAR(20)tonon_eb_ticket_master(ALTER TABLE indb.md) - Added both fields to
NonEbTicketMasterModelallowedFields - Edit page: populated readonly inputs with
$td['policy_start_date']and$td['policy_end_date'] - Added PHP formatting at top of edit view — if stored value is
YYYY-MM-DD, converts toDD-MM-YYYYfor display
4. After Successful Update — Redirect to List
- Changed
location.reload()insubmitNonEbClaim()AJAX success handler tosetTimeout(() => window.location.href = base_url + 'non-eb-claim/list', 800)— 800ms delay so toast is visible
5. Claim Files Tab (new) — Edit Page
DB changes:
claim_files: addedticket_type TINYINT(1) DEFAULT 1(1=EB, 2=Non-EB) — existing EB records unaffectednon_eb_ticket_master: addedrequired_docs TEXTfor IR Documents checklist JSON
Model changes:
ClaimFilesModel: addedticket_typeto allowedFieldsNonEbTicketMasterModel: addedrequired_docsto allowedFields
Controller — 4 new methods in NonEbClaimController:
uploadFile()— URL or file upload intoclaim_fileswithticket_type=2getClaimFiles()— fetch files for ticket filtered byticket_type=2removeFile()— soft delete (is_active=0) by file idsaveIRDocs()— save IR Documents JSON tonon_eb_ticket_master.required_docs
Routes — 4 new routes added to /non-eb-claim group:
POST non-eb-claim/uploadFile
POST non-eb-claim/getClaimFiles
GET non-eb-claim/removeFile
POST non-eb-claim/saveIRDocs
Edit view:
- Added "Claim Files" tab to nav tabs
- Tab content includes: IR Documents checklist (with freeze toggle + save), file upload form (URL/file toggle), file list table, edit URL modal
- Full JS:
nonebLoadClaimFiles,nonebCreateFileList,nonebAddHTMLInput,nonebAddFileUploadHtml,nonebToggleUploadType, IR docs CRUD (nonebLoadConfiguration,nonebRenderDocumentList,nonebCreateDocumentRow,nonebAddDocument,nonebRemoveDocument,nonebSaveIRDocs,nonebToggleActionFreeze) - Reuses
downloadClaimFileglobal route for file downloads
Section 8 (Documents & Attachments):
- Commented out in both
non_eb_claim_form.phpandnon_eb_claim_edit.php(code preserved, not deleted)
6. Trigger — non_eb_ticket_master_after_update
- Written and added to
db.mdSection 6 - Tracks 22 fields into
ticket_historyon every UPDATE - TEXT fields (
loss_description,lor,surveyor_remarks,closure_remark) truncated to 500 chars in history - Skipped set-once/bulk fields:
client_id,branch_id,insurer_id,client_policy_id,insured_contact_*,google_drive_links,documents_*,asset_file,required_docs
Files Modified Today
| File | Changes |
|---|---|
app/Models/NonEbTicketMasterModel.php |
Added branch_name join, policy_start/end_date, required_docs to allowedFields; removed policy_section/period |
app/Models/ClaimFilesModel.php |
Added ticket_type to allowedFields |
app/Controllers/NonEbClaimController.php |
Removed policy_section/period from query & validation; added ClaimFilesModel; added 4 new Claim Files methods |
app/Config/Routes.php |
Added 4 non-eb-claim routes |
app/Views/non_eb_claim_edit.php |
Section 1 & 2 read-only; date formatting; Section 8 commented out; Claim Files tab added; redirect on update |
app/Views/non_eb_claim_form.php |
Section 8 commented out |
app/Views/non_eb_claim_list.php |
Removed policy_section/period hidden columns |
db.md |
ALTER TABLEs for policy dates, required_docs, ticket_type; trigger added as Section 6 |