Commission Slab Master

The DDS agent commission chart - a percentage on each agent's collection volume

1 The commission run adds up each agent's collections not yet counted.
2 It finds the Account slab where From ≤ collection ≤ To.
3 Commission = collection × slab % . TDS and the agent's deductions come off that.
! A collection with no slab (a gap, below the first or above the last) stops the run. Start each slab 0.01 after the last one ends.

Slabs

@if (loading) { Loading slabs… } @else { {{ slabs.length }} {{ slabs.length === 1 ? 'slab' : 'slabs' }} }
@if (loading) { @for (row of skeletonRows; track row) { } } @for (slab of slabs; track slab; let i = $index) { @if (editingIndex === i) { } @else { } }
Slab Type Slab From (₹) Slab To (₹) Comm % Commission at "To"
@for (type of slabTypes; track type) { {{ typeInfo(type).title }} } %
{{ slab.slabType }} @if (!typeInfo(slab.slabType).used) { Not applied } @if (!slab.id) { Unsaved } {{ slab.slabFrom | number: '1.2-2' }} {{ slab.slabTo | number: '1.2-2' }} {{ slab.commissionPercent | number: '1.0-4' }}% ₹ {{ commissionAtTop(slab) | number: '1.2-2' }} @if (slab.id) { } @else { }
@for (type of slabTypes; track type) { {{ typeInfo(type).title }} } % {{ newSlabForm.get('slabType')?.value ? typeInfo(newSlabForm.get('slabType')?.value).hint : 'Pick a type' }}
@if (loadFailed) {

The commission slabs could not be loaded.

} @else if (!loading && slabs.length === 0) {

No commission slabs defined yet — add one using the row above.

} @if (!loading && coverage.length > 0) {
@for (entry of coverage; track entry.slabType) {
{{ entry.slabType }} covers ₹ {{ entry.from | number: '1.2-2' }} to ₹ {{ entry.to | number: '1.2-2' }} @if (typeInfo(entry.slabType).used && entry.from > 0) { below ₹ {{ entry.from | number: '1.2-2' }} has no slab } @if (entry.gaps.length > 0) { no slab for {{ entry.gaps.join(', ') }} — the commission run stops for an agent landing there } @if (!typeInfo(entry.slabType).used) { {{ typeInfo(entry.slabType).hint }} }
}
}

Commission Calculator

Uses the saved Account slabs - the same arithmetic as the commission run
Agent's collection (₹) TDS % Deductions (₹)
@if (calculation; as c) { @if (c.slab) {
Slab ₹ {{ c.slab.slabFrom | number: '1.2-2' }} – {{ c.slab.slabTo | number: '1.2-2' }}
Rate{{ c.rate | number: '1.0-4' }}%
Gross₹ {{ c.gross | number: '1.2-2' }}
– TDS₹ {{ c.tds | number: '1.2-2' }}
– Deductions₹ {{ c.deductions | number: '1.2-2' }}
Net to agent₹ {{ (c.net > 0 ? c.net : 0) | number: '1.2-2' }}
@if (c.net <= 0) {

The deductions swallow this commission - the run pays this agent nothing.

} } @else {

No saved Account slab covers this amount — the commission run would stop with "no commission slab" for this agent.

} }