{{ jobTypeLabel || 'Batch run' }} — {{ canAct ? 'preview' : 'run' }} @if (generatedRun) { {{ statusText }} }

@if (generatedRun) { Run #{{ generatedRun.id }} · {{ canAct ? 'nothing applied yet — check the figures, then Post.' : 'read only — this run is ' + statusText.toLowerCase() + '.' }} }

@if (canAct) { }
@if (loading) {
@for (row of [1, 2, 3, 4, 5]; track row) { }
} @else if (notFound) {

This run no longer exists - a new Generate or Discard may have replaced it.

} @else { @if (generatedRun?.status === 'FAILED') {

{{ generatedRun.failureReason || 'No reason recorded' }}

}
@if (previewRows.length === 0) {

Nothing to apply. Either this period has already been processed, or there was no activity in it.

} @else {
Agents{{ agentGroups.length }}
{{ isCommissionJob ? 'Entries' : 'Accounts' }}{{ previewRows.length }}
{{ showsCommissionBreakdown ? 'Total payable' : 'Total' }} ₹ {{ money(previewTotal) }}
Date{{ generatedRun.jobDate | dateFormat }}
{{ isCommissionJob ? 'One line per agent - View shows how their commission was worked out.' : 'Grouped by collecting agent - View shows the DDS accounts under each.' }}
@if (isCommissionJob) { @if (showsCommissionBreakdown) { } @for (group of agentGroups; track group.key) { @for (row of group.rows; track row.id) { @if (showsCommissionBreakdown) { } } }
Agent PeriodCollection Rate Commission TDS Deductions{{ showsCommissionBreakdown ? 'Payable' : 'Amount' }}
{{ row.agentCode }} {{ row.agentName }} {{ row.fromDate | dateFormat }} – {{ row.toDate | dateFormat }}{{ money(row.baseAmount) }} {{ row.ratePercent }}% {{ money(row.grossAmount) }} {{ money(row.tdsAmount) }} {{ money(row.deductionAmount) }}{{ money(row.amount) }}
Total {{ money(previewTotal) }}
} @else { @for (group of agentGroups; track group.key) { }
Agent Accounts Amount
{{ group.initials }} {{ group.agentCode }} {{ group.agentName }} {{ group.rows.length }} {{ money(group.total) }}
Total {{ previewRows.length }} {{ money(previewTotal) }}
}
}
} @if (selectedGroup; as group) {
{{ group.initials }}

{{ group.agentCode }} {{ group.agentName }}

{{ labelOf(generatedRun?.jobType) }} · Run #{{ generatedRun?.id }} · {{ generatedRun?.jobDate | dateFormat }}

@if (isCommissionJob) { @for (row of group.rows; track row.id) {
@if (showsCommissionBreakdown) {
Collection₹ {{ money(row.baseAmount) }}
Slab rate{{ row.ratePercent }}%
Commission₹ {{ money(row.grossAmount) }}
– TDS₹ {{ money(row.tdsAmount) }}
– Deductions₹ {{ money(row.deductionAmount) }}
}
{{ showsCommissionBreakdown ? 'Payable to agent' : 'To be paid out' }} ₹ {{ money(row.amount) }}

Period {{ row.fromDate | dateFormat }} – {{ row.toDate | dateFormat }}. The agent's collection from all their customers is added up and one slab rate applies to the whole figure.

} } @else {
Accounts{{ group.rows.length }}
Total₹ {{ money(group.total) }}
@for (row of popupRows; track row.id; let i = $index) { } @empty { }
# Party Period Rate Amount
{{ i + 1 }} {{ row.partyCode }} {{ row.partyName }} {{ row.fromDate | dateFormat }} – {{ row.toDate | dateFormat }} {{ row.ratePercent ? row.ratePercent + '%' : '—' }} {{ money(row.amount) }}
No account matches the search.
{{ agentSearch ? 'Total of the accounts shown' : 'Total' }} {{ money(popupTotal) }}
}
}