Skip to content

Mass Activation

Overview

Mass Activation allows you to activate or renew multiple subscribers at once with a single click. Instead of activating subscribers one by one, you can select hundreds or thousands of subscribers and activate them all together in bulk. This is extremely useful for monthly renewals, promotional campaigns, or reactivating expired subscribers.

WHAT IS MASS ACTIVATION?

Mass Activation is bulk processing that:

  • Activates Multiple Subscribers - Process hundreds at once
  • Same Package for All - Or keep their current packages
  • Smart Payment Logic - Auto-detects subscriber balance
  • Error Handling - Skips failed subscribers, continues with others
  • Transaction Safety - Each subscriber processed atomically

Perfect for: Monthly renewals, bulk reactivations, promotional campaigns!


📋 Table of Contents

  1. How Mass Activation Works
  2. Payment Types
  3. Direct vs Smart Billing
  4. Accounting Logic
  5. Validation Rules
  6. What Happens to Failed Subscribers
  7. Step-by-Step Process
  8. Balance Requirements
  9. Transaction Safety
  10. Failed Activation Logs
  11. Best Practices
  12. Common Scenarios

How Mass Activation Works

The Complete Flow

1. Select Subscribers → 2. Choose Package → 3. Select Payment Type → 
4. System Validates Each → 5. Process Activations → 6. Generate Report

Key Features

✅ Bulk Processing

  • Activate 10, 100, or 1000+ subscribers at once
  • Each subscriber processed independently
  • Failed subscribers don't stop the process

✅ Smart Payment Detection

  • Auto-checks subscriber balance
  • Falls back to invoice if insufficient
  • No manual intervention needed

✅ Error Handling

  • Skips subscribers that fail validation
  • Logs detailed error messages
  • Continues with remaining subscribers

✅ Transaction Safety

  • Each subscriber in separate transaction
  • All-or-nothing for each subscriber
  • No partial activations

Payment Types

Mass Activation offers 2 payment types that determine how invoices are paid:

1. Direct Billing (Payment Type 1)

What It Is:

  • Creates DUE invoices for all subscribers
  • Salesperson/reseller balance is deducted
  • Subscribers pay later in cash/mobile money
  • Invoice remains unpaid until subscriber pays

When to Use:

  • Monthly renewals where subscribers pay cash
  • Field collection by staff
  • Postpaid billing model
  • When subscribers don't have prepaid balance

How It Works:

1. System creates invoice for subscriber
2. Salesperson balance is cut (cost price)
3. Invoice status = DUE
4. Subscriber pays later (cash/mobile money)
5. When paid, invoice status = PAID

Example:

Package Price: 1000 BDT
Salesperson Cost: 900 BDT
Salesperson Profit: 100 BDT

Process:
- Invoice created: 1000 BDT (DUE)
- Salesperson balance cut: -900 BDT
- Salesperson profit: +100 BDT (in cash later)
- Subscriber owes: 1000 BDT

2. Smart Billing (Payment Type 2)

What It Is:

  • Intelligent payment detection
  • Checks subscriber balance first
  • If balance sufficient → Pays from balance (PAID invoice)
  • If balance insufficient → Creates DUE invoice (like Direct Billing)

When to Use:

  • Mixed subscriber base (some prepaid, some postpaid)
  • Want to auto-collect from subscribers with balance
  • Reduce manual collection work
  • Maximize automation

How It Works:

For Each Subscriber:
1. Check subscriber balance
2. IF balance ≥ invoice amount:
   → Pay from balance (invoice PAID)
   → Salesperson gets profit in balance
3. IF balance < invoice amount:
   → Create DUE invoice
   → Cut salesperson balance
   → Salesperson gets profit in cash later

Example 1: Subscriber Has Balance

Subscriber Balance: 1500 BDT
Invoice Amount: 1000 BDT

Process:
- Subscriber balance: 1500 - 1000 = 500 BDT
- Invoice status: PAID
- Salesperson profit: +100 BDT (added to balance)
- No cash collection needed

