Skip to main content

Overview

The Quotation module streamlines the process of creating professional quotation documents, exporting them as PDFs, and tracking customer responses. It integrates with Google Drive for collaborative editing and S3 for final document storage.

Automatic Generation

Generate quotations from service request data

Google Docs Integration

Edit quotations collaboratively before finalizing

Professional PDFs

Export polished PDFs with company branding

Follow-up Automation

Automatic reminders 24 hours after sending

Quotation Workflow


Generating a Quotation

1

Navigate to Service Request

Open the service request that needs a quotation.
2

Click 'Generate Quotation'

This creates a new quotation entry.
3

Enter Pricing Information

  • Service price: Cost of the service
  • Transport price: Delivery or logistics cost (optional)
  • Extra data: Additional parameters for the template
4

Select Template

System automatically selects the appropriate template based on service type.
5

Generate Draft

A Google Doc is created with pre-filled information from the service request.
The draft is created as a DOCX template and uploaded to Google Drive for collaborative editing.

Editing in Google Drive

After generation, the quotation exists as a Google Doc:
Click the “Open in Google Docs” link in the quotation details. The document is automatically shared with the user who generated it.
Update pricing, add special conditions, adjust terms, or modify any content directly in Google Docs.
Share the document with colleagues for review before finalizing.
Changes made in Google Docs are NOT reflected in the database. Finalize the quotation to capture the latest version.

Finalizing the Quotation

Once the quotation is ready to send:
1

Click 'Finalize Quotation'

In the quotation detail view.
2

Choose PDF Source

  • HTML Template (recommended): Generate a professional PDF from the HTML template
  • Google Docs: Export the edited Google Doc as PDF
3

System Processing

  1. Exports the document to PDF
  2. Uploads PDF to S3 storage
  3. Updates quotation status to FINALIZED
  4. Sends email to customer with PDF attachment
  5. Schedules 24-hour follow-up reminder
4

Customer Receives

Customer gets an email with:
  • PDF quotation attachment
  • Download link
  • “Accept Quotation” link (if configured)
{
  "useHtmlPdf": true,
  "useProfessionalPdf": true
}

Quotation Metadata

Each quotation stores rich metadata:
Metadata structure
{
  "dataset": {
    "customerName": "Example Corp",
    "serviceType": "Fumigation",
    "deliveryDate": "2024-12-15",
    "items": [...]
  },
  "extraData": {
    "price_service": 1500,
    "price_transport": 200,
    "discount": 10
  },
  "professionalPdf": {
    "bucket": "ambiosys-docs",
    "key": "quotations/789/456-professional-20241120.pdf",
    "url": "https://...",
    "template": "quotation-v2",
    "generatedAt": "2024-11-20T14:30:00Z"
  },
  "finalPdf": {
    "source": "html",
    "bucket": "ambiosys-docs",
    "key": "quotations/789/456-20241120143500.pdf",
    "url": "https://...",
    "generatedAt": "2024-11-20T14:35:00Z"
  },
  "generatedAt": "2024-11-20T14:25:00Z"
}

Viewing and Downloading

Customer View

Customers receive a unique link to view their quotation online:
https://app.ambiosys.com/public/accept/{request_uuid}
This page displays:
  • Quotation details
  • PDF download button
  • Accept/Reject buttons
  • Comments section

Internal View

Staff can access quotations through:
View all quotations related to a service request in the “Quotations” tab.
Filter quotations by user, date range, or status.
Generate a temporary presigned URL valid for 15 minutes:
GET /api/quotations/:requestId/:quotationId/downloadUrl

Follow-up Management

Automatic Follow-up

After finalizing, the system schedules a follow-up job:
1

Initial Send

Quotation is emailed to customer.
2

24-Hour Wait

System waits 24 hours (configurable).
3

Follow-up Notification

If no response, vendor receives a reminder to contact the customer.

Manual Follow-up

Vendors can record follow-up interactions:
POST /api/quotations/followup
{
  "quotation_id": 456,
  "talked_with_lead": true,
  "interest_perception": "high",
  "payment_capacity": "confirmed",
  "decision_power": "yes",
  "agreement": "needs_revision",
  "contact_reminder_type": "interval",
  "contact_reminder_interval_value": 3,
  "contact_reminder_interval_unit": "days",
  "medium": "phone"
}
This creates a new reminder based on the specified interval and updates the quotation follow-up status.

Quotation Status Flow

Initial state after generation. Document exists in Google Drive but not finalized.
PDF exported, uploaded to S3, and sent to customer. Ready for follow-up.
Customer accepted the quotation. Ready to convert to service order.
Customer declined. Follow-up record should include reason.
Validity period passed without customer response.

Templates

Quotation templates are defined in the backend and include:
  • DOCX templates: For Google Docs generation (using docx-templates)
  • HTML templates: For professional PDF generation (using Puppeteer)
  • quotation-standard: General services
  • quotation-ptar: Wastewater treatment plants
  • quotation-fumigation: Fumigation services
  • quotation-lab-analysis: Laboratory analysis
Templates use placeholders that are filled from service request data and extra parameters.

API Reference

GET /api/quotations/:requestId
// Returns all quotations for the service request

Best Practices

Always review the quotation in Google Docs before finalizing. Once finalized, edits require creating a new version.
The HTML-to-PDF generation produces more consistent, professional results than Google Docs export.
Record all customer interactions in the follow-up system for accurate pipeline management.
If major changes are needed after finalizing, generate a new quotation version rather than editing the finalized one.

Service Requests

Create requests that require quotations

Dashboard

Track quotation metrics and conversion rates

Build docs developers (and LLMs) love