# MASTER DEVELOPMENT PROMPT

## Professional UAE Transport Accounting and Operations Management System

Act as a senior software architect, chartered-accounting systems specialist, UAE VAT compliance specialist, transport-industry consultant, Laravel/PHP engineer, database architect, UI/UX designer, security engineer, QA engineer, and DevOps engineer.

Your task is to design and develop a complete, production-ready, secure, professional web-based accounting and transport operations management system for a UAE transport company.

This must be an actual working application, not a prototype, static design, demo dashboard, or collection of disconnected pages.

The application must correctly handle:

* Customers.
* Vendors and subcontractors.
* Parties that are both customers and vendors.
* Money received from customers.
* Money paid to vendors.
* Money received from vendors.
* Money paid or refunded to customers.
* Transport jobs and trips.
* Customer invoicing.
* Vendor bills.
* Receipts and payment vouchers.
* Business expenses.
* Contracts and rate agreements.
* UAE VAT.
* Double-entry accounting.
* Financial reports.
* User permissions and approvals.
* Company-branded PDF documents.
* Future UAE electronic invoicing integration.
* Optional AI-powered accounting assistance.

Do not simplify the accounting logic. Every posted financial transaction must create balanced double-entry journal entries.

---

# 1. PROJECT OBJECTIVE

Build a professional accounting and transport management application that allows the transport company to manage the complete transaction lifecycle:

1. Register a customer, vendor, subcontractor, driver, vehicle, or other business party.
2. Create customer and vendor agreements.
3. Define transport service rates.
4. Create a quotation or transport job.
5. Assign a vehicle, driver, and subcontractor.
6. Record pickup and delivery information.
7. Record trip revenue and trip costs.
8. Upload proof of delivery and supporting documents.
9. Generate customer tax invoices.
10. Record vendor bills.
11. Receive money from customers or vendors.
12. Pay vendors or refund customers.
13. Allocate receipts and payments against invoices or bills.
14. Record expenses and input VAT.
15. Reconcile bank and cash accounts.
16. Generate financial, VAT, customer, vendor, vehicle, route, and job-profitability reports.
17. Generate professional PDFs with the company logo and legal information.
18. Prepare invoices for UAE e-invoicing integration through an approved service provider.
19. Maintain a complete audit trail.

The system must be usable by company owners, accountants, cashiers, transport managers, dispatchers, operations staff, auditors, and management.

---

# 2. REQUIRED TECHNOLOGY

Use a stable, supported production stack.

Recommended stack:

* PHP 8.4 or later supported release.
* Laravel 13.
* MySQL 8 or MariaDB equivalent.
* Laravel Blade.
* Current stable Livewire where appropriate.
* Alpine.js for lightweight interaction.
* Tailwind CSS or Bootstrap with locally compiled assets.
* Laravel queues for emails, PDF generation, imports, notifications, AI processing, and e-invoice submissions.
* Redis where available, with database queue fallback.
* Laravel Scheduler for reminders and background jobs.
* Laravel Sanctum for secured APIs.
* Composer for PHP dependencies.
* Vite for frontend assets.
* PHPUnit or Pest for automated testing.
* A PDF engine that correctly supports English, Arabic, RTL text, logos, tables, pagination, and embedded fonts.

Do not load critical production assets through public CDNs.

Use:

* PSR-12 coding standards.
* Service classes.
* Form requests.
* Policies and gates.
* Repository or query-service patterns where they provide value.
* Database transactions for financial postings.
* Events and listeners.
* Jobs and queues.
* Proper foreign keys.
* Database indexes.
* Decimal database columns for money.
* Immutable posted accounting records.
* Clear separation between accounting logic and UI logic.

Store monetary amounts using appropriate decimal precision. Never use floating-point arithmetic for financial calculations.

Default settings:

* Currency: AED.
* Time zone: Asia/Dubai.
* Date format: configurable.
* Financial year: configurable.
* Languages: English first, with Arabic and RTL readiness.
* Default VAT rate: 5%, but fully configurable.
* Single legal entity initially.
* Multiple branches and departments under the legal entity.
* Architecture ready for future multi-company support.

---

# 3. CORE BUSINESS-PARTY MANAGEMENT

Create one central `Party` model.

A party may have one or more roles:

* Customer.
* Vendor.
* Subcontractor.
* Vehicle owner.
* Broker.
* Agent.
* Driver.
* Employee.
* Government entity.
* Other party.

A party may simultaneously be:

* A customer only.
* A vendor only.
* Both customer and vendor.
* A customer that sometimes receives refunds.
* A vendor that sometimes pays money to the company.
* A subcontractor with advances and recoveries.
* A transport partner where receivable and payable transactions occur.

Do not create duplicate customer and vendor records for the same legal entity unless specifically required.

Each party record must support:

* Legal name.
* Trade name.
* Party type.
* Customer/vendor role selection.
* Individual or company.
* UAE TRN.
* Trade licence number.
* Licence expiry date.
* Emirates ID or identification details where applicable.
* Contact person.
* Phone.
* Email.
* Billing address.
* Shipping or operational address.
* Emirate.
* Country.
* Credit limit.
* Credit period.
* Default currency.
* Default tax treatment.
* Default income account.
* Default expense account.
* Default receivable account.
* Default payable account.
* Opening receivable balance.
* Opening payable balance.
* Bank details.
* Documents and attachments.
* Notes.
* Active/inactive status.
* Assigned account manager.
* Assigned branch.
* Contract details.
* Withholding or retention settings where needed.
* E-invoicing electronic address and service-provider identifiers.
* Created-by and updated-by information.

## Separate Customer and Vendor Ledgers

Even when the same party is both a customer and vendor, maintain separate:

* Accounts receivable balance.
* Accounts payable balance.
* Customer invoices.
* Vendor bills.
* Customer receipts.
* Vendor payments.
* Customer credit notes.
* Vendor debit notes.
* Advances received.
* Advances paid.

Provide a consolidated party statement that displays:

* Total receivable.
* Total payable.
* Net exposure.
* Customer transactions.
* Vendor transactions.
* Advances.
* Allocated amounts.
* Unallocated amounts.
* Credit notes.
* Debit notes.
* Contra settlements.

Do not automatically net customer receivables against vendor payables.

Create an authorised `Contra Settlement` process where the user can offset an approved receivable against an approved payable. This process must:

* Require permission.
* Require approval where configured.
* Generate balanced journal entries.
* Maintain references to the affected invoice and vendor bill.
* Show the transaction in both customer and vendor statements.
* Prevent over-allocation.
* Maintain a complete audit trail.

---

# 4. DOUBLE-ENTRY ACCOUNTING ENGINE

Implement a complete double-entry accounting engine.

## Chart of Accounts

Support configurable account types:

### Assets

* Cash.
* Petty cash.
* Bank accounts.
* Accounts receivable.
* Employee advances.
* Driver advances.
* Vendor advances.
* Input VAT recoverable.
* Prepaid expenses.
* Deposits.
* Vehicle assets.
* Accumulated depreciation contra accounts.
* Other current and non-current assets.