Example 2: Subscriber Has Insufficient Balance

Subscriber Balance: 300 BDT
Invoice Amount: 1000 BDT

Process:
- Balance insufficient (300 < 1000)
- Falls back to Direct Billing
- Invoice status: DUE
- Salesperson balance cut: -900 BDT
- Subscriber owes: 1000 BDT

Direct vs Smart Billing

Comparison Table

FeatureDirect BillingSmart Billing
Invoice StatusAlways DUEPAID if balance, else DUE
Subscriber BalanceNot checkedChecked first
Salesperson BalanceAlways cutCut only if subscriber has no balance
Salesperson ProfitIn cash laterIn balance if paid, cash if DUE
Cash CollectionRequired for allOnly for insufficient balance
Best ForPostpaid modelMixed prepaid/postpaid
AutomationManual collectionAuto-collection when possible

When to Use Each

Use Direct Billing When:

  • ✅ All subscribers are postpaid
  • ✅ Field staff collects cash
  • ✅ You want consistent DUE invoices
  • ✅ Subscribers don't maintain prepaid balance

Use Smart Billing When:

  • ✅ Mixed subscriber base
  • ✅ Some subscribers have prepaid balance
  • ✅ Want to maximize automation
  • ✅ Reduce manual collection work
  • ✅ Prefer auto-deduction when possible

Accounting Logic

How Money Flows

Direct Billing Flow

Step 1: Invoice Creation

Invoice Amount: 1000 BDT
Status: DUE
Subscriber Owes: 1000 BDT

Step 2: Salesperson Balance Cut

Salesperson Balance Before: 50,000 BDT
Package Cost: 900 BDT
Salesperson Balance After: 49,100 BDT

Step 3: Profit Recording

Salesperson Profit: 100 BDT
Profit Type: Cash (to be received)
Balance Change: No (profit in cash, not balance)

Step 4: Later - Subscriber Pays

Subscriber pays 1000 BDT in cash
Invoice Status: DUE → PAID
Salesperson receives: 1000 BDT cash
Salesperson keeps profit: 100 BDT
Salesperson pays upstream: 900 BDT

Smart Billing Flow (With Balance)

Step 1: Balance Check

Subscriber Balance: 1500 BDT
Invoice Amount: 1000 BDT
Result: ✅ Sufficient

Step 2: Payment from Balance

Subscriber Balance Before: 1500 BDT
Invoice Amount: 1000 BDT
Subscriber Balance After: 500 BDT
Invoice Status: PAID

Step 3: Salesperson Profit Added

Salesperson Balance Before: 50,000 BDT
Salesperson Profit: 100 BDT
Salesperson Balance After: 50,100 BDT
Balance Change: Yes (profit added to balance)

No Cash Collection Needed!


Smart Billing Flow (Without Balance)

Step 1: Balance Check

Subscriber Balance: 300 BDT
Invoice Amount: 1000 BDT
Result: ❌ Insufficient

Step 2: Fallback to Direct Billing

Same as Direct Billing:
- Invoice Status: DUE
- Salesperson balance cut: -900 BDT
- Profit in cash later: 100 BDT
- Subscriber owes: 1000 BDT

Discount Handling

Critical Rule: Discount is absorbed from salesperson's profit, NOT from upstream cost.

Example:

Package Price: 1000 BDT
Salesperson Cost: 900 BDT
Salesperson Profit: 100 BDT
Subscriber Discount: 50 BDT

Calculation:
- Subscriber Pays: 1000 - 50 = 950 BDT
- Salesperson Cost: 900 BDT (unchanged)
- Salesperson Profit: 100 - 50 = 50 BDT

Admin vs Reseller:

Admin (Profile Type 1):

  • Cuts NET amount (what subscriber pays)
  • Absorbs discount from own profit
  • No upstream payment

Reseller (Profile Type 3+):

  • Cuts FULL amount (must pay upstream)
  • Discount comes from their profit
  • Must pay parent reseller full cost

