Export Specification¶
Detailed specification for exporting quotes and cost breakdowns from CostEngine (MfgIQ).
Overview¶
The export module generates customer-facing quotes and internal cost breakdowns in multiple formats. This document defines:
- Supported output formats
- Quote structure and content
- Excel breakdown specifications
- PDF layout and branding
- Email integration
Supported Export Formats¶
| Format | Use Case | Level of Detail | Customizable |
|---|---|---|---|
| Customer quote | Summary | Yes - Branding | |
| Excel | Internal review | Full breakdown | Yes - Templates |
| CSV | Data analysis | Raw data | No |
| JSON | API integration | Structured data | No |
| Direct send | PDF + Excel | Yes - Templates |
PDF Quote Specification¶
Layout Structure¶
┌─────────────────────────────────────────────────┐
│ [Company Logo] Quote #Q-XXXX │
│ Date: YYYY-MM-DD│
├─────────────────────────────────────────────────┤
│ CUSTOMER INFORMATION │
│ Customer Name │
│ Contact Person │
│ Address │
├─────────────────────────────────────────────────┤
│ PART INFORMATION │
│ Part Number | Drawing Number | Revision │
│ Material | Quantity | Lead Time │
├─────────────────────────────────────────────────┤
│ PRICING SCENARIOS │
│ ┌─────────────┬──────┬───────────┬─────────┐ │
│ │ Scenario │ Qty │ Price/Pc │ Total │ │
│ ├─────────────┼──────┼───────────┼─────────┤ │
│ │ Base (25%) │ 1000 │ ₹661.50 │ ₹661,500│ │
│ │ Aggressive │ 1000 │ ₹608.00 │ ₹608,000│ │
│ │ Safe (35%) │ 1000 │ ₹714.50 │ ₹714,500│ │
│ └─────────────┴──────┴───────────┴─────────┘ │
├─────────────────────────────────────────────────┤
│ TERMS & CONDITIONS │
│ • Payment Terms: Net 30 │
│ • Delivery: 6-8 weeks ARO │
│ • Validity: 30 days from quote date │
│ • Tooling: Included │
├─────────────────────────────────────────────────┤
│ TECHNICAL SPECIFICATIONS │
│ • Material: SAE4140 Steel │
│ • Processes: Cut, Turn, Thread, HT, Coat │
│ • Quality: As per drawing specs │
├─────────────────────────────────────────────────┤
│ FOOTER │
│ Company Name | Contact Info | www.company.com │
└─────────────────────────────────────────────────┘
Content Specifications¶
Header Section¶
| Field | Source | Format | Required |
|---|---|---|---|
| Company Logo | Settings | Image (PNG/JPEG) | Yes |
| Quote Number | Auto-generated | Q-YYYY-NNNN | Yes |
| Quote Date | System date | YYYY-MM-DD | Yes |
| Valid Until | Date + 30 days | YYYY-MM-DD | Yes |
| Quote Version | Version tracker | v1.0, v1.1, etc. | Yes |
Customer Information¶
| Field | Source | Format | Required |
|---|---|---|---|
| Customer Name | Excel import | Text, max 100 chars | Yes |
| Contact Person | Excel import | Text, max 100 chars | No |
| Excel import | Valid email | No | |
| Phone | Excel import | Text, max 20 chars | No |
| Address | Customer Master | Multi-line text | No |
Part Information¶
| Field | Source | Format | Required |
|---|---|---|---|
| Part Number | Excel import | Text, max 50 chars | Yes |
| Drawing Number | Excel import | Text, max 50 chars | Yes |
| Revision | Excel import | Text, max 10 chars | No |
| Material Grade | Excel import | Text | Yes |
| Order Quantity | Excel import | Integer | Yes |
| Lead Time | Settings | Text (e.g., "6-8 weeks") | Yes |
Pricing Scenarios¶
Standard 3-Scenario Model:
| Scenario | Margin % | Description | Calculation |
|---|---|---|---|
| Base | 25% | Standard margin | Cost × 1.25 |
| Aggressive | 15% | Competitive pricing | Cost × 1.15 |
| Safe | 35% | Premium margin | Cost × 1.35 |
Configurable Options: - Custom margin percentages (per customer or quote) - Single scenario mode (for rush quotes) - Quantity break pricing (different margins for different quantities)
Terms & Conditions¶
| Field | Source | Default Value | Customizable |
|---|---|---|---|
| Payment Terms | Settings | "Net 30" | Yes |
| Delivery | Settings | "6-8 weeks ARO" | Yes |
| Quote Validity | Settings | "30 days" | Yes |
| Tooling | Settings | "Included in price" | Yes |
| Warranty | Settings | "As per standard terms" | Yes |
PDF Styling¶
Typography: - Headings: Roboto Bold, 14pt, Color: #2C3E50 - Body Text: Roboto Regular, 10pt, Color: #34495E - Table Headers: Roboto Medium, 9pt, Color: #FFFFFF, Background: #3498DB - Numbers: Roboto Mono, 10pt (for price alignment)
Colors: - Primary: #3498DB (Blue) - Secondary: #2C3E50 (Dark Gray) - Accent: #E74C3C (Red, for warnings) - Success: #27AE60 (Green) - Background: #FFFFFF (White)
Page Layout: - Size: A4 (210mm × 297mm) - Margins: 20mm on all sides - Orientation: Portrait - Header: 40mm - Footer: 20mm
Excel Breakdown Specification¶
Multi-Sheet Structure¶
Sheet 1: Quote Summary¶
Mirrors the PDF format with clickable links to detailed sheets.
Columns: - A: Description - B: Value - C: Notes
Key Rows: - Quote metadata (number, date, customer) - Part information - Pricing scenarios table - Terms and conditions
Sheet 2: Detailed Cost Breakdown¶
Complete cost buildup with explainability.
Columns:
| Col | Field | Data Type | Format | Notes |
|---|---|---|---|---|
| A | Cost Component | Text | - | Hierarchical structure |
| B | Quantity | Decimal | #,##0.00 | Input quantity |
| C | Unit Rate | Currency | ₹#,##0.00 | Rate per unit |
| D | Amount | Currency | ₹#,##0.00 | Calculated cost |
| E | % of Total | Percentage | 0.0% | Contribution |
| F | Source | Text | - | Data origin |
| G | Assumptions | Text | - | Key assumptions |
| H | Override | Yes/No | - | Manual override flag |
Row Structure:
Row 1: Headers
Row 2: [BLANK]
Row 3: Material Cost
Row 4: └─ Raw Material | 2.304 | ₹99.5 | ₹229.25 | 43.3% | Material Master | Current rate | No
Row 5: └─ Scrap Adjustment | - | 5.0% | ₹11.46 | 2.2% | Excel | 5% scrap | No
Row 6: └─ Total Material | - | - | ₹240.71 | 45.5% | - | - | -
Row 7: [BLANK]
Row 8: Operations Cost
Row 9: └─ Op 1: Cutting | 1.0 | ₹14.47 | ₹14.47 | 2.7% | Excel | 0.12h cycle | No
Row 10: └─ Op 2: Turning | 1.0 | ₹72.05 | ₹72.05 | 13.6% | Excel | 0.60h cycle | No
...
Sheet 3: Material Details¶
Columns: - Material Grade - Gross Weight (kg) - Net Weight (kg) - Yield % - RM Rate (₹/kg) - RM Rate Source - RM Rate Date - Material Cost - Scrap % - Scrap Cost
Sheet 4: Routing Details¶
Columns: - Operation No - Operation Name - Machine Type - Setup Time (hrs) - Cycle Time (hrs) - Machine Rate (₹/hr) - Setup Cost/Piece - Cycle Cost/Piece - Tool Cost/Piece - Total Op Cost - Scrap % - Notes
Sheet 5: Overheads¶
Columns: - Overhead Category - Basis (e.g., % of Material, % of Operations) - Rate/Percentage - Amount - Notes
Sheet 6: Assumptions & Notes¶
Free-form notes including: - Manual overrides with justifications - Critical assumptions - Customer-specific notes - Quote history (if revised)
Excel Formatting¶
Cell Styles: - Headers: Bold, Blue background (#3498DB), White text, Border - Subtotals: Bold, Light gray background (#ECF0F1), Border - Total: Bold, Dark gray background (#BDC3C7), Border - Overrides: Yellow background (#FFF3CD), Red text (#E74C3C) - Warnings: Orange background (#FFE5CC)
Conditional Formatting: - Green cells for costs below industry benchmark - Red cells for costs above threshold - Yellow cells for manual overrides
Protection: - Lock formula cells (to prevent accidental edits) - Allow editing of override cells only - Password protect structure (optional)
CSV Export Specification¶
Flat Structure¶
Single CSV file with all cost data in tabular format.
Columns:
quote_number,quote_date,customer,part_number,material,quantity,cost_category,cost_subcategory,description,qty,rate,amount,source,override_flag,notes
Q-2026-0042,2026-01-24,ABC Mfg,RH-2024-05,SAE4140,1000,Material,Raw Material,SAE4140 Steel,2.304,99.5,229.25,Material Master,No,Current rate
Q-2026-0042,2026-01-24,ABC Mfg,RH-2024-05,SAE4140,1000,Operations,Cutting,Cutting operation,1.0,14.47,14.47,Excel,No,0.12h cycle
...
Use Cases: - Data warehouse import - Business intelligence tools - Custom reporting
JSON Export Specification¶
Structured Format¶
{
"quote": {
"quote_number": "Q-2026-0042",
"quote_date": "2026-01-24",
"version": "v1.0",
"valid_until": "2026-02-24",
"status": "draft",
"customer": {
"name": "ABC Manufacturing",
"contact": "John Doe",
"email": "john@abc.com"
},
"part": {
"part_number": "RH-2024-05",
"drawing_number": "RH-2024-05-R1",
"revision": "R1",
"material": "SAE4140",
"quantity": 1000,
"lead_time": "6-8 weeks"
},
"cost_breakdown": {
"material": {
"total": 240.71,
"details": {
"raw_material": 229.25,
"scrap_adjustment": 11.46
},
"assumptions": {
"rm_rate": 99.5,
"rm_rate_source": "Material Master",
"yield_percent": 86.8,
"scrap_percent": 5.0
}
},
"operations": {
"total": 238.45,
"details": [
{
"operation_no": 1,
"name": "Cutting",
"machine_type": "Band Saw",
"setup_time": 0.30,
"cycle_time": 0.12,
"machine_rate": 120.00,
"total_cost": 14.47
}
]
},
"overheads": {
"total": 50.00,
"details": {
"factory_overhead": 30.00,
"admin_overhead": 20.00
}
},
"grand_total": 529.16
},
"pricing_scenarios": [
{
"scenario": "Base",
"margin_percent": 25,
"price_per_piece": 661.50,
"total_value": 661500.00
},
{
"scenario": "Aggressive",
"margin_percent": 15,
"price_per_piece": 608.00,
"total_value": 608000.00
},
{
"scenario": "Safe",
"margin_percent": 35,
"price_per_piece": 714.50,
"total_value": 714500.00
}
],
"terms": {
"payment_terms": "Net 30",
"delivery": "6-8 weeks ARO",
"tooling": "Included",
"validity_days": 30
},
"metadata": {
"created_by": "estimator@company.com",
"created_at": "2026-01-24T10:30:00Z",
"modified_at": "2026-01-24T10:30:00Z",
"source_file": "costing_template.xlsx"
}
}
}
Email Integration¶
Email Template¶
Subject Line Template:
Quote #{quote_number} for {part_number} - {customer_name}
Email Body Template:
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; color: #333; }
.header { background-color: #3498DB; color: white; padding: 20px; }
.content { padding: 20px; }
.footer { background-color: #ECF0F1; padding: 15px; font-size: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
th { background-color: #3498DB; color: white; }
</style>
</head>
<body>
<div class="header">
<h2>Quote for {part_number}</h2>
</div>
<div class="content">
<p>Dear {customer_contact},</p>
<p>Thank you for your inquiry. Please find attached our quote for the following:</p>
<table>
<tr><th>Part Number</th><td>{part_number}</td></tr>
<tr><th>Drawing Number</th><td>{drawing_number}</td></tr>
<tr><th>Material</th><td>{material}</td></tr>
<tr><th>Quantity</th><td>{quantity}</td></tr>
</table>
<h3>Pricing Summary</h3>
<table>
<tr>
<th>Scenario</th>
<th>Price per Piece</th>
<th>Total Value</th>
</tr>
<tr>
<td>Base (25% margin)</td>
<td>₹{base_price}</td>
<td>₹{base_total}</td>
</tr>
<tr>
<td>Aggressive (15% margin)</td>
<td>₹{aggressive_price}</td>
<td>₹{aggressive_total}</td>
</tr>
<tr>
<td>Safe (35% margin)</td>
<td>₹{safe_price}</td>
<td>₹{safe_total}</td>
</tr>
</table>
<p><strong>Quote Validity:</strong> {validity_date}</p>
<p><strong>Delivery:</strong> {delivery_time}</p>
<p><strong>Payment Terms:</strong> {payment_terms}</p>
<p>Please find attached:</p>
<ul>
<li>PDF Quote - Customer-facing document</li>
<li>Excel Breakdown - Detailed cost analysis</li>
</ul>
<p>Should you have any questions or require clarifications, please feel free to reach out.</p>
<p>Best regards,<br>
{estimator_name}<br>
{company_name}</p>
</div>
<div class="footer">
<p>{company_name} | {company_address} | {company_phone} | {company_email}</p>
<p>This quote is valid for {validity_days} days from the date of issue.</p>
</div>
</body>
</html>
Attachment Rules¶
- Always Attach:
-
PDF Quote (customer-facing)
-
Conditionally Attach:
- Excel Breakdown (if customer requests detailed breakdown)
-
Technical drawings (if available and customer requests)
-
Never Attach:
- Internal notes
- Override justifications
- Profit margin calculations
Export API¶
REST Endpoint¶
POST /api/v1/quotes/{quote_id}/export
Request:
{
"format": "pdf",
"options": {
"include_logo": true,
"branding_template": "default",
"show_detailed_breakdown": false,
"scenarios": ["base", "aggressive", "safe"]
}
}
Response:
{
"status": "success",
"export_id": "exp_20260124_001",
"files": [
{
"format": "pdf",
"filename": "Quote_Q-2026-0042_v1.0.pdf",
"size_bytes": 245678,
"download_url": "https://api.costengine.com/downloads/exp_20260124_001/quote.pdf",
"expires_at": "2026-01-25T10:30:00Z"
}
],
"generated_at": "2026-01-24T10:30:00Z"
}
Customization Options¶
Branding Templates¶
Multiple branding templates supported:
- Default - Standard company branding
- Minimal - Clean, simple layout
- Detailed - Full technical specifications
- Custom - Per-customer branding
Template Configuration:
{
"template_id": "custom_abc_corp",
"customer_id": "ABC-001",
"logo": "path/to/abc_logo.png",
"primary_color": "#E74C3C",
"secondary_color": "#2C3E50",
"font_family": "Arial",
"show_detailed_specs": true,
"custom_footer": "Preferred Supplier to ABC Corp"
}
Performance Targets¶
| Export Format | Target Time | File Size Limit | Notes |
|---|---|---|---|
| < 3 sec | 2 MB | Standard quote | |
| Excel | < 2 sec | 5 MB | All sheets |
| CSV | < 1 sec | 10 MB | Data only |
| JSON | < 500 ms | 1 MB | API response |
| Email Send | < 5 sec | 10 MB total | Including attachments |
Related Documentation¶
- Costing Formats Index → - Overview of all costing formats
- Import Specification → - Excel import format specification
- Quote Output Use Cases → - Detailed export scenarios
- Modular Blocks → - Quote generation architecture