Docs
Order Form

Order Form

The platform admin order form feature allows operators to create, store, and export a formal sales order form for each organization's subscription.

Order Form

The platform admin order form feature allows operators to create, store, and export a formal sales order form for each organization's subscription.


Overview

  • Platform admins create/edit order forms in the platform console under each organization
  • Forms capture customer/provider details, plan info, fees, limits, and signatory data
  • Documents (signed contracts, receipts) can be attached
  • PDF generation exports the form as an A4 document (Arabic RTL, Bahij Nassim font)

API Endpoints

All endpoints require platform.admin middleware.

Get order form

GET /api/platform/organizations/{organizationId}/order-form

Returns { data: { order_form, documents, subscription_context, from_subscription } }. Creates a blank form payload if none exists.

Save order form

PUT /api/platform/organizations/{organizationId}/order-form
Content-Type: application/json

{
  "status": "draft",
  "customer_organization_name": "Acme Corp",
  "license_fee": 5000,
  "maintenance_fee": 1000,
  ...
}

Creates or updates the order form for the organization. All fields are optional (sometimes validation).

Download PDF

GET /api/platform/organizations/{organizationId}/order-form/pdf
POST /api/platform/organizations/{organizationId}/order-form/pdf

Streams a PDF download using the barryvdh/laravel-dompdf package.

Requirements:

  • composer require barryvdh/laravel-dompdf must be run (already in composer.json)
  • Optionally place Bahij Nassim-Regular.ttf and Bahij Nassim-Bold.ttf in public/fonts/ for proper Arabic rendering. If not present, falls back to DejaVu Sans.

Upload document

POST /api/platform/organizations/{organizationId}/order-form/documents
Content-Type: multipart/form-data

file=<file>
category=signed_order_form|contract|signed_contract|order_form_template|payment_receipt|supporting_document|identity_document|other
title=<optional>
notes=<optional>

Max 20 MB. Allowed types: pdf, jpg, jpeg, png, gif, webp, doc, docx, xls, xlsx.

Download document

GET /api/platform/organizations/{organizationId}/order-form/documents/{documentId}/download

Delete document

DELETE /api/platform/organizations/{organizationId}/order-form/documents/{documentId}

PDF Template

The Blade template at backend/resources/views/platform/organization-order-form-pdf.blade.php renders in Arabic/Pashto (RTL). Sections:

  1. Party details (customer + provider)
  2. Plan, fees, and discount
  3. Limits, timeline, and implementation
  4. Special requirements and terms
  5. Signatures
  6. Document attachments

Order Form Statuses

StatusMeaning
draftBeing prepared
pending_reviewSent for customer review
approvedCustomer approved
signedFully executed
cancelledCancelled

Database

Table: organization_order_forms Documents table: order_form_documents

Both tables have organization_id (FK → organizations) and soft-delete support.


Setup Notes

  1. After running composer install, dompdf is available automatically.
  2. For Arabic/Pashto fonts: download Bahij Nassim from GitHub and place in backend/public/fonts/.
  3. Without the font files, text renders in DejaVu Sans (Latin only — Arabic characters may not display correctly).