### Liabilities

* Accounts payable.
* Customer advances.
* Output VAT payable.
* Accrued expenses.
* Loans.
* Credit cards.
* Security deposits received.
* Other current and non-current liabilities.

### Equity

* Owner capital.
* Retained earnings.
* Drawings.
* Current-year earnings.

### Income

* Transport income.
* Delivery income.
* Rental income.
* Handling charges.
* Loading and offloading income.
* Detention charges.
* Fuel surcharge income.
* Salik and toll recovery.
* Other service income.
* Gain accounts.

### Cost of Revenue

* Vendor transport cost.
* Subcontractor cost.
* Driver trip cost.
* Fuel cost.
* Salik and toll cost.
* Loading and offloading cost.
* Route permit cost.
* Trip-related maintenance.
* Other direct trip costs.

### Operating Expenses

* Salaries.
* Rent.
* Utilities.
* Office expenses.
* Vehicle maintenance.
* Insurance.
* Registration expenses.
* Fines.
* Telephone.
* Internet.
* Professional fees.
* Marketing.
* Depreciation.
* Bank charges.
* Other operating expenses.

## Journal Entry Requirements

Each journal entry must include:

* Journal number.
* Posting date.
* Document date.
* Reference number.
* Source module.
* Source document ID.
* Description.
* Branch.
* Department.
* Cost centre.
* Currency.
* Exchange rate.
* Debit total.
* Credit total.
* Status.
* Created by.
* Approved by.
* Posted by.
* Posting timestamp.
* Reversal reference.
* Supporting documents.
* Journal lines.

Every journal entry must balance before posting.

## Document States

Financial documents must use controlled statuses:

* Draft.
* Pending approval.
* Approved.
* Posted.
* Partially paid.
* Paid.
* Overdue.
* Rejected.
* Reversed.
* Cancelled, only when cancellation is legally and technically permitted.

A posted document must never be directly edited or deleted.

Corrections to posted documents must use:

* Reversal entries.
* Credit notes.
* Debit notes.
* Adjustment journals.
* Cancellation workflow where legally permitted.

Maintain a period-locking feature:

* Lock financial periods.
* Prevent backdated transactions in locked periods.
* Allow authorised temporary reopening.
* Record who opened and closed the period.
* Require a reason.

Support:

* Opening balances.
* Fiscal years.
* Accounting periods.
* Recurring journals.
* Accrual journals.
* Prepayment journals.
* Depreciation journals.
* Foreign-exchange adjustments.
* Year-end closing.
* Retained-earnings transfer.
* Manual journal vouchers with approval.

---

# 5. TRANSPORT OPERATIONS MODULE

## Service Types

Create configurable transport service types such as:

* Local transportation.
* Inter-emirate transportation.
* International transportation.
* Cargo delivery.
* Container transport.
* Passenger transport.
* Vehicle rental with driver.
* Vehicle rental without driver.
* Pickup service.
* Truck service.
* Bus service.
* Last-mile delivery.
* Moving service.
* Courier service.
* Contract transportation.
* Other transport services.

Do not assume the VAT treatment from the service name. Each service must have a configurable tax code reviewed by the company’s accountant.

## Transport Job

Each job must support:

* Job number.
* Branch.
* Customer.
* Customer contract.
* Customer purchase order.
* Job date.
* Requested date.
* Pickup date and time.
* Delivery date and time.
* Pickup location.
* Delivery location.
* Route.
* Origin emirate and country.
* Destination emirate and country.
* Service type.
* Cargo description.
* Quantity.
* Weight.
* Volume.
* Number of trips.
* Vehicle type.
* Vehicle.
* Driver.
* Subcontractor/vendor.
* Customer rate.
* Vendor rate.
* Additional charges.
* Discounts.
* Estimated revenue.
* Estimated cost.
* Actual revenue.
* Actual cost.
* Profit.
* Profit percentage.
* VAT treatment.
* Job status.
* Delivery status.
* Billing status.
* Vendor-billing status.
* Proof of delivery.
* Trip sheet.
* Customer documents.
* Vendor documents.
* Internal notes.
* Customer-visible notes.
* Attachments.
* Created by.
* Assigned operations staff.
* Approval status.

## Job Statuses

Provide configurable statuses such as:

* Enquiry.
* Quotation.
* Confirmed.
* Scheduled.
* Vehicle assigned.
* Driver assigned.
* In transit.
* Reached destination.
* Delivered.
* Proof of delivery received.
* Ready to invoice.
* Invoiced.
* Closed.
* Cancelled.

## Multiple Trips and Multiple Vendors

One customer job may have:

* One or multiple trips.
* One or multiple vehicles.
* One or multiple drivers.
* One or multiple vendors.
* Different rates for each trip.
* Different costs for each trip.
* Different pickup and delivery dates.

Allow revenue and costs to be allocated by:

* Job.
* Trip.
* Vehicle.
* Driver.
* Vendor.
* Route.
* Branch.
* Cost centre.

## Trip Expenses

Allow trip-related expenses including:

* Fuel.
* Salik.
* Toll.
* Parking.
* Loading.
* Offloading.
* Driver allowance.
* Food allowance.
* Accommodation.
* Border charges.
* Customs-related costs.
* Permit costs.
* Repairs.
* Tyres.
* Fines.
* Other costs.

Each trip expense must support:

* Expense category.
* Amount.
* VAT amount.
* Recoverable VAT.
* Payment method.
* Paid by company, employee, or driver.
* Receipt upload.
* Approval.
* Link to job, trip, vehicle, driver, and vendor.
* Reimbursement status.

## Proof of Delivery

Provide:

* POD upload.
* Multiple POD attachments.
* POD received date.
* Received by.
* Customer signature.
* Delivery remarks.
* Missing-POD alerts.
* Invoicing restriction where configured.
* Ability to permit invoicing without POD only with authorised approval.

---

# 6. VEHICLE MANAGEMENT

Support company-owned and externally hired vehicles.

Vehicle fields must include:

* Vehicle number.
* Plate number.
* Emirate.
* Vehicle type.
* Make.
* Model.
* Year.
* Chassis number.
* Engine number.
* Ownership type.
* Owner/vendor.
* Purchase cost.
* Purchase date.
* Current odometer.
* Fuel type.
* Fuel tank capacity.
* Payload capacity.
* Registration expiry.
* Insurance expiry.
* Permit expiry.
* Inspection expiry.
* Lease expiry.
* Assigned driver.
* Branch.
* Active/inactive status.
* Attachments.
* Notes.

Provide alerts for:

* Registration expiry.
* Insurance expiry.
* Permit expiry.
* Inspection expiry.
* Lease expiry.
* Scheduled maintenance.
* Odometer-based service.
* Vehicle document expiry.

## Vehicle Maintenance

Support:

