# NUE OneERP Charter Hire & Certification Centre · RC4
## Benjamin’s source export · 1 December 2026

Use RC4 instead of RC2 or RC3. It was merged into the latest OneERP source export supplied by Benjamin. Existing RC22 approval and RC23 warehouse routes were retained. The package includes a marked On-Hire specimen carrying the official NUE logo. No live deployment was performed.

The installer verifies every target file against Benjamin’s export or the exact RC3 file hashes. It stops on mismatches before changing app files. It does not require a Git checkout. The source export’s SHA-256 is recorded in manifest.json. This establishes what was tested, not the revision running in production.

### Candidate contents

- Six document types: On-Hire, Off-Hire, Re-On-Hire, Redelivery, Notice of Readiness and Bunker ROB.
- Contract Room entry, charter-specific register and immutable signed snapshots. A maker submits for separate Technical, HSE, Legal and executive review. The main workbench shows My Next Actions, search and filters, certificate progress, and links to the source contract, vessel, CPA, Controlled Outputs and Finance where authorized. The ERP sidebar and Approvals workspace provide direct entry points. Each internal reviewer attests after password confirmation. No maker or prior reviewer can approve a later step on the same record.
- Executive sends a 72-hour, one-use invitation to the designated charterer representative. The signer reviews the bound snapshot and explicitly consents. The token is hashed in storage. This is evidence-backed electronic attestation, not a CA-backed PDF signature or independent identity check. Legal must confirm that the signing method and NOR delivery timing suit each charter.
- Company-branded PDF archived in Controlled Outputs. Every new certificate embeds the official NUE Offshore logo from the OneERP source as part of the signed snapshot. If the issuing company uses a different logo, its letterhead stays primary and NUE appears as a separately labelled OneERP platform brand. The enclosed On-Hire PDF is generated from the same template with fictitious data and is marked SPECIMEN. Public QR verification returns issue or void status, certificate number, type, issue time and a fingerprint for comparison. It does not disclose the certificate, charter terms or signatory details.
- Restricted vessel evidence and a Finance view of issued or voided events. A complete issued timeline calculates elapsed and recorded off-hire hours. It does not post invoices, amend the ledger, apply a deduction, or change a dispatch or charter status automatically. Off-Hire and Re-On-Hire must match the existing period on the contract.
- Signed certificate output is not overwritten. Return/void reasons and replacements are recorded. Void dependent certificates before an earlier event. This module does not substitute for an independent survey.

- Staff reviewers type their own name, explicitly consent, and confirm their password to electronically sign. The audit keeps the authenticated account, typed signature, time and certificate snapshot hash. Charterers continue to type their name through the existing private signing link. No qualified or certificate-backed digital signature is represented.
- Executed CPA is available from the certification centre and the charter record. Authorized staff upload the PDF supplied by the owner, charterer, or both. Submit one jointly signed PDF, combining counterparts first if necessary. The uploader assigns one eligible independent reviewer. The reviewer signs and selects the authorized Accounts recipient. Only that recipient receives the handoff. Other Accounts users in the same company do not see the item or PDF. Accounts can acknowledge receipt and request controlled access to the CPA and its issued On-Hire certificate. For charter Controlled Outputs, the certificate maker, recorded reviewers and issuer may request access if they still have native permission. CPA access is limited to the uploader, assigned reviewer and named Accounts recipient after forwarding. Group, company or admin membership alone does not make these files visible. Native approval remains in force. The change does not alter permissions for other Controlled Outputs modules. Client/owner upload without a OneERP account is not part of this release. The module does not alter the existing CPA document workflow.
- After acknowledging receipt, Accounts can explicitly prepare a native Commercial Finance draft for daily-rate time charters in USD or NGN. The issued On-Hire Certificate establishes the earliest billable timestamp, the recorded CPA's ERP charter supplies the suggested daily rate, and Accounts supplies the billing period. An issued redelivery limits that period. The system does not attempt to interpret the signed PDF or apply rounding clauses, off-hire deductions, taxes, extras, split currency or lump-sum rules on its own. Accounts verifies the terms against the signed CPA, chooses the billing customer, adjusts the amounts as needed, and explicitly saves. The draft links the CPA, On-Hire Certificate and period and rejects overlapping periods already covered by a non-cancelled linked invoice. The existing invoicing, approval and posting workflows remain responsible for what happens next.

### Staging installation

1. Extract the ZIP outside the application directory. Use Python 3.10+ and a staging checkout matching the export. Keep a deployment backup of the app, database and private uploads. Use an installer account with appropriate file permissions, and prevent parallel deployment writers.
2. Dry run, then explicitly apply. Replace the paths below with staging paths.

   ```sh
   python3 install.py --target /path/to/oneerp-staging
   python3 install.py --target /path/to/oneerp-staging --apply
   ```

   An exact re-run is a no-op. If any target differs, stop and have the release rebased. Do not copy the payload over the conflicts. The installer backs up replaced files with a restore manifest, verifies all installed bytes and leaves the database, environments, caches and built assets alone.
3. Keep `CHARTER_HIRE_ENABLED=false` during initial deployment. Verify the existing Commercial Companies, RC22 and base schema migrations are applied. On the staging host, review pending migrations and run the four additive module migrations on the existing database:

   ```sh
   php artisan migrate:status
   php artisan migrate --force \
     --path=database/migrations/2026_12_01_160000_create_charter_hire_certificate_records.php \
     --path=database/migrations/2026_12_01_160001_create_charter_executed_cpas.php \
     --path=database/migrations/2026_12_01_160002_create_charter_invoice_sources.php \
     --path=database/migrations/2026_12_01_160003_assign_charter_cpa_document_access.php
   npm ci
   npm run build
   ```

