{% extends "base.html" %} {% block title %}Quote{% endblock %} {% block header %}Quotes{% endblock %} {% block content %} {% set today_date = today %} {% set status_name = q.status.name if q.status else "" %} {% set is_overdue = q.estimated_closure_date and q.estimated_closure_date < today_date and status_name not in ("Selected","Rejected") %} {% set proposal_done = q.proposal_created_at is not none %} {% set proposal_confirmed = q.proposal_confirmed_at is not none %} {# ---- Currency / Symbol ---- #} {% set currency_map = {} %} {% if currencies is defined %} {% for c in currencies %} {% set _ = currency_map.update({(c.code|upper): (c.symbol or c.code)}) %} {% endfor %} {% endif %} {% set cur_code = (q.currency or "INR")|upper %} {% set cur_symbol = currency_map.get(cur_code, cur_code) %} {# ---- GST Applicability (strict INR only) ---- #} {% set gst_enabled = (cur_code == "INR") and (q.is_gst_applicable) %} {% set is_intrastate = gst_enabled and (q.cgst and q.cgst > 0) %} {# ---- PI State ---- #} {% set pi_exists = (latest_pi is not none) %} {% set pi_pending = (q.pi_request_status == "Pending") %} {# ---- Invoice State ---- #} {% set inv_exists = (latest_invoice is not none) %} {% set inv_pending = (q.invoice_request_status == "Pending") %} {% macro money(v) -%} {{ indian_amount((v or 0) | float) }} {%- endmacro %} {% set can_edit_quote = ( (status_name in ("Draft", "Rejected", "Approved")) or (status_name == "Sent" and proposal_confirmed and not inv_exists) ) %}
Commercial Quote

{{ q.quote_code }}

Version {{ q.version }} {% if q.opportunity %} • Opportunity: {{ q.opportunity.opp_code }} • {{ q.opportunity.title }} {% endif %}
Currency: {{ cur_code }}{% if cur_symbol and cur_symbol != cur_code %} ({{ cur_symbol }}){% endif %} {% if gst_enabled %} GST: ON {% elif cur_code == "INR" %} GST: OFF {% else %} GST: N/A {% endif %} {% if status_name %} {{ status_name }} {% endif %} {% if is_overdue %} Overdue {% endif %}
Grand Total
{{ cur_symbol }} {{ money(q.total_amount or q.total) }}
Taxable: {{ cur_symbol }} {{ indian_amount(taxable_dec) }}
Back {% if can_edit_quote %} Edit {% endif %}
{% if q.status %} {% if inv_exists or jobcard_exists %} {% else %}
{% endif %} {% endif %} {% if q.proposal_confirmed_at and current_user.has_perm("operations.jobcard.assign_ops") and not q.project %} Assign Operations {% endif %} {% if status_name in ("Selected","Sent") %} {% if q.project %} Open Project {% elif not inv_exists %}
{% endif %} {% endif %} {% if status_name == "Approved" and q.client_id %} {% endif %} {% if status_name in ("Approved","Sent") and not q.client_id %} {% endif %} {% if status_name in ("Approved","Selected","Sent") %} {% if proposal_done %}View Proposal{% else %}Create Proposal{% endif %} {% endif %} {% if proposal_done and status_name in ("Approved","Selected","Sent") %} Download Proposal {% endif %} {% if status_name == "Selected" and proposal_done %}
{% endif %} {% if status_name == "Sent" and proposal_done and not proposal_confirmed %}
{% endif %} {% if proposal_confirmed %} Payments {% else %} {% endif %} {% if pi_exists %} View PI {% endif %} {% if (not pi_exists) and proposal_confirmed and status_name == "Sent" and (not pi_pending) and current_user.has_perm("proforma.request") %}
{% endif %} {% if (not pi_exists) and pi_pending and current_user.has_perm("proforma.generate") %}
{% endif %} {% if inv_exists %} View Invoice {% endif %} {% if pi_exists and (not inv_exists) and proposal_confirmed and status_name == "Sent" and (not inv_pending) and current_user.has_perm("invoices.request") %}
{% endif %} {% if pi_exists and (not inv_exists) and inv_pending and current_user.has_perm("invoices.generate") %}
{% endif %}
Quote Status
{{ status_name if status_name else '—' }}
Current approval / sales state
Proposal
{% if proposal_confirmed %} Confirmed {% elif proposal_done %} Created {% else %} Pending {% endif %}
Proposal workflow status
PI Status
{% if pi_exists %} Created {% elif pi_pending %} Pending {% else %} — {% endif %}
Proforma invoice workflow
Invoice Status
{% if inv_exists %} Created {% elif inv_pending %} Pending {% else %} — {% endif %}
Final invoice workflow
Quote Items
Commercial Line Items
Service-wise pricing, quantity and billing cycle.
{{ items|length }} Item(s)
{% if items|length > 0 %}
{% for it in items %} {% endfor %}
Item Service Billing Qty Rate Amount
{{ it.item_name }}
{% if it.description %}
{{ it.description }}
{% endif %}
{% if it.service %} {{ it.service.name }} {% else %} — {% endif %} {% set bc = (it.billing_cycle or 'ONETIME')|upper %} {{ bc.replace("_"," ").title() }} {{ it.qty or 0 }} {{ money(it.rate) }} {{ cur_symbol }} {{ money(it.amount) }}
{% else %}
No quote items found.
{% endif %}
{% if q.customer_notes or q.notes %}
{% if q.customer_notes %}
Customer Notes
External Notes
{{ q.customer_notes }}
{% endif %} {% if q.notes %}
Internal Notes
Team Notes
{{ q.notes }}
{% endif %}
{% endif %}
Status Details
Quote Snapshot
Quote Status
{{ status_name if status_name else '—' }}
{% if q.opportunity and q.opportunity.stage %}
Pipeline Stage
{{ q.opportunity.stage.name }}
{% endif %} {% if q.status_updated_at %}
Updated At
{{ q.status_updated_at.strftime('%d-%b-%Y %H:%M') }}
{% endif %} {% if q.status_updated_by %}
Updated By
{{ q.status_updated_by.name }}
{% endif %} {% if q.status_remark %}
Status Remark
{{ q.status_remark }}
{% endif %} {% if cur_code == "INR" %}
Customer Billing
Billing State
{{ q.billing_state or (q.branch.state if q.branch else '—') }}
GSTIN
{{ q.billing_gstin or (q.branch.gst if q.branch else '—') }}
{% endif %}
Estimated Closure
Expected conversion date
{% if q.estimated_closure_date %}
{{ q.estimated_closure_date.strftime('%d %b %Y') }}
{% if is_overdue %} Overdue {% endif %} {% else %} — {% endif %}
{% if q.client_id %}
Linked to Client ID: #{{ q.client_id }}
{% if status_name == "Draft" %}
This quote is already linked to an existing client. Request approval first, then use Mark Selected.
{% endif %} {% endif %}
Workflow
Billing Progress
Proposal Created
{% if proposal_done %} Created successfully {% else %} Not created yet {% endif %}
{% if proposal_done %} Yes {% else %} No {% endif %}
Proposal Confirmed
{% if proposal_confirmed %} Confirmed at {{ q.proposal_confirmed_at.strftime('%d-%b-%Y %H:%M') if q.proposal_confirmed_at else '-' }} {% else %} Awaiting customer confirmation {% endif %}
{% if proposal_confirmed %} Confirmed {% else %} Pending {% endif %}
Payments
{% if proposal_confirmed %} Payment collection enabled {% else %} Locked until proposal confirmation {% endif %}
{% if proposal_confirmed %} Enabled {% else %} Locked {% endif %}
PI Workflow
{% if q.pi_requested_at %}
Requested: {{ q.pi_requested_at.strftime('%d-%b-%Y %H:%M') }} {% if q.pi_requested_by %}
by {{ q.pi_requested_by.name }}
{% endif %}
{% else %}
No PI request yet
{% endif %}
{% if pi_exists %} Created {% elif pi_pending %} Pending {% else %} — {% endif %}
{% if q.pi_request_note %}
{{ q.pi_request_note }}
{% endif %} {% if pi_exists %} {% endif %}
Invoice Workflow
{% if q.invoice_requested_at %}
Requested: {{ q.invoice_requested_at.strftime('%d-%b-%Y %H:%M') }} {% if q.invoice_requested_by %}
by {{ q.invoice_requested_by.name }}
{% endif %}
{% else %}
No invoice request yet
{% endif %}
{% if inv_exists %} Created {% elif inv_pending %} Pending {% else %} — {% endif %}
{% if q.invoice_request_note %}
{{ q.invoice_request_note }}
{% endif %} {% if inv_exists %} {% endif %}
Financial Summary
Quote Value
{{ cur_code }}
Subtotal
{{ cur_symbol }} {{ money(q.subtotal) }}
Discount
{{ cur_symbol }} {{ money(q.discount) }}
Taxable Value
{{ cur_symbol }} {{ indian_amount(taxable_dec) }}
{% if gst_enabled %}
GST Breakdown
{% if is_intrastate %}
Intra-state Supply (CGST + SGST)
CGST (9%)
{{ cur_symbol }} {{ money(q.cgst) }}
SGST (9%)
{{ cur_symbol }} {{ money(q.sgst) }}
{% else %}
Inter-state Supply (IGST)
IGST (18%)
{{ cur_symbol }} {{ money(q.igst) }}
{% endif %}
Total GST
{{ cur_symbol }} {{ money(q.tax) }}
{% endif %}
Grand Total
{{ cur_symbol }} {{ money(q.total_amount or q.total) }}
{% if status_name == "Approved" and q.client_id %} {% endif %} {% if status_name in ("Approved","Sent") and not q.client_id %} {% include "quotes/_convert_to_client_modal.html" %} {% endif %} {% endblock %}