* Preventive maintenance.
* Repair orders.
* Workshop/vendor.
* Odometer.
* Parts.
* Labour.
* VAT.
* Total cost.
* Downtime.
* Start and completion dates.
* Next-service date.
* Next-service odometer.
* Attachments.
* Approval.
* Accounting posting.

## Fuel Management

Support:

* Fuel entries.
* Vehicle.
* Driver.
* Odometer.
* Litres.
* Price per litre.
* Total amount.
* VAT.
* Fuel station/vendor.
* Payment method.
* Receipt.
* Job or trip reference.
* Fuel-efficiency report.
* Unusual-consumption alerts.

---

# 7. DRIVER MANAGEMENT AND SETTLEMENT

Driver records must support:

* Driver code.
* Name.
* Contact details.
* Employment or vendor status.
* Assigned vehicle.
* Driving licence number.
* Licence expiry.
* Visa expiry.
* Emirates ID expiry.
* Passport expiry.
* Salary or agreed rate.
* Per-trip allowance.
* Bank details.
* Documents.
* Branch.
* Active/inactive status.

## Driver Advances

Support:

* Cash advance.
* Bank advance.
* Trip advance.
* Salary advance.
* Advance approval.
* Advance payment voucher.
* Expense submission.
* Trip-expense adjustment.
* Balance recovery.
* Refund from driver.
* Carry-forward balance.
* Driver statement.

Generate accounting entries for every driver advance and settlement.

---

# 8. CUSTOMER QUOTATIONS

Create professional quotations containing:

* Company logo.
* Company legal name.
* Address.
* TRN.
* Telephone.
* Email.
* Quotation number.
* Customer details.
* Customer TRN.
* Quotation date.
* Expiry date.
* Service lines.
* Routes.
* Vehicle types.
* Quantity.
* Rate.
* VAT.
* Total.
* Payment terms.
* Validity.
* Terms and conditions.
* Authorised signature.
* Company stamp area.
* Attachments.

Quotation workflow:

* Draft.
* Pending approval.
* Sent.
* Viewed where tracking is enabled.
* Accepted.
* Rejected.
* Expired.
* Converted to job.
* Converted to contract.

Maintain quotation versions.

---

# 9. CUSTOMER CONTRACTS AND AGREEMENTS

Create a complete contract-management module.

Contract types:

* Customer transport agreement.
* Vendor/subcontractor agreement.
* Vehicle lease agreement.
* Route agreement.
* Rate agreement.
* Annual service agreement.
* Driver agreement.
* General business agreement.

Contract fields:

* Contract number.
* Contract title.
* Party.
* Contract type.
* Start date.
* End date.
* Renewal terms.
* Notice period.
* Billing cycle.
* Payment terms.
* Credit limit.
* Currency.
* Tax treatment.
* Deposit.
* Retention.
* Auto-renewal.
* Contract owner.
* Branch.
* Approval status.
* Signed date.
* Signed by.
* Attachments.
* Version history.
* Terms and conditions.
* Internal notes.
* Contract status.

## Rate Cards

Allow contract rate cards based on:

* Origin.
* Destination.
* Route.
* Vehicle type.
* Vehicle size.
* Distance.
* Weight.
* Volume.
* Number of trips.
* Hour.
* Day.
* Week.
* Month.
* Kilometre.
* Fixed amount.
* Minimum charge.
* Waiting time.
* Detention time.
* Loading.
* Offloading.
* Fuel surcharge.
* Salik and toll.
* Night charge.
* Weekend charge.
* Special cargo charge.
* Additional stop.
* Free waiting period.
* Effective date.
* Expiry date.

The system must automatically suggest the correct customer and vendor rates when creating a job. The user must be able to override a rate only with permission and a recorded reason.

Provide contract alerts:

* Expiring soon.
* Expired.
* Missing signature.
* Rate-card expiry.
* Credit-limit breach.
* Required renewal.

---

# 10. CUSTOMER INVOICING

Support:

* Standard tax invoice.
* Simplified tax invoice where legally applicable.
* Commercial invoice.
* Proforma invoice.
* Advance invoice.
* Recurring invoice.
* Consolidated invoice.
* Job-based invoice.
* Multi-job invoice.
* Debit note.
* Credit note.
* Customer refund.

## Invoice Fields

Each invoice must include:

* Invoice number.
* Clearly displayed invoice type.
* Company legal name.
* Company logo.
* Company address.
* Company TRN.
* Customer legal name.
* Customer address.
* Customer TRN where applicable.
* Invoice issue date.
* Date of supply.
* Due date.
* Customer purchase order.
* Contract reference.
* Job and trip references.
* Currency.
* Exchange rate.
* Service description.
* Quantity.
* Unit.
* Unit rate.
* Discount.
* Charges.
* Taxable amount.
* VAT category.
* VAT rate.
* VAT amount.
* Amount excluding VAT.
* Amount including VAT.
* Amount paid.
* Balance due.
* Payment terms.
* Bank details.
* Notes.
* Terms and conditions.
* Authorised signature.
* Company stamp area.
* E-invoice status where applicable.
* Unique internal verification reference.

Allow:

* Tax-inclusive pricing.
* Tax-exclusive pricing.
* Line-level discounts.
* Document-level discounts.
* Line-level charges.
* Document-level charges.
* Multiple tax codes.
* Partial invoicing.
* Progress billing.
* Advance adjustment.
* Retention.
* Rounding adjustment.
* Multi-currency.
* Invoice attachments.
* Emailing invoices.
* Customer portal access.
* Payment reminders.
* Recurring invoices.

## Invoice Posting

Typical accounting entry:

* Debit Accounts Receivable.
* Credit Transport or Service Income.
* Credit Output VAT.

The exact entries must depend on configured accounts and tax codes.

Prevent invoice posting where:

* Required customer details are missing.
* Totals do not reconcile.
* Tax calculation fails.
* Accounting period is locked.
* Required approval is missing.
* Invoice number already exists.
* Required POD is missing and no override approval exists.

---

# 11. CUSTOMER RECEIPTS

Support receipt methods:

* Cash.
* Bank transfer.
* Cheque.
* Post-dated cheque.
* Card.
* Online payment.
* Deposit.
* Contra settlement.
* Other method.

Receipt fields:

* Receipt voucher number.
* Receipt date.
* Party.
* Amount.
* Currency.
* Exchange rate.
* Payment method.
* Bank or cash account.
* Cheque number.
* Cheque date.
* Bank name.
* Transaction reference.
* Description.
* Branch.
* Attachments.
* Received by.
* Approval.
* Allocation details.

Allow:

* Full allocation.
* Partial allocation.
* Multiple-invoice allocation.
* Customer advance.
* Unallocated receipt.
* Vendor-originated receipt.
* Refund recovery.
* Overpayment.
* Credit-note allocation.

Receipt posting typically:

* Debit Cash or Bank.
* Credit Accounts Receivable or Customer Advance.

Generate a professional receipt PDF with:

* Company logo.
* Company information.
* Receipt number.
* Received-from name.
* Amount in numbers.
* Amount in words.
* Payment method.
* Invoice allocation.
* Balance.
* Signature.
* Stamp area.

Support cheque lifecycle:

* Received.
* In hand.
* Deposited.
* Cleared.
* Bounced.
* Replaced.
* Cancelled.

Generate the correct accounting adjustments for bounced cheques.

---

# 12. VENDOR BILLS AND ACCOUNTS PAYABLE

Support vendor bills for:

* Subcontracted transport.
* Fuel.
* Maintenance.
* Vehicle rental.
* Driver services.
* Loading and offloading.
* Salik.
* Tolls.
* Insurance.
* Registration.
* Office expenses.
* Other purchases.

Vendor-bill fields:

* Internal bill number.
* Vendor invoice number.
* Vendor.
* Vendor TRN.
* Invoice date.
* Date of supply.
* Due date.
* Purchase order.
* Job reference.
* Trip reference.
* Vehicle.
* Driver.
* Branch.
* Expense or cost account.
* Description.
* Quantity.
* Rate.
* Taxable amount.
* VAT code.
* Input VAT.
* Recoverable VAT.
* Non-recoverable VAT.
* Total.
* Payment status.
* Attachments.
* Approval status.

Prevent duplicate vendor invoices using:

* Vendor.
* Vendor invoice number.
* Invoice date.
* Amount.
* Attachment hash where useful.

Vendor-bill posting typically:

* Debit Expense, Asset, or Cost of Revenue.
* Debit Recoverable Input VAT where applicable.
* Credit Accounts Payable.

Support:

* Vendor credit note.
* Vendor debit note.
* Purchase return.
* Vendor advance.
* Advance adjustment.
* Retention.
* Partial payment.
* Multi-bill payment.
* Vendor refund.
* Payment reversal.
* Vendor statement reconciliation.

---

# 13. PAYMENT VOUCHERS

Support payments to:

* Vendors.
* Customers.
* Drivers.
* Employees.
* Government entities.
* Other parties.

Payment fields:

* Payment-voucher number.
* Payment date.
* Payee.
* Amount.
* Currency.
* Exchange rate.
* Bank or cash account.
* Payment method.
* Cheque details.
* Bank reference.
* Description.
* Bill allocation.
* Advance amount.
* Branch.
* Attachments.
* Prepared by.
* Approved by.
* Paid by.

Payment posting typically:

* Debit Accounts Payable, Advance, Expense, or Refund Liability.
* Credit Cash or Bank.

Create printable payment vouchers with signatures for:

* Prepared by.
* Checked by.
* Approved by.
* Received by.

---

# 14. EXPENSE MANAGEMENT

Expense categories must be configurable.

Support:

* Cash expenses.
* Bank expenses.
* Credit-card expenses.
* Employee-paid expenses.
* Driver-paid expenses.
* Recurring expenses.
* Prepaid expenses.
* Accrued expenses.
* Billable customer expenses.
* Non-billable expenses.
* Job-linked expenses.
* Vehicle-linked expenses.
* Branch-linked expenses.

Expense fields:

* Expense number.
* Date.
* Payee.
* Category.
* Account.
* Amount before VAT.
* VAT code.
* VAT amount.
* Recoverable VAT.
* Non-recoverable VAT.
* Total.
* Payment account.
* Job.
* Trip.
* Vehicle.
* Driver.
* Branch.
* Department.
* Cost centre.
* Receipt attachment.
* Description.
* Approval.
* Reimbursement status.

Use an approval workflow based on:

* Expense category.
* Amount.
* Branch.
* User.
* Department.

---

# 15. CASH, BANK, CHEQUE AND RECONCILIATION

Support multiple:

* Cash accounts.
* Petty-cash accounts.
* Bank accounts.
* Credit cards.
* Payment gateways.

Bank-account fields:

* Bank name.
* Account name.
* Account number.
* IBAN.
* SWIFT.
* Currency.
* Branch.
* General-ledger account.
* Opening balance.
* Active status.

Provide:

* Cashbook.
* Bankbook.
* Petty-cash register.
* Bank-transfer entries.
* Cash transfers.
* Bank transfers between accounts.
* Contra vouchers.
* Bank charges.
* Interest.
* Cheque register.
* Post-dated cheque register.
* Bank reconciliation.

## Bank Reconciliation

Allow:

* CSV or Excel bank-statement import.
* Manual transaction entry.
* Matching by amount, date, reference, and party.
* One-to-one matching.
* One-to-many matching.
* Many-to-one matching.
* Suggested matching.
* Manual matching.
* Unmatched transactions.
* Bank-charge creation.
* Reconciliation closing.
* Reconciliation history.

Never let AI or automatic matching post financial adjustments without user confirmation.

---

# 16. UAE VAT MODULE

Build a configurable UAE VAT module.

The module must support:

* Standard-rated supplies.
* Zero-rated supplies.
* Exempt supplies.
* Out-of-scope supplies.
* Reverse-charge transactions.
* Deemed supplies where configured.
* Imports.
* Exports.
* Mixed tax categories.
* Tax-inclusive amounts.
* Tax-exclusive amounts.
* Recoverable input VAT.
* Partially recoverable input VAT.
* Non-recoverable input VAT.
* Output VAT.
* VAT adjustments.
* Credit-note tax adjustments.
* Bad-debt adjustment support.
* Tax periods.
* VAT return preparation.
* VAT audit reports.

Do not hardcode every transport service at 5%.

The applicable VAT treatment may depend on:

* Local or international transport.
* Origin and destination.
* Type of service.
* Customer status.
* Place of supply.
* Supporting documents.
* Current UAE VAT rules.

Allow an authorised accountant to configure and approve the tax code.

## VAT Settings

Company VAT settings must include:

* VAT registered: yes/no.
* TRN.
* Registration date.
* Default VAT rate.
* VAT reporting frequency.
* Tax-period start and end.
* VAT accounting basis.
* Rounding method.
* Tax-inclusive default.
* Input VAT account.
* Output VAT account.
* VAT payable account.
* VAT receivable account.
* Reverse-charge accounts.
* Default tax codes.
* Branch VAT treatment.
* Tax-invoice numbering.

## VAT Reports

Generate:

* VAT sales report.
* VAT purchase report.
* Output VAT report.
* Input VAT report.
* Reverse-charge report.
* Zero-rated report.
* Exempt-supply report.
* Out-of-scope report.
* VAT transaction detail.
* VAT return working report.
* VAT audit file.
* Tax-invoice list.
* Tax-credit-note list.
* VAT reconciliation with general ledger.
* VAT exceptions report.
* Transactions missing TRN.
* Transactions with invalid tax setup.
* Manual VAT adjustments.

Prepare a VAT return summary aligned with the current UAE VAT-return structure, but do not claim that the application has filed a return unless an official and authorised filing integration has actually been completed.

Allow PDF, Excel, and CSV export.

Require accountant review before marking a VAT period as final.

---

# 17. UAE ELECTRONIC INVOICING READINESS