4. Confirm canonical HTTPS `APP_URL`, Node and the existing `qrcode` dependency on the worker, Dompdf/PHP GD, Poppler, sandbox signing mail and private local storage compatible with the existing Controlled Outputs preview service. Do not expose the private upload directory. Redact signing links in shared request/error logs.
5. Set the approved company grants in `CHARTER_HIRE_GRANTS` before enabling. JSON is keyed by staff user ID then commercial company ID, for example `{"101":{"12":["make","view"]},"104":{"12":["legal"]},"106":{"12":["finance"]}}`. IDs are examples only. Upload still requires normal charter record and document-upload permissions. Accounts queue access requires the company `finance` grant as well as existing Accounts and payment visibility. Keep document review independent of upload. Set registered owner names and letterheads in existing records. Clear/rebuild application config and route caches following the staging deployment procedure after enabling the feature.
   If RC3 has already been used, the migration copies recorded CPA reviewers and Accounts acknowledgers into the new assignment fields. Records without an evidenced assignee stay restricted. Identify any RC3 submissions or pending handoffs before rollout and have Benjamin reconcile their named assignees from the existing evidence on staging. Do not assign them by department alone.
6. Test the certificate and executed CPA flows below before enabling production. Ask Benjamin to report the staging branch/commit and test results. The attached specimen is for review only.

### Staging acceptance matrix

| Area | Required evidence |
|---|---|
| Isolation | Disabled routes unavailable. Inactive, unassigned and cross-company users cannot browse, review, issue, preview or fetch output by direct URL. Verify an unassigned Legal user and Accounts user in the same company are also denied. Users with vessel or Finance-only grants cannot open the certificate detail. Existing staff and document links work as before. |
| Charter lifecycle | Exercise all six types. Check time-zone offsets (including Lagos, UTC and a negative offset), out-of-order transitions, duplicate issuance, failed issuance retry, mismatched off-hire period, closed/redelivered timeline and separate NOR receipt treatment. |
| Authority | Test same-user maker/reviewer denial, repeat reviewer denial, skipped stage denial, wrong-password rejection and two competing requests. Review an actual correction path and its audit trail. |
| External signing | Sandbox email delivery, lost/reissued link, expired link, consumed link, concurrent signing, wrong document digest, CSRF and unconsented request. The external route must not allow PDF download. |
| PDF and release | Complete issuance from the deployed runtime. Inspect both Nigerian and UK entity letterheads, ROB units, page breaks, timestamp and QR scan on a physical phone. Compare downloaded bytes with the verification fingerprint. Confirm the controlled output opens only with a valid native approval, content uses native controlled preview, and the native grant expires after 120 seconds. |
| Finance and Vessel | Verify exact elapsed time and recorded off-hire against a known interval; voids do not enter elapsed totals. Confirm no ledger or dispatch writes. Confirm company scope and that book currency, contractual deductions and invoices stay in existing Finance flows. |
| Recovery | Exercise failed mail, QR/runtime failure, storage failure and void. Verify no partial certificate can be publicly verified. Make sure existing charter and corporate document workflows still pass. |

| Executed CPA | Upload a jointly signed sample (or combined counterparts) in the correct company. Reject missing consent, duplicate attachment and cross-company access. Ensure the uploader cannot approve their own copy. Verify pending records do not appear in the Accounts queue, approved items do, and Accounts sees the same controlled PDF and records acknowledgement without creating an invoice. |
| Draft invoicing | After receipt, verify the matching On-Hire certificate and daily-rate prefill, rejection of invalid and overlapping periods, confirmation of CPA terms, the saved native draft and its source references. Confirm nothing is sent or posted. |
| Navigation | Enter from Chartering & Legal, Technical & PMS, HSE, Legal, Approvals, Vessel Manager and Finance with suitable grants. Verify certificate filters, action queue decisions and mobile layout. |
| Typed signature | Verify signer name and consent are required on approval and that the issued certificate shows the typed signature. Confirm the authenticated account remains in audit history. |

### Validation on Benjamin’s export

- Installer dry run, exact application, verified backups, idempotent rerun and refusal of a mismatched routes file passed on a clean copy of Benjamin’s export. The same installer also applied to an unmodified RC3 copy.
- PHP lint and Vite production build passed. Native Laravel route caching passed locally. The updated certificate register was browser-tested at desktop and mobile widths with no horizontal scrolling. Screenshots use synthetic test data. The already-present RC22 approval and RC23 warehouse routes were preserved.
- All four module migrations passed on a prepared local SQLite database, using the archive’s existing Controlled Outputs code. The standalone checks passed 24 workflow and seven company-scope assertions. The Laravel test passed 116 assertions from certificate approval and signing through controlled issuance, upload and handoff of executed CPA, and native draft invoice creation with both source references. The test uses fictitious parties and sandbox mail capture.
- The full fresh-install migration chain encountered an older migration that expects an existing staff account. We used the initialized base schema and applied the required Commercial, RC22 and module migrations separately. The historical migration was not edited. The staging branch and its database remain the final deployment check.
- The included On-Hire PDF is a design specimen with the same official logo asset and a test QR. It is not an issued document.

### Backout

Disable the feature and refresh config and routes caches. Keep the application-level output scope guard with preserved output records and files. Do not drop signed records or audit events. If rolling back the whole application revision, first ensure the earlier revision cannot expose a charter PDF record in the generic Controlled Outputs views. Do not rely on the older broad module scope. Re-enable only after the matching code and controls are restored.
