Appearance
Package Migration
Overview
Package Migration allows you to change a subscriber's package while automatically calculating pro-rated billing based on their unused time from the old package. Instead of losing money when upgrading or downgrading, the system calculates refunds for unused days and applies them as credit toward the new package.
WHAT IS PACKAGE MIGRATION?
Package Migration is a smart billing feature that:
- Changes Subscriber Package - Upgrade or downgrade anytime
- Pro-Rated Billing - Credit for unused days from old package
- Automatic Calculation - System handles all math
- Three Billing Scenarios - Pay difference, exact match, or get refund
- Seamless Transition - No service interruption
Perfect for: Package upgrades, downgrades, promotional changes, customer retention!
📋 Table of Contents
- How Migration Works
- Eligibility Requirements
- Pro-Rated Billing Logic
- Three Migration Scenarios
- Fee Calculation
- Expiration Extension
- Payment Methods
- Balance Requirements
- Validation Rules
- Step-by-Step Process
- Accounting & Profit Distribution
- Common Use Cases
How Migration Works
The Complete Flow
1. Select Subscriber → 2. Choose New Package → 3. Calculate Unused Credit →
4. Calculate Net Charge → 5. Process Payment (if needed) → 6. Activate New Package →
7. Extend Expiration → 8. Update RadiusWhat Gets Calculated
From Old Package:
- Total days in package
- Days already used
- Days remaining (unused)
- Refund amount for unused days
For New Package:
- Full package price
- Pro-rated price for remaining days
- Net charge (new price - unused credit)
Final Result:
- Subscriber pays only the difference
- Or gets credit if downgrading
- Or pays nothing if credit covers exactly
Eligibility Requirements
Subscriber Must Have
1. Previous Activation
- Must have at least one invoice
- Cannot migrate without activation history
- New subscribers must activate first
2. Valid Invoice Status
- Invoice status must be one of:
- Active (1)
- Paid (4)
- Partial Paid (5)
- Due (6)
Blocked Statuses:
- Cancelled invoices
- Migrated invoices (already migrated)
- Invalid invoices
3. Active Profile
- Profile must be active
- Not disabled or terminated
4. Package Assigned to Salesperson
- New package must be allocated to salesperson
- Package accounting must exist
Pro-Rated Billing Logic
How Unused Credit is Calculated
Step 1: Calculate Used Days
Invoice Start Date: Jan 1, 2025
Migration Date: Jan 10, 2025
Used Days: 10 daysStep 2: Calculate Remaining Days
Package Duration: 30 days
Used Days: 10 days
Remaining Days: 20 daysStep 3: Calculate Unused Credit
Old Package Price: 1000 BDT
Price Per Day: 1000 / 30 = 33.33 BDT/day
Unused Credit: 33.33 × 20 days = 666.67 BDTHow Net Charge is Calculated
Formula:
Net Charge = New Package Price - Unused CreditExample 1: Upgrade (Pay Difference)
New Package Price: 1500 BDT
Unused Credit: 666.67 BDT
Net Charge: 1500 - 666.67 = 833.33 BDT
Result: Subscriber pays 833.33 BDTExample 2: Downgrade (Get Refund)
New Package Price: 500 BDT
Unused Credit: 666.67 BDT
Net Charge: 500 - 666.67 = -166.67 BDT
Result: Subscriber gets 166.67 BDT creditExample 3: Exact Match (No Payment)
New Package Price: 666.67 BDT
Unused Credit: 666.67 BDT
Net Charge: 666.67 - 666.67 = 0 BDT
Result: No payment neededThree Migration Scenarios
Scenario 1: Pay Difference (Upgrade)
When: New package costs MORE than unused credit
Example:
Old Package: 1000 BDT/month (20 days unused)
Unused Credit: 666.67 BDT
New Package: 1500 BDT/month
Net Charge: 1500 - 666.67 = 833.33 BDT
Process:
1. Subscriber pays 833.33 BDT
2. Old invoice marked as "Migrated"
3. New invoice created for 833.33 BDT
4. New package activated
5. Expiration extendedInvoice Details:
- Old Invoice: Type = Migrated (3)
- New Invoice: Amount = 833.33 BDT
- Payment: 833.33 BDT (if paid)
- Status: PAID or DUE
Scenario 2: Exact Match (No Payment)
When: New package costs EXACTLY same as unused credit
Example:
Old Package: 1000 BDT/month (20 days unused)
Unused Credit: 666.67 BDT
New Package: 666.67 BDT/month
Net Charge: 666.67 - 666.67 = 0 BDT
Process:
1. No payment needed
2. Old invoice marked as "Migrated"
3. New invoice created for 0 BDT
4. Invoice automatically marked PAID
5. New package activated
6. Expiration extendedInvoice Details:
- Old Invoice: Type = Migrated (3)
- New Invoice: Amount = 0 BDT
- Payment: 0 BDT (credit covered)
- Status: PAID
- Note: "Paid By Credit From Old Invoice (Exact Match)"
Scenario 3: Get Refund (Downgrade)
When: New package costs LESS than unused credit
Example:
Old Package: 1000 BDT/month (20 days unused)
Unused Credit: 666.67 BDT
New Package: 500 BDT/month
Net Charge: 500 - 666.67 = -166.67 BDT
Excess Credit: 166.67 BDT
Process:
1. No payment needed
2. Old invoice marked as "Migrated"
3. New invoice created for 0 BDT
4. Invoice automatically marked PAID
5. Excess credit (166.67 BDT) added to subscriber balance
6. New package activated
7. Expiration extendedInvoice Details:
- Old Invoice: Type = Migrated (3)
- New Invoice: Amount = 0 BDT
- Payment: 0 BDT (credit covered + excess)
- Status: PAID
- Subscriber Balance: +166.67 BDT
- Note: "Excess Credit From Old Invoice: 166.67 BDT"
Fee Calculation
Complete Fee Breakdown
1. Old Package Analysis
Old Package Price: 1000 BDT
Package Duration: 30 days
Price Per Day: 1000 / 30 = 33.33 BDT/day
Invoice Date: Jan 1, 2025
Migration Date: Jan 10, 2025
Used Days: 10 days
Remaining Days: 20 days
Used Amount: 33.33 × 10 = 333.33 BDT
Unused Credit: 33.33 × 20 = 666.67 BDT2. New Package Calculation
New Package Price: 1500 BDT
Package Duration: 30 days
Price Per Day: 1500 / 30 = 50 BDT/day
Remaining Days: 20 days (from old package)
Pro-Rated Price: 50 × 20 = 1000 BDT3. Net Charge
Pro-Rated New Price: 1000 BDT
Unused Credit: 666.67 BDT
Net Charge: 1000 - 666.67 = 333.33 BDT4. With Discount
Net Charge: 333.33 BDT
Subscriber Discount 10%: 33.33 BDT
Final Amount: 333.33 - 33.33 = 300 BDT5. With Extra Fees
Final Amount: 300 BDT
VAT 15%: 45 BDT
Total: 300 + 45 = 345 BDTExpiration Extension
How Expiration is Calculated
Migration Extends Expiration:
- Uses remaining days from old package
- Adds to current expiration
- Creates new expiration date
Example:
Current Expiration: Jan 30, 2025
Old Package: 30 days (10 used, 20 remaining)
New Package: 30 days
Calculation:
Start Date: Jan 30, 2025 (current expiration)
Add Remaining Days: 20 days
New Expiration: Feb 19, 2025Important Notes:
- Migration does NOT restart the billing cycle
- Uses remaining time from old package
- Extends from current expiration
- No time is lost
Custom Expiry Date
Not Allowed for Migration:
- Custom expiry date cannot be set
- System automatically calculates based on remaining days
- Cannot select date earlier than current expiration
Why:
- Migration is pro-rated billing
- Must use remaining days from old package
- Ensures fair billing
Payment Methods
Available Payment Methods
1. Cash - Physical cash payment 2. Bank - Bank transfer/deposit 3. Mobile Money - bKash, Nagad, Rocket, etc. 4. Subscriber Balance - Deduct from subscriber's prepaid balance 5. Online Gateway - Credit card, payment gateway
Payment Required
Scenario 1: Pay Difference
- Payment required
- Must pay net charge amount
- Can use any payment method
Scenario 2: Exact Match
- No payment required
- Invoice automatically marked PAID
- Credit covers full amount
Scenario 3: Get Refund
- No payment required
- Invoice automatically marked PAID
- Excess credit added to balance
Balance Requirements
For Prepaid Packages
Subscriber Balance Required:
If Net Charge > 0:
Subscriber Balance ≥ Net Charge
Example:
Net Charge: 333.33 BDT
Subscriber Balance: 500 BDT ✅
Subscriber Balance: 200 BDT ❌No Salesperson Balance Check
For Postpaid Packages
Scenario 1: Subscriber Has Balance
If Net Charge > 0:
Subscriber Balance ≥ Net Charge
→ Pay from subscriber balance
→ No salesperson balance needed
Example:
Net Charge: 333.33 BDT
Subscriber Balance: 500 BDT ✅
Salesperson Balance: Not checkedScenario 2: Subscriber No Balance
If Net Charge > 0:
Subscriber Balance < Net Charge
→ Salesperson Balance ≥ Net Charge
→ Cut salesperson balance
Example:
Net Charge: 333.33 BDT
Subscriber Balance: 100 BDT
Salesperson Balance: 500 BDT ✅
Salesperson Balance: 200 BDT ❌Admin Exception:
- Admin can migrate without balance check
- Unlimited migration power
For Zero Net Charge
No Balance Required:
- Scenario 2 (Exact Match): No payment, no balance check
- Scenario 3 (Get Refund): No payment, no balance check
- Credit covers everything
Validation Rules
1. Previous Invoice Required
Rule: Subscriber must have at least one invoice
Error: "Package Migration Is Only Available For Subscribers Who Have Already Activated A Package"
Solution: Activate subscriber first before migration
2. Invoice Status Check
Rule: Last invoice status must be valid
Valid Statuses:
- 1: Active
- 4: Paid
- 5: Partial Paid
- 6: Due
Error: "Last Invoice Status Is Not Allowed For Package Migration"
Solution: Check invoice status, resolve any issues
3. Custom Expiry Not Allowed
Rule: Cannot set custom expiry date for migration
Error: "You cannot select a date earlier than the current subscriber expiration date"
Why: Migration uses pro-rated billing with remaining days
4. Package Assignment Check
Rule: New package must be assigned to salesperson
Error: "No packages are assigned to your account"
Solution: Admin must assign package to salesperson first
5. Permission Check
Rule: Resellers can only migrate their own subscribers
Error: "You do not have permission to access this subscriber"
Solution: Only migrate subscribers assigned to you
6. Balance Validation
Rule: Must have sufficient balance (if net charge > 0)
Errors:
- "Insufficient Subscriber Balance"
- "Insufficient Salesperson Balance"
- "Insufficient Staff Accounting Balance"
Solution: Add balance before migration
7. Discount vs Profit Validation
Rule: Discount cannot exceed salesperson profit
Error: "Insufficient Profit Margin For Subscriber Discount"
Solution: Reduce discount or increase package price
Step-by-Step Process
Step 1: Access Migration Page
From Subscriber Profile:
- Go to subscriber profile
- Click "Migration" button
- Migration form opens
From Migration Menu:
- Go to Subscriber → Migration
- Search and select subscriber
- Migration form loads
Step 2: Select New Package
Package Selection:
- Choose from dropdown
- Only assigned packages appear
- System shows current package with (*)
System Calculates:
- Unused days from old package
- Unused credit amount
- New package price
- Net charge
Step 3: Review Calculation
System Shows:
Old Package Details:
- Package name and price
- Total days and used days
- Remaining days and hours
- Unused credit amount
New Package Details:
- Package name and price
- Pro-rated price
- Net charge amount
Expiration Details:
- Current expiration
- Start date
- New expiration
- Billing days and hours
Step 4: Choose Payment Method (if needed)
If Net Charge > 0:
- Select payment method
- Enter payment amount (auto-filled)
- Add payment note (optional)
If Net Charge = 0:
- No payment selection needed
- System handles automatically
If Net Charge < 0:
- No payment needed
- Excess credit added to balance
Step 5: Complete Migration
- Review all details
- Click "Migrate" button
- System processes migration
- Confirmation message appears
- Subscriber gets new package
Accounting & Profit Distribution
How Profit is Distributed
Proportional Profit Calculation:
Formula:
Proportional Percentage = (Net Charge / Full Package Price) × 100Example:
Full New Package Price: 1500 BDT
Net Charge: 833.33 BDT
Proportional Percentage: (833.33 / 1500) × 100 = 55.56%
Salesperson Profit: 200 BDT
Proportional Profit: 200 × 55.56% = 111.11 BDTWhy Proportional:
- Subscriber only pays 55.56% of package price
- Salesperson gets 55.56% of profit
- Fair distribution based on actual payment
Ledger Entries
For Scenario 1 (Pay Difference):
- Subscriber payment ledger (if paid)
- Salesperson balance cut (if postpaid)
- Salesperson profit ledger (proportional)
- Parent profit distribution (proportional)
For Scenario 2 (Exact Match):
- Credit payment ledger (0 amount)
- Salesperson profit ledger (proportional)
- Parent profit distribution (proportional)
For Scenario 3 (Get Refund):
- Excess credit ledger (add to balance)
- Credit payment ledger (0 amount)
- Salesperson profit ledger (proportional)
- Parent profit distribution (proportional)
Old Invoice Handling
Invoice Type Change:
Old Invoice Type: 1 (Active) or 4 (Paid)
After Migration: 3 (Migrated)Why:
- Prevents reuse of old invoice
- Marks as migrated for audit
- Links to new invoice
Common Use Cases
Use Case 1: Upgrade Package
Scenario:
Subscriber: john_doe
Current Package: Basic 5Mbps (1000 BDT/month)
Days Used: 10 days
Days Remaining: 20 days
Unused Credit: 666.67 BDT
New Package: Premium 10Mbps (1500 BDT/month)
Pro-Rated Price: 1000 BDT (for 20 days)
Net Charge: 1000 - 666.67 = 333.33 BDTProcess:
- Select Premium 10Mbps package
- System calculates net charge: 333.33 BDT
- Subscriber pays 333.33 BDT
- Old invoice marked as Migrated
- New invoice created for 333.33 BDT
- Speed upgraded to 10Mbps
- Expiration extended by 20 days
Result:
- ✅ Upgraded to faster package
- ✅ Paid only for difference
- ✅ No time lost
- ✅ Fair billing
Use Case 2: Downgrade Package
Scenario:
Subscriber: jane_smith
Current Package: Premium 10Mbps (1500 BDT/month)
Days Used: 5 days
Days Remaining: 25 days
Unused Credit: 1250 BDT
New Package: Basic 5Mbps (1000 BDT/month)
Pro-Rated Price: 833.33 BDT (for 25 days)
Net Charge: 833.33 - 1250 = -416.67 BDT
Excess Credit: 416.67 BDTProcess:
- Select Basic 5Mbps package
- System calculates excess credit: 416.67 BDT
- No payment needed
- Old invoice marked as Migrated
- New invoice created for 0 BDT (PAID)
- 416.67 BDT added to subscriber balance
- Speed changed to 5Mbps
- Expiration extended by 25 days
Result:
- ✅ Downgraded to cheaper package
- ✅ Got refund as balance credit
- ✅ No time lost
- ✅ Fair billing
Use Case 3: Promotional Package Change
Scenario:
Subscriber: bob_wilson
Current Package: Standard 8Mbps (1200 BDT/month)
Days Used: 15 days
Days Remaining: 15 days
Unused Credit: 600 BDT
New Package: Promo 8Mbps (600 BDT/month - 50% off)
Pro-Rated Price: 300 BDT (for 15 days)
Net Charge: 300 - 600 = -300 BDT
Excess Credit: 300 BDTProcess:
- Select Promo 8Mbps package
- System calculates excess credit: 300 BDT
- No payment needed
- Old invoice marked as Migrated
- New invoice created for 0 BDT (PAID)
- 300 BDT added to subscriber balance
- Package changed to Promo
- Expiration extended by 15 days
Result:
- ✅ Changed to promotional package
- ✅ Got refund as balance credit
- ✅ Same speed, lower price
- ✅ Customer retention
Best Practices
For Admins
1. Enable Migration for Flexibility
✅ Allow package changes anytime
✅ Improve customer satisfaction
✅ Reduce churn
✅ Fair billing2. Monitor Migration Patterns
✅ Track upgrade vs downgrade trends
✅ Identify popular packages
✅ Adjust pricing strategy
✅ Optimize package offerings3. Set Clear Policies
✅ Define migration rules
✅ Communicate to customers
✅ Train staff on process
✅ Document proceduresFor Resellers
1. Use Migration for Retention
✅ Offer upgrades to dissatisfied customers
✅ Provide downgrades to price-sensitive customers
✅ Use promotional packages
✅ Prevent cancellations2. Explain Pro-Rated Billing
✅ Show customers the calculation
✅ Explain unused credit
✅ Demonstrate fairness
✅ Build trust3. Maintain Sufficient Balance
✅ Check balance before migration
✅ Top up if needed
✅ Avoid migration failuresFor Subscribers
1. Understand Pro-Rated Billing
✅ You get credit for unused days
✅ Pay only the difference
✅ No time is lost
✅ Fair and transparent2. Choose Right Time to Migrate
✅ Migrate early in billing cycle for more credit
✅ Migrate late for less difference to pay
✅ Consider your needs3. Check Balance Before Migration
✅ Ensure sufficient balance
✅ Top up if needed
✅ Avoid migration failureSummary
Package Migration is a powerful pro-rated billing feature that:
✅ Three Scenarios:
- Pay Difference (upgrade)
- Exact Match (no payment)
- Get Refund (downgrade)
✅ Pro-Rated Billing:
- Credit for unused days
- Fair calculation
- No time lost
- Transparent pricing
✅ Automatic Calculation:
- Used vs remaining days
- Unused credit amount
- Net charge
- Proportional profit
✅ Flexible Payment:
- Pay difference if upgrading
- Get credit if downgrading
- No payment if exact match
✅ Seamless Transition:
- No service interruption
- Automatic expiration extension
- Radius updated
- Notifications sent
Key Benefits:
- Fair billing for customers
- Flexible package changes
- Customer retention
- Reduced churn
- Improved satisfaction
Perfect for ISPs wanting to offer flexible package changes with fair, transparent, pro-rated billing!