Staff Balance Limit

If Staff Has Balance Deduction Enabled:

How It Works:

Staff Balance Limit: 10,000 BDT
Package Cost: 900 BDT

Process:
1. Check: 10,000 ≥ 900 ✅
2. Activate subscriber
3. Deduct: 10,000 - 900 = 9,100 BDT
4. New Limit: 9,100 BDT

If Insufficient:

Staff Balance Limit: 500 BDT
Package Cost: 900 BDT

Result: ❌ Error
Message: "Insufficient Staff Accounting Balance"
Subscriber: Skipped

Validation Rules

Mass Activation validates each subscriber before activation. If validation fails, that subscriber is skipped and logged.

1. Subscriber Must Exist

Rule: Subscriber ID must be valid and exist in system.

Error: "Subscriber Not Found In System"

What Happens: Subscriber skipped, process continues


2. Profile Status Check

Rule: Subscriber profile must be Active (status 1 or 2).

Blocked Statuses:

  • Status 3: Disabled
  • Status 4: Terminated
  • Status 5+: Other inactive

Error: "Subscriber Profile Status Disabled or Terminated"

What Happens: Subscriber skipped, process continues


3. Rate Limiting (2-Minute Rule)

Rule: Cannot activate same subscriber twice within 2 minutes.

Error: "Subscriber Already Activated X Seconds Ago. Minimum Interval: 120 Seconds"

Why: Prevents duplicate invoices from concurrent requests

What Happens: Subscriber skipped, process continues


4. Salesperson Must Exist

Rule: Subscriber must be assigned to a valid salesperson.

Error: "Salesperson Not Found For This Subscriber"

What Happens: Subscriber skipped, process continues


5. Package Must Exist

Rule: Package must be valid and active.

Error: "Package Not Found (Package ID: X)"

What Happens: Subscriber skipped, process continues


6. Package Billing Type Required

Rule: Package must have billing type set (Prepaid or Postpaid).

Error: "Package Billing Type Not Found (Package: X)"

What Happens: Subscriber skipped, process continues


7. Package Assignment Check

Rule: Package must be assigned to salesperson.

Error: "Package 'X' Not Assigned To Salesperson 'Y'"

What Happens: Subscriber skipped, process continues


8. Package Accounting Validation

Rule: Package accounting must be properly configured.

Error: Various accounting validation errors

What Happens: Subscriber skipped, process continues


9. Staff Balance Check

Rule: If staff with balance deduction, must have sufficient balance limit.

Error: "Insufficient Staff Accounting Balance. Required: X BDT, Available: Y BDT"

What Happens: Subscriber skipped, process continues


10. Salesperson Balance Check (Direct Billing)

Rule: For non-admin salespersons, must have sufficient balance.

Error: "Insufficient Salesperson Balance. Required: X BDT, Available: Y BDT"

What Happens: Subscriber skipped, process continues


11. Subscriber Balance Check (Smart Billing)

Rule: If Smart Billing and subscriber has insufficient balance, check salesperson balance.

Error: "Insufficient Salesperson Balance (Smart Payment Fallback)"

What Happens: Subscriber skipped, process continues


12. Discount vs Profit Validation

Rule: Discount cannot exceed salesperson's profit margin.

Error: "Insufficient Profit Margin For Subscriber Discount. Discount: X BDT, Available Profit: Y BDT"

What Happens: Subscriber skipped, process continues


What Happens to Failed Subscribers

Error Handling Philosophy

Mass Activation uses "Continue on Error" approach:

  • ✅ Failed subscribers are skipped
  • ✅ Error is logged with details
  • ✅ Process continues with next subscriber
  • ✅ No interruption to bulk process

Failed Activation Log

Every failed subscriber is logged with:

  • Subscriber ID
  • Subscriber Username
  • Error Message (detailed reason)
  • Timestamp
  • ISP/Branch ID

Log Location: Auto Renew Failed Logs

Example Log Entry:

Subscriber: john_doe (ID: 12345)
Message: Mass Activation : Insufficient Salesperson Balance. 
         Required: 900 BDT, Available: 500 BDT
Time: 2025-01-15 10:30:45

Why Subscribers Fail

Top 10 Reasons:

  1. Insufficient Balance (40%)

    • Salesperson balance too low
    • Subscriber balance too low (Smart Billing)
    • Staff balance limit exceeded
  2. Rate Limiting (25%)

    • Activated within last 2 minutes
    • Duplicate activation attempt
  3. Package Not Assigned (15%)

    • Package not allocated to salesperson
    • Package accounting missing
  4. Profile Disabled (10%)

    • Subscriber status disabled/terminated
    • Account suspended
  5. Discount Exceeds Profit (5%)

    • Subscriber discount > salesperson profit
    • Negative profit scenario
  6. Missing Salesperson (3%)

    • Salesperson deleted/removed
    • Assignment broken
  7. Package Issues (1%)

    • Package deleted
    • Billing type not set
  8. Concurrent Processing (0.5%)

    • Subscriber locked by another process
    • Database row lock timeout
  9. Validation Errors (0.3%)

    • Package accounting validation failed
    • Business rule violations
  10. System Errors (0.2%)

    • Database connection issues
    • Unexpected exceptions

Reviewing Failed Subscribers

After Mass Activation:

  1. ✅ Check success message: "Successfully Invoice Generated & X Subscribers Activated"
  2. ✅ Go to Logs → Auto Renew Failed Logs
  3. ✅ Filter by date/time of mass activation
  4. ✅ Review each failed subscriber
  5. ✅ Fix issues (add balance, assign package, etc.)
  6. ✅ Re-run mass activation for failed subscribers

Step-by-Step Process

Step 1: Select Subscribers

From Subscriber List:

  1. Go to Subscriber → All Subscribers
  2. Use filters to find subscribers (expired, active, etc.)
  3. Select checkboxes for subscribers to activate
  4. Or use "Select All" for bulk selection

Tips:

  • Filter by expiration date for renewals
  • Filter by package for specific groups
  • Filter by salesperson for reseller activations

Step 2: Choose Package

Options:

A. Current Package (Renewal)

  • Select "Current Package" option
  • Each subscriber keeps their existing package
  • Best for monthly renewals

B. Specific Package (Change)

  • Select a specific package from dropdown
  • All selected subscribers get this package
  • Best for promotions or package migrations

Step 3: Select Payment Type

Choose One:

Direct Billing:

  • All invoices will be DUE
  • Salesperson balance cut for all
  • Manual cash collection required

Smart Billing:

  • Auto-detects subscriber balance
  • Pays from balance if available
  • Falls back to DUE if insufficient

Step 4: Review & Confirm

System Shows:

  • Number of subscribers selected
  • Package name
  • Payment type

Click "Activate" Button


Step 5: Processing

System Processes Each Subscriber:

  1. Validates subscriber
  2. Checks balances
  3. Creates invoice
  4. Processes payment (if applicable)
  5. Updates radius
  6. Activates service
  7. Logs result

Progress:

  • Successful activations counted
  • Failed activations logged
  • No interruption on errors

Step 6: Review Results

Success Message:

"Successfully Invoice Generated & 245 Subscribers Activated"

If Some Failed:

  1. Check Auto Renew Failed Logs
  2. Review error messages
  3. Fix issues
  4. Re-activate failed subscribers

Balance Requirements

For Direct Billing

Salesperson Balance Required:

For Each Subscriber:
  Salesperson Balance ≥ Package Cost

Example:
  100 subscribers × 900 BDT cost = 90,000 BDT required

Admin Exception:

  • Admin can activate without balance check
  • Unlimited activation power

For Smart Billing

Two Scenarios:

Scenario 1: Subscriber Has Balance

Subscriber Balance ≥ Invoice Amount
→ No salesperson balance needed
→ Payment from subscriber balance

Scenario 2: Subscriber Has No Balance