Build an e-invoicing integration layer designed for the UAE Electronic Invoicing System.

The system must not falsely claim to connect directly to the UAE government.

The UAE architecture requires businesses to work through an approved or accredited e-invoicing service provider. Therefore, build a provider-adapter system.

## Provider Adapter Architecture

Create an interface such as:

`EInvoiceProviderInterface`

Include methods such as:

* Validate company configuration.
* Validate party information.
* Validate invoice data.
* Generate structured invoice payload.
* Submit invoice.
* Submit credit note.
* Retrieve submission status.
* Receive inbound invoice.
* Receive inbound credit note.
* Process webhook.
* Download provider response.
* Retry failed submission.
* Cancel or correct according to provider and legal rules.
* Test credentials.
* Switch between sandbox and production.

Do not hardcode one provider.

Allow administrators to configure:

* Provider name.
* Sandbox URL.
* Production URL.
* Client ID.
* Client secret.
* API key.
* Certificate.
* Electronic address.
* Peppol identifier.
* Webhook secret.
* Connection status.
* Submission timeout.
* Retry policy.

Encrypt all credentials.

## Data Standards

Design the internal invoice-data model so it can map to:

* Current UAE PINT AE data requirements.
* OpenPeppol-compatible structured documents.
* XML or provider-required structured formats.
* Tax Data Document requirements.
* UAE tax invoice.
* UAE tax credit note.
* Commercial invoice.
* Reverse-charge invoice.
* Zero-rated invoice.
* Export invoice.
* Future self-billing scenarios.

Use the final official UAE schema and validation rules available at the actual integration date. Do not rely only on an old consultation schema.

## E-Invoice Statuses

Maintain internal provider-neutral statuses:

* Not applicable.
* Draft.
* Ready for validation.
* Validation failed.
* Ready for submission.
* Submitted.
* Processing.
* Delivered.
* Accepted where supported.
* Rejected.
* Failed.
* Correction required.
* Cancelled where legally permitted.

Store:

* Original structured payload.
* Final payload.
* Payload hash.
* Provider request.
* Provider response.
* Message IDs.
* Submission time.
* Delivery time.
* Status history.
* Validation errors.
* Retry history.
* Credit-note reference.
* Original-invoice reference.

Do not allow users to manually change successful provider statuses.

## Current Implementation Phases

Create configuration to determine whether the company is:

* Voluntarily participating.
* Included in a pilot.
* Required from January 1, 2027 because its annual revenue meets the applicable threshold.
* Required from July 1, 2027 under the lower-revenue implementation phase.
* Excluded from a particular transaction category.
* Pending provider appointment.

These dates and thresholds must remain configurable because official requirements may be amended.

## Scope Handling

Prepare B2B and B2G invoices for e-invoicing when applicable.

Keep standard invoice processing for B2C and excluded transactions unless current official rules require otherwise.

Before enabling production submission, require:

* Accredited provider credentials.
* Successful sandbox testing.
* Company approval.
* Accountant approval.
* Mapping validation.
* Legal review.
* Backup and rollback plan.

---

# 18. CREDIT NOTES, DEBIT NOTES AND REFUNDS

Support both customer-side and vendor-side adjustments.

## Customer Credit Note

Reasons may include:

* Full cancellation.
* Partial cancellation.
* Price reduction.
* Service reduction.
* Refund.
* Incorrect quantity.
* Incorrect rate.
* Administrative error.
* Numerical error.
* Tax correction.
* Other authorised reason.

Require:

* Original-invoice reference.
* Reason.
* Affected lines.
* VAT impact.
* Approval.
* Accounting reversal.
* E-invoice submission where applicable.

## Customer Debit Note

Use where additional amounts become payable by the customer, subject to accountant and legal configuration.

## Vendor Credit Note

Reduce the amount payable to the vendor.

## Vendor Debit Note

Record an amount recoverable from the vendor, including:

* Overbilling.
* Damages.
* Penalties.
* Fuel recovery.
* Advance recovery.
* Short service.
* Rate correction.
* Other contractual recovery.

Each document must create correct ledger entries and appear in party statements.

---

# 19. USER, ROLE AND PERMISSION MANAGEMENT

Create granular role-based permissions.

Default roles:

* Super Administrator.
* Company Owner.
* Finance Manager.
* Accountant.
* Accounts Receivable User.
* Accounts Payable User.
* Cashier.
* Transport Manager.
* Dispatcher.
* Operations Staff.
* Fleet Manager.
* Branch Manager.
* Auditor.
* Read-only Management User.

Permissions must be action-specific:

* View.
* Create.
* Edit draft.
* Submit for approval.
* Approve.
* Reject.
* Post.
* Reverse.
* Print.
* Email.
* Export.
* Delete draft.
* View cost.
* View profit.
* View all branches.
* View assigned branch.
* View assigned parties.
* Manage settings.
* Manage users.
* Manage tax settings.
* Reopen periods.
* Process contra settlement.
* Override rates.
* Override credit limit.
* Invoice without POD.
* Submit e-invoice.
* Retry failed e-invoice.
* View audit logs.

Support restrictions by:

* Branch.
* Department.
* Cost centre.
* Document type.
* Party.
* Assigned user.
* Transaction amount.
* Approval level.

## Maker-Checker Workflow

The user who creates a transaction must not approve it when maker-checker control is enabled.

Support configurable approvals such as:

* Expenses over AED X.
* Payments over AED X.
* Rate overrides.
* Credit-limit overrides.
* Manual journals.
* Credit notes.
* Debit notes.
* Invoice cancellation.
* Period reopening.
* Contra settlement.
* Customer refunds.
* Vendor advances.

---

# 20. DOCUMENT NUMBERING

Provide configurable numbering for:

* Quotations.
* Jobs.
* Trips.
* Contracts.
* Customer invoices.
* Credit notes.
* Debit notes.
* Vendor bills.
* Receipts.
* Payments.
* Expenses.
* Journal vouchers.
* Contra vouchers.
* Purchase orders.
* Maintenance orders.

Allow patterns such as:

`{BRANCH}-{TYPE}-{YEAR}-{MONTH}-{SEQUENCE}`

Requirements:

* Unique numbers.
* Branch-specific sequences.
* Fiscal-year reset option.
* No duplicate numbers.
* No silent reuse of cancelled numbers.
* Gap reporting.
* Manual number override only with permission.
* Full audit history.

---

# 21. PROFESSIONAL PDF DOCUMENTS

Generate professional branded PDFs for:

* Quotation.
* Tax invoice.
* Commercial invoice.
* Proforma invoice.
* Credit note.
* Debit note.
* Receipt voucher.
* Payment voucher.
* Expense voucher.
* Journal voucher.
* Customer statement.
* Vendor statement.
* Combined party statement.
* Contract.
* Purchase order.
* Job sheet.
* Trip sheet.
* Proof-of-delivery summary.
* Vehicle maintenance order.
* Financial reports.

PDF settings:

