Orders
Order List
Order Add
🧾 Order Management – ASTPP
This document outlines the logic for Order Placement, Renewals, and Email Notifications in ASTPP. The behavior respects the customer's timezone and applies to Packages, Subscriptions, and DID orders.
🗂️ Order Add Interface
Field | Description |
---|---|
Category | Dropdown selection. Default: Package |
Reseller | Displays a list of resellers. |
Accounts | Displays a list of accounts. |
Product | Lists all packages created by admin. |
Payment Method | The method is selected as Account Method by default. |
Name | The name of the selected package (non-editable). |
Commission | The commission associated with the package (non-editable). |
Billing Type | The billing type of the selected package (non-editable). |
Setup Fee | Setup fee of the selected package. |
Price | Recurring or one-time price of the package. |
Email Notification | Checkbox. If enabled, email alerts will be sent to the customer. |
📧 Email Notifications
✅ Order Placement Notification
If the Email Notification checkbox is enabled:
A confirmation email is sent once the order is successfully placed.
If disabled:
No order confirmation email is sent.
🔁 Order Renewal Notification
A renewal reminder email is sent 1 day before the renewal date.
The notification is sent only once per renewal cycle.
E.g., if a monthly recurring product renews on the 15th, the email is sent on the 14th.
These emails are triggered by the Manage Services cron job.
Once the email is sent, the order’s renewal notification status is marked as “Sent” to avoid duplicate emails.
🕒 Timezone-Based Renewal Logic
ASTPP should manage all orders (Package, Subscription, DID) based on the customer’s timezone.
⏰ Midnight Execution
Renewal and termination should occur at 12:00 AM or 11:59 PM, according to the customer’s timezone.
The Manage Services cron job should only process the renewal after 12:00 AM of the calculated date.
📘 Use Case Scenarios
📅 Case 1: Monthly Product
Order Date: 10-Oct-2024 5:00 PM (customer time)
Billing Type: Monthly
Renewal Date: 10-Nov-2024 at 12:00 AM (customer timezone)
🧾 Case 2: One-Time Product
Order Date: 10-Oct-2024 5:00 PM
Billing Days: 2
Termination Date: 11-Oct-2024 at 11:59 PM (customer timezone)
🔁 Case 3: Recurring Product
Order Date: 10-Oct-2024 5:00 PM
Billing Days: 15
Renewal Date: 25-Oct-2024 at 12:00 AM (customer timezone)
⭐ Special Case – Sync with Customer Billing
For Packages or DIDs with “Sync with Customer Billing” enabled:
The Renewal Date is aligned with the customer’s
end_invoice_date
.The
end_invoice_date
is also calculated based on the customer’s timezone.