Subscriber Balance < Invoice Amount
→ Salesperson Balance ≥ Package Cost
→ Falls back to Direct Billing logic

Staff Balance Limit

If Staff User:

Staff Balance Limit ≥ (Number of Subscribers × Package Cost)

Example:
  50 subscribers × 900 BDT = 45,000 BDT required
  Staff Limit: 50,000 BDT ✅
  Staff Limit: 40,000 BDT ❌

Transaction Safety

Database Transactions

Each Subscriber = Separate Transaction

What This Means:

  • All-or-nothing for each subscriber
  • If any step fails, entire subscriber activation rolls back
  • No partial data saved
  • Next subscriber unaffected

Row Locking

Prevents Race Conditions:

Problem Without Locking:

Request 1: Check invoice (none found) → Create invoice
Request 2: Check invoice (none found) → Create invoice
Result: 2 invoices for same subscriber ❌

Solution With Locking:

Request 1: Lock subscriber → Check → Create → Unlock
Request 2: Wait for lock → Check → See recent invoice → Skip
Result: 1 invoice only ✅

Atomic Operations

What Gets Rolled Back on Error:

  • ✅ Invoice creation
  • ✅ Payment records
  • ✅ Ledger entries
  • ✅ Balance deductions
  • ✅ Radius updates
  • ✅ Subscriber updates

What Stays:

  • ✅ Failed activation log
  • ✅ Audit trail
  • ✅ Other subscribers' activations

Duplicate Prevention

Multiple Safeguards:

  1. Array Unique - Removes duplicate IDs from input
  2. Rate Limiting - 2-minute interval check
  3. Row Locking - Prevents concurrent access
  4. Transaction - Atomic check and create

Failed Activation Logs

What Gets Logged

For Each Failed Subscriber:

  • ✅ Subscriber ID
  • ✅ Subscriber Username
  • ✅ Error Message (detailed)
  • ✅ Timestamp
  • ✅ ISP/Branch ID
  • ✅ Status Flag

Log Messages

Common Log Messages:

Balance Issues:

"Insufficient Salesperson Balance. Required: 900 BDT, Available: 500 BDT"
"Insufficient Subscriber Balance For Prepaid Package"
"Insufficient Staff Accounting Balance. Required: 900 BDT, Available: 500 BDT"

Rate Limiting:

"Subscriber Already Activated 45 Seconds Ago. Minimum Interval: 120 Seconds"

Package Issues:

"Package Not Found (Package ID: 123)"
"Package 'Premium 10Mbps' Not Assigned To Salesperson 'reseller1'"
"Package Billing Type Not Found (Package: Basic 5Mbps)"

Subscriber Issues:

"Subscriber Not Found In System"
"Subscriber Profile Status Disabled or Terminated"
"Salesperson Not Found For This Subscriber"

Validation Issues:

"Insufficient Profit Margin For Subscriber Discount. Discount: 150 BDT, Available Profit: 100 BDT"

Viewing Logs

Location: Logs → Auto Renew Failed Logs

Filter By:

  • Date range
  • Subscriber username
  • Error message
  • ISP/Branch

Best Practices

Before Mass Activation

1. Check Balances

✅ Salesperson balance sufficient
✅ Staff balance limit adequate
✅ Subscriber balances (for Smart Billing)

2. Verify Package Assignments

✅ Packages assigned to salespersons
✅ Package accounting configured
✅ Billing types set

3. Review Subscribers

✅ Profile statuses active
✅ No recent activations (2-minute rule)
✅ Salesperson assignments valid

4. Choose Right Payment Type

✅ Direct Billing for postpaid model
✅ Smart Billing for mixed model
✅ Consider cash collection capacity

During Mass Activation

1. Start Small

✅ Test with 10-20 subscribers first
✅ Verify results
✅ Then process larger batches

2. Monitor Progress

✅ Watch for success message
✅ Note number of activations
✅ Check for errors

3. Don't Interrupt