* Company logo.
* Company name.
* Legal name.
* Address.
* TRN.
* Trade-licence details.
* Telephone.
* Email.
* Website.
* Bank details.
* Footer.
* Terms and conditions.
* Authorised signature.
* Company stamp area.
* English and Arabic support.
* RTL layout.
* A4 format.
* Correct page breaks.
* Repeated table headers.
* Page numbers.
* “Original,” “Copy,” and “Duplicate” markers where configured.

Do not copy another country’s mandatory QR-code rules.

An internal verification QR code may be optional, but it must not be presented as an official UAE tax requirement unless current UAE rules specifically require it.

---

# 22. DASHBOARD

Create role-specific dashboards.

## Owner Dashboard

Display:

* Current cash and bank balance.
* Total receivables.
* Total payables.
* Net working position.
* Revenue.
* Expenses.
* Gross profit.
* Net profit.
* Outstanding customer invoices.
* Outstanding vendor bills.
* Overdue amounts.
* Monthly revenue trend.
* Monthly profit trend.
* Top customers.
* Top vendors.
* Top routes.
* Most profitable vehicles.
* Least profitable vehicles.
* Jobs pending invoice.
* Vendor bills pending approval.
* Missing POD.
* Expiring contracts.
* Expiring vehicle documents.
* VAT liability estimate.
* E-invoice failures.

## Accountant Dashboard

Display:

* Unposted documents.
* Unapproved expenses.
* Unallocated receipts.
* Unallocated payments.
* Bank reconciliation pending.
* Missing vendor invoices.
* VAT exceptions.
* Duplicate vendor-bill warnings.
* Out-of-balance prevention alerts.
* Locked-period warnings.
* Failed e-invoices.
* Customer aging.
* Vendor aging.

## Transport Dashboard

Display:

* Today’s jobs.
* Vehicles available.
* Vehicles busy.
* Vehicles under maintenance.
* Trips in transit.
* Deliveries pending.
* POD pending.
* Jobs ready to invoice.
* Driver advances pending settlement.
* Route performance.

---

# 23. REPORTING MODULE

## Core Accounting Reports

Create:

* Trial balance.
* Profit and loss statement.
* Balance sheet.
* Cash-flow statement.
* General ledger.
* Journal report.
* Account statement.
* Chart-of-accounts report.
* Cashbook.
* Bankbook.
* Petty-cash report.
* Bank reconciliation.
* Receivable summary.
* Payable summary.
* Customer aging.
* Vendor aging.
* Revenue report.
* Expense report.
* Cost-of-revenue report.
* Branch profit and loss.
* Department profit and loss.
* Cost-centre report.
* Monthly comparison.
* Budget-versus-actual report.
* Foreign-currency gain/loss report.

## Customer Reports

Create:

* Customer statement.
* Outstanding invoices.
* Overdue invoices.
* Customer aging.
* Customer advances.
* Unallocated receipts.
* Customer credit notes.
* Customer debit notes.
* Customer profitability.
* Customer revenue by period.
* Credit-limit utilisation.
* Customer payment history.

## Vendor Reports

Create:

* Vendor statement.
* Outstanding vendor bills.
* Vendor aging.
* Vendor advances.
* Unallocated payments.
* Vendor credit notes.
* Vendor debit notes.
* Vendor cost by job.
* Vendor performance.
* Vendor payment history.

## Transport Reports

Create:

* Job-profitability report.
* Trip-profitability report.
* Route-profitability report.
* Vehicle-profitability report.
* Driver-performance report.
* Vendor-by-route report.
* Customer-by-route report.
* Revenue per vehicle.
* Cost per vehicle.
* Revenue per kilometre.
* Cost per kilometre.
* Fuel-consumption report.
* Maintenance-cost report.
* Vehicle downtime.
* Own-vehicle versus hired-vehicle comparison.
* Jobs pending invoicing.
* Jobs without POD.
* Jobs with missing vendor bills.
* Unbilled revenue.
* Accrued vendor cost.
* Estimated-versus-actual job profit.
* Contract-rate variance.
* Rate-override report.
* Cancelled-job report.
* Delivery-delay report.

Every report must support:

* Date filter.
* Branch filter.
* Party filter.
* Account filter.
* Job filter.
* Vehicle filter.
* Driver filter.
* Vendor filter.
* Customer filter.
* Status filter.
* Currency filter.
* PDF export.
* Excel export.
* CSV export.
* Print.
* Drill-down to source transactions.

---

# 24. AI ACCOUNTING ASSISTANT

Create an optional AI assistant module using a provider-independent architecture.

Support cloud or locally hosted AI providers through configurable adapters.

Possible AI functions:

* Extract vendor-bill data from uploaded invoices.
* Suggest expense category.
* Suggest ledger account.
* Suggest VAT code.
* Identify duplicate bills.
* Identify unusual expenses.
* Identify unusual fuel consumption.
* Detect unexpected rate differences.
* Summarise customer statements.
* Summarise vendor statements.
* Explain financial reports in simple language.
* Forecast cash flow.
* Predict overdue customers.
* Draft payment reminders.
* Extract terms from contracts.
* Identify contract-expiry risks.
* Suggest missing supporting documents.
* Natural-language report search.
* Answer management questions using authorised system data.
* Identify jobs with low or negative margins.

## AI Safety Rules

AI must never automatically:

* Post a journal.
* Approve an invoice.
* Approve an expense.
* Change VAT treatment.
* Submit a VAT return.
* Send money.
* Submit an e-invoice to production.
* Delete accounting data.
* Reopen a locked period.
* Change a customer or vendor balance.

AI results must be labelled as suggestions.

Every AI suggestion must show:

* Suggested value.
* Confidence.
* Explanation.
* Source document.
* User who accepted or rejected it.
* Acceptance timestamp.

Do not send confidential accounting data to an external AI provider unless the administrator has explicitly enabled the provider and accepted the privacy configuration.

Apply role and branch permissions to all AI responses.

---

# 25. SEARCH, IMPORT AND EXPORT

Create global search for:

* Party name.
* Phone.
* Email.
* TRN.
* Invoice number.
* Vendor invoice number.
* Receipt number.
* Payment number.
* Job number.
* Trip number.
* Vehicle plate number.
* Driver.
* Contract number.
* Amount.
* Bank reference.
* Cheque number.

Support bulk imports for:

* Chart of accounts.
* Customers.
* Vendors.
* Combined parties.
* Vehicles.
* Drivers.
* Opening balances.
* Customer invoices.
* Vendor bills.
* Bank statements.
* Contracts.
* Rate cards.

Import workflow must include:

* Downloadable template.
* Column mapping.
* Preview.
* Validation.
* Error report.
* Duplicate detection.
* Import rollback.
* Import audit log.

---

# 26. NOTIFICATIONS AND REMINDERS

Support email and in-application notifications for:

* Invoice due soon.
* Invoice overdue.
* Customer credit limit exceeded.
* Vendor bill due.
* Payment pending approval.
* Receipt pending allocation.
* Contract expiring.
* Vehicle registration expiring.
* Insurance expiring.
* Driver licence expiring.
* POD missing.
* Job ready to invoice.
* Driver advance pending settlement.
* Bank reconciliation pending.
* VAT period closing.
* E-invoice validation failure.
* E-invoice rejection.
* Failed scheduled job.
* Backup failure.

Allow notification templates and configurable reminder schedules.

---

# 27. AUDIT TRAIL

Maintain an immutable audit trail for:

* Login.
* Failed login.
* Record creation.
* Record update.
* Draft deletion.
* Approval.
* Rejection.
* Posting.
* Reversal.
* Printing.
* Email sending.
* Export.
* Permission changes.
* Company-setting changes.
* VAT-setting changes.
* Rate overrides.
* Credit-limit overrides.
* Period locks.
* Period reopening.
* E-invoice submissions.
* E-invoice responses.
* AI suggestions and decisions.

Audit records must include:

* User.
* Date and time.
* IP address.
* User agent.
* Action.
* Module.
* Record.
* Old values.
* New values.
* Reason.
* Approval reference.

Audit logs must not be editable from the normal application.

---

# 28. SECURITY REQUIREMENTS

Implement:

* Secure authentication.
* Optional two-factor authentication.
* Password hashing using Laravel defaults.
* Password reset.
* Session timeout.
* Login throttling.
* Role-based access control.
* Policy enforcement.
* CSRF protection.
* XSS protection.
* SQL-injection prevention.
* File-upload validation.
* MIME-type validation.
* File-size limits.
* Private document storage.
* Signed temporary document URLs.
* Encryption of sensitive credentials.
* Secure cookies.
* HTTPS enforcement in production.
* Content Security Policy where practical.
* Security headers.
* Rate limiting.
* API token scopes.
* Webhook-signature verification.
* Database backup.
* Application backup.
* Restore procedure.
* Error logging without exposing confidential information.
* Environment separation for development, testing, staging, and production.

Do not store API credentials, passwords, or encryption keys in source code.

Do not expose detailed stack traces in production.

---

# 29. DATABASE DESIGN

Create proper migrations and relationships for at least:

* Companies.
* Branches.
* Departments.
* Cost centres.
* Users.
* Roles.
* Permissions.
* Approval rules.
* Parties.
* Party roles.
* Party addresses.
* Party contacts.
* Party bank accounts.
* Accounts.
* Fiscal years.
* Accounting periods.
* Journal entries.
* Journal lines.
* Tax codes.
* Tax periods.
* Currencies.
* Exchange rates.
* Service types.
* Routes.
* Vehicles.
* Vehicle documents.
* Vehicle maintenance.
* Fuel entries.
* Drivers.
* Driver documents.
* Driver advances.
* Driver settlements.
* Quotations.
* Quotation items.
* Contracts.
* Contract versions.
* Rate cards.
* Jobs.
* Trips.
* Job charges.
* Job costs.
* Proofs of delivery.
* Customer invoices.
* Customer invoice items.
* Customer credit notes.
* Customer debit notes.
* Vendor bills.
* Vendor bill items.
* Vendor credit notes.
* Vendor debit notes.
* Receipts.
* Receipt allocations.
* Payments.
* Payment allocations.
* Expenses.
* Contra settlements.
* Bank accounts.
* Bank transactions.
* Bank reconciliations.
* Cheques.
* Attachments.
* Comments.
* Notifications.
* Recurring transactions.
* E-invoice configurations.
* E-invoice documents.
* E-invoice status histories.
* Provider webhooks.
* AI configurations.
* AI suggestions.
* Imports.
* Exports.
* Audit logs.

Use foreign keys, unique constraints, indexes, and data-integrity rules.

Do not use one oversized transaction table for every business document.

---

# 30. ACCOUNTING POSTING SERVICES

Create dedicated posting services, for example:

* InvoicePostingService.
* CreditNotePostingService.
* DebitNotePostingService.
* ReceiptPostingService.
* VendorBillPostingService.
* PaymentPostingService.
* ExpensePostingService.
* AdvancePostingService.
* ContraSettlementPostingService.
* BankTransferPostingService.
* JournalPostingService.
* ReversalService.
* PeriodClosingService.
* ExchangeAdjustmentService.

Every posting service must:

1. Validate document status.
2. Validate permissions.
3. Validate approval.
4. Validate accounting period.
5. Validate totals.
6. Validate tax.
7. Use a database transaction.
8. Lock relevant records where necessary.
9. Generate a balanced journal.
10. Link journal lines to the source document.
11. Update party balances through ledger transactions, not manually stored unreliable totals.
12. Commit only if every operation succeeds.
13. Roll back on failure.
14. Write an audit log.
15. Dispatch post-commit events.

---

# 31. TESTING REQUIREMENTS

Create automated tests for:

* User authentication.
* Permission restrictions.
* Branch restrictions.
* Invoice calculations.
* VAT-inclusive calculation.
* VAT-exclusive calculation.
* Rounding.
* Receipt allocation.
* Partial payment.
* Overpayment.
* Vendor-bill posting.
* Vendor payment.
* Credit note.
* Debit note.
* Customer refund.
* Vendor refund.
* Customer advance.
* Vendor advance.
* Driver advance.
* Contra settlement.
* Bank transfer.
* Bank reconciliation.
* Journal balancing.
* Period locking.
* Reversal.
* Duplicate invoice prevention.
* Duplicate vendor-bill prevention.
* E-invoice payload validation.
* E-invoice retries.
* Audit logging.
* File permission.
* AI permission enforcement.

## Mandatory Accounting Test Scenario

Create an automated test using the same party as both customer and vendor:

1. Issue a customer invoice for AED 10,000 plus 5% VAT.
2. Receive AED 4,000.
3. Record a vendor bill from the same party for AED 3,000 plus VAT.
4. Pay AED 1,000 to the vendor.
5. Perform an authorised contra settlement for an allowed amount.
6. Confirm accounts receivable remains separate from accounts payable.
7. Confirm customer and vendor statements are correct.
8. Confirm the combined party statement is correct.
9. Confirm all journals balance.
10. Confirm VAT reports are correct.
11. Confirm no transaction is silently netted.

Do not mark the application production-ready while tests are failing.

---

# 32. USER INTERFACE REQUIREMENTS

Create a modern, clean, professional accounting interface.

Requirements:

* Responsive desktop, tablet, and mobile layouts.
* Fast loading.
* Clear sidebar.
* Global search.
* Dashboard cards.
* Filterable tables.
* Saved filters.
* Column selection.
* Pagination.
* Sorting.
* Bulk actions with permission.
* Status badges.
* Approval timeline.
* Document preview.
* Attachment preview.
* Accessible forms.
* Inline validation.
* Confirmation for risky actions.
* Keyboard-friendly data entry.
* Consistent date and money formatting.
* English and Arabic readiness.
* RTL support.
* Dark mode optional.
* No unnecessary animation.
* No fake statistics.
* No nonfunctional buttons.

For financial documents, clearly separate:

* Draft actions.
* Approval actions.
* Posting actions.
* Payment actions.
* Printing actions.
* E-invoice actions.
* Audit history.

---

# 33. CUSTOMER AND VENDOR PORTAL

Create an optional secure portal.

Customers should be able to:

* View invoices.
* Download invoices.
* View statements.
* View receipts.
* View jobs.
* View POD.
* View contracts.
* Upload purchase orders.
* Raise invoice queries.
* Confirm quotation acceptance.

Vendors should be able to:

* View assigned jobs.
* Upload vendor invoices.
* Upload POD.
* View payment status.
* View vendor statements.
* Update required documents.
* Receive contract-expiry alerts.

Portal users must only see their own organisation’s information.

---

# 34. API AND FUTURE INTEGRATIONS

Create a documented REST API for authorised integrations.

Prepare adapters for:

* UAE e-invoicing service providers.
* Payment gateways.
* Banks.
* GPS or fleet tracking.
* Fuel-card providers.
* Email.
* SMS.
* WhatsApp providers.
* Document-signing providers.
* External CRM.
* External ERP.
* Mobile application.
* OCR provider.
* AI provider.

All APIs must have:

* Authentication.
* Permission scopes.
* Validation.
* Rate limiting.
* Idempotency for financial creation requests.
* Request logs.
* Error handling.
* Webhook verification.
* Versioning.

---

# 35. INSTALLATION AND DEPLOYMENT

Provide:

* Complete source code.
* Composer configuration.
* Package lock files.
* Database migrations.
* Seeders.
* Default chart of accounts.
* Default UAE VAT tax codes.
* Default roles and permissions.
* Sample company configuration.
* `.env.example`.
* Installation guide.
* Upgrade guide.
* Backup guide.
* Restore guide.
* cPanel deployment guide.
* VPS deployment guide.
* Apache configuration.
* Nginx configuration.
* Queue-worker configuration.
* Supervisor configuration.
* Cron configuration.
* Storage-link instructions.
* File-permission instructions.
* SSL requirements.
* Production optimisation commands.
* Health-check endpoint.
* Application-version display.
* Database migration backup process.

Provide a setup wizard that collects:

* Company details.
* Logo.
* Legal name.
* TRN.
* Address.
* Default currency.
* Financial-year start.
* VAT registration status.
* Default tax rate.
* Branches.
* Bank accounts.
* Invoice numbering.
* Email settings.
* First administrator.

---

# 36. BACKUP AND DISASTER RECOVERY

Provide:

* Automated database backup.
* Automated attachment backup.
* Backup encryption.
* Local backup option.
* Remote-storage option.
* Backup retention settings.
* Backup success notification.
* Backup failure notification.
* Restore testing procedure.
* Pre-upgrade backup.
* Audit log for backup and restore actions.

Financial data must never depend on only one server copy.

---

# 37. DEVELOPMENT EXECUTION PROCESS

Follow this order:

## Phase 1: Discovery and Architecture

First provide:

* Assumptions.
* Business workflow.
* Module list.
* Permission matrix.
* Accounting flow.
* Database ERD.
* Posting matrix.
* UAE VAT design.
* E-invoicing adapter design.
* Development milestones.
* Risk list.

Do not begin random page generation without completing the architecture.

## Phase 2: Foundation

Implement:

* Authentication.
* Company settings.
* Branches.
* Users.
* Permissions.
* Audit logging.
* Chart of accounts.
* Fiscal periods.
* Tax codes.
* Party management.

## Phase 3: Accounting Core

Implement:

* Journals.
* Posting services.
* Invoices.
* Vendor bills.
* Receipts.
* Payments.
* Expenses.
* Credit notes.
* Debit notes.
* Advances.
* Contra settlements.

## Phase 4: Transport Operations

Implement:

* Service types.
* Routes.
* Jobs.
* Trips.
* Vehicles.
* Drivers.
* POD.
* Trip expenses.
* Job profitability.

## Phase 5: Contracts and Rate Cards

Implement:

* Customer contracts.
* Vendor contracts.
* Rate cards.
* Automatic rate selection.
* Contract alerts.

## Phase 6: Banking and VAT

Implement:

* Bank accounts.
* Cheques.
* Reconciliation.
* VAT reports.
* VAT period closing.
* VAT reconciliation.

## Phase 7: Reports and Documents

Implement:

* Financial reports.
* Transport reports.
* PDF templates.
* Excel and CSV exports.
* Dashboards.

## Phase 8: E-Invoicing

Implement:

* Provider interface.
* Sandbox integration.
* Payload validation.
* Status tracking.
* Webhooks.
* Retry handling.
* Audit logs.

Do not activate production e-invoice submission without valid provider credentials.

## Phase 9: AI Assistance

Implement optional AI features with human-review controls.

## Phase 10: Testing and Production Readiness

Complete:

* Automated tests.
* Security review.
* Performance testing.
* Permission testing.
* Accounting reconciliation.
* VAT verification.
* Backup and restore testing.
* Installation documentation.
* User manual.

---

# 38. REQUIRED FINAL DELIVERABLES

Deliver:

1. Complete Laravel/PHP source code.
2. Clean database schema.
3. Migrations and seeders.
4. Default chart of accounts.
5. Default permission matrix.
6. Default UAE VAT setup.
7. Accounting posting matrix.
8. API documentation.
9. E-invoicing adapter documentation.
10. Installation guide.
11. cPanel deployment guide.
12. VPS deployment guide.
13. Administrator manual.
14. Accountant manual.
15. Transport-operations manual.
16. Backup and restore guide.
17. Automated tests.
18. Security checklist.
19. Production-readiness checklist.
20. Sample data that can be removed before production.

---

# 39. NON-NEGOTIABLE RULES

* Do not create a fake accounting system that only changes displayed balances.
* Do not directly edit balances.
* Derive balances from posted ledger transactions.
* Do not allow unbalanced journals.
* Do not delete posted transactions.
* Do not silently net receivable and payable balances.
* Do not hardcode every transport service as 5% VAT.
* Do not claim government integration without real accredited-provider connectivity.
* Do not copy Saudi e-invoicing rules into the UAE system.
* Do not store credentials in source code.
* Do not bypass user permissions through APIs.
* Do not let AI post or approve financial transactions.
* Do not use floating-point values for money.
* Do not leave buttons, filters, exports, or reports nonfunctional.
* Do not use placeholder calculations.
* Do not mark modules complete without tests.
* Do not rewrite working modules unnecessarily.
* Do not break historical financial records during upgrades.
* Do not expose another branch’s data to unauthorised staff.
* Do not expose vendor costs or profit to operations staff without permission.
* Do not overwrite invoice PDFs after a posted invoice has been officially issued; preserve document versions and hashes.

The completed application must be suitable for real daily operations of a UAE transport company and must be maintainable, auditable, secure, scalable, and ready for professional deployment.
