DDS Interest & Commission

Job Type @for (type of jobTypes; track type.code) { {{ type.label }} } Branch @for (scope of branchScopes; track scope) { {{ scope }} } @if (isBranchSelected) {
@for (office of offices; track office.id) { {{ office.name }} } @if (offices.length === 0) { Loading branches... }
} {{ isPostingJob ? 'Posting Date' : 'Interest Date' }} Agent From Agent To @if (!isCommissionJob) { Party From Party To }
@if (isPostingJob) { {{ jobTypeLabel }} moves what has already been calculated to where it belongs — into the customer's balance, or out to the agent. Generate lists it first; nothing moves until you press Post. } @else { {{ jobTypeLabel }} works out what has been earned since the last run and records it against each account. It does not become spendable until the matching Posting job runs. Generate previews it; nothing is recorded until you press Post. }
@if (generatedRun) {

{{ labelOf(generatedRun.jobType) }} — preview

Run #{{ generatedRun.id }} · nothing applied yet
@if (previewRows.length === 0) {

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

} @else {
@if (showsCommissionBreakdown) { @for (row of previewRows; track row.id) { }
Agent Period Collection Rate Commission TDS Deductions Payable
{{ 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 payable {{ money(previewTotal) }}
} @else { @if (!isCommissionJob) { } @for (row of previewRows; track row.id) { @if (!isCommissionJob) { } }
{{ isCommissionJob ? 'Agent' : 'Party' }}AgentPeriod Amount
@if (isCommissionJob) { {{ row.agentCode }} {{ row.agentName }} } @else { {{ row.partyCode }} {{ row.partyName }} } {{ row.agentCode }}{{ row.fromDate | dateFormat }} – {{ row.toDate | dateFormat }} {{ money(row.amount) }}
Total {{ money(previewTotal) }}
}
}
}
@if (generatedRun) { }
@if (postingRunId) {
Posting is running. It continues even if you leave this screen — the list below updates when it finishes.
}

Previous runs

@if (recentRuns.length === 0) {

No batch has been run yet.

} @else {
@for (run of recentRuns; track run.id) { }
# Job Date Entries Amount Status Posted On
{{ run.id }} {{ labelOf(run.jobType) }} {{ run.jobDate | dateFormat }} {{ run.totalRows }} {{ money(run.totalAmount) }} @switch (run.status) { @case ('POSTED') { Posted } @case ('POSTING') { Running } @case ('FAILED') { Failed } @default { Not posted } } {{ run.postedOnDate ? (run.postedOnDate | dateFormat) : '—' }}
}