{% extends "ui/templates/base/layout.html" %} {% block content %}

Generate Draft Invoices

Create draft GST invoices from fee structures and automatically link matching client service subscriptions / engagements for the selected financial year. Existing invoices for the same fee group and period are skipped by default.

{% if result %}

Generation Result

Draft invoices created
{{ result.created|length }}
Skipped
{{ result.skipped|length }}
Errors
{{ result.errors|length }}
{% if result.created %}
Created Draft Invoices
{% for invoice in result.created %} {% endfor %}
InvoiceClientAmount
{{ invoice.invoice_no }} {{ invoice.client.client_name if invoice.client else invoice.client_id }} ₹ {{ '%.2f'|format(invoice.total_amount or 0) }}
{% endif %} {% if result.skipped %}
Skipped rows
    {% for item in result.skipped %}
  • {{ item }}
  • {% endfor %}
{% endif %} {% if result.errors %}
Errors
    {% for item in result.errors %}
  • {{ item }}
  • {% endfor %}
{% endif %}
{% endif %}
Engagement-to-invoice refinement
This screen continues to use your existing fee-structure billing logic. During generation, the system checks the client, service and active financial year ({{ active_financial_year or 'current FY' }}) and links the invoice / invoice lines to the matching client service subscription wherever available. No duplicate module is created.
Eligible Fee Structures
Select packages and create draft invoices for {{ billing_period_from }} to {{ billing_period_to }}.
{% for row in rows %} {% set duplicate = duplicate_map.get(row.id) %} {% else %} {% endfor %}
Group Code Client Package Services / Engagement Source Mode Fee Status
{{ row.group_code }} {{ row.client.client_name if row.client else row.client_id }}
{{ row.group_name }}
{{ row.frequency }} billing
{% if row.services %}
{% for item in row.services[:4] %} {{ item.service.service_name if item.service else item.service_id }} {% endfor %} {% if row.services|length > 4 %}+{{ row.services|length - 4 }}{% endif %}
Matching active subscriptions are linked during generation.
{% else %} Package line only {% endif %}
{{ row.billing_mode }} ₹ {{ '%.2f'|format(row.fee_amount or 0) }} {% if duplicate %} Already billed: {{ duplicate.invoice_no }} {% else %} Ready {% endif %}
No eligible fee structures found for the selected filter.
{% endblock %}