❌ Don't close browser
❌ Don't refresh page
❌ Don't click back button
✅ Wait for completion

After Mass Activation

1. Review Results

✅ Check success count
✅ Review failed logs
✅ Verify invoices created

2. Handle Failed Subscribers

✅ Read error messages
✅ Fix issues
✅ Re-activate failed subscribers

3. Verify Activations

✅ Check subscriber profiles
✅ Verify expiration dates
✅ Test internet access (sample)

4. Update Balances

✅ Add salesperson balance if needed
✅ Increase staff limits if needed
✅ Top up subscriber balances

Common Scenarios

Scenario 1: Monthly Renewal (Postpaid)

Setup:

  • 500 subscribers
  • All postpaid (pay cash monthly)
  • Same package for all

Process:

  1. Select all 500 subscribers
  2. Choose "Current Package"
  3. Select "Direct Billing"
  4. Click Activate

Result:

  • 500 DUE invoices created
  • Salesperson balance cut: 500 × 900 = 450,000 BDT
  • Staff collects cash from subscribers
  • Invoices marked PAID when collected

Scenario 2: Mixed Prepaid/Postpaid

Setup:

  • 300 subscribers
  • 150 have prepaid balance
  • 150 don't have balance

Process:

  1. Select all 300 subscribers
  2. Choose "Current Package"
  3. Select "Smart Billing"
  4. Click Activate

Result:

  • 150 subscribers: Paid from balance (PAID invoices)
  • 150 subscribers: DUE invoices created
  • Salesperson balance cut only for 150 (without balance)
  • Profit added to balance for 150 (with balance)
  • Profit in cash for 150 (without balance)

Scenario 3: Promotional Package Change

Setup:

  • 100 subscribers
  • Upgrading to new promotional package
  • All postpaid

Process:

  1. Select 100 subscribers
  2. Choose "Premium 20Mbps" package
  3. Select "Direct Billing"
  4. Click Activate

Result:

  • 100 subscribers upgraded to new package
  • 100 DUE invoices at new package price
  • Salesperson balance cut at new cost
  • Subscribers pay new price

Scenario 4: Handling Failures

Setup:

  • 200 subscribers selected
  • 180 activated successfully
  • 20 failed

Process:

  1. Check success message: "180 Subscribers Activated"
  2. Go to Auto Renew Failed Logs
  3. Review 20 failed subscribers
  4. Common issues found:
    • 10 subscribers: Insufficient balance
    • 5 subscribers: Package not assigned
    • 3 subscribers: Profile disabled
    • 2 subscribers: Rate limited

Fix:

  1. Add balance for 10 subscribers
  2. Assign package to salesperson for 5
  3. Enable profiles for 3
  4. Wait 2 minutes for 2

Re-activate:

  1. Select 20 failed subscribers
  2. Run mass activation again
  3. All 20 now successful

Summary

Mass Activation is a powerful bulk processing tool with:

✅ Two Payment Types:

  • Direct Billing: All DUE invoices
  • Smart Billing: Auto-detects balance

✅ Smart Accounting:

  • Admin vs Reseller logic
  • Discount from profit
  • Staff balance limits

✅ Robust Validation:

  • 12+ validation rules
  • Each subscriber validated
  • Failed subscribers skipped

✅ Error Handling:

  • Continue on error
  • Detailed logging
  • Easy troubleshooting

✅ Transaction Safety:

  • Atomic operations
  • Row locking
  • No partial data

✅ Flexible Processing:

  • Current package or specific package
  • Mixed subscriber types
  • Scalable to thousands

Key Differences from Single Activation:

  • No manual payment entry
  • Auto payment type detection
  • Bulk error handling
  • Transaction per subscriber
  • Detailed failure logs

Best For:

  • Monthly renewals
  • Bulk reactivations
  • Promotional campaigns
  • Expired subscriber recovery
  • Package migrations

Mass Activation makes bulk subscriber management effortless while maintaining data integrity and providing detailed audit trails!

www.onezeroart.com