Create OCS Invoice
The Create OCS Invoice process in the OCS.io enables the generation and creation of invoices for customer accounts. This process involves gathering the relevant billing data, including products or services consumed, pricing information, and applicable taxes or discounts. The system applies the necessary calculations to generate a comprehensive and accurate invoice.
Pre-Conditions
-
Bill Cycle must be configured
-
Bill Cycle Run must be in proper state
-
Account
-
Account Bill Cycle Run
-
Document Type must be configured
-
Document Source must be configured
-
Document Preferences must be configured
-
Document Number Series must be configured
Calculate Invoice for Payment Responsible Account
Step | Actor | Action | Description |
---|---|---|---|
1. |
Billing Server |
Validate |
Ensures the input data or conditions required for the process are valid. |
2. |
Billing Server |
Set Defaults |
Sets default values for the invoice creation process. |
3. |
Billing Server |
Call Calculate Account |
Calls the "Calculate Account" process for the payment responsible account. |
4. |
Billing Server |
Call Calculate Account for Subordinate Accounts |
Calls the "Calculate Account" process for each subordinate account associated with the payment responsible account. |
5. |
Billing Server |
Apply Billing Discounts on Invoice |
Applies applicable absolute or percentage discounts to the calculated charges on the invoice level if the account is the payment responsible. |
6. |
Billing Server |
Apply Billing Fees on Invoice |
Includes any additional charges or fees in the calculated charges on the invoice level if the account is the payment responsible. |
7. |
Billing Server |
Calculate Totals |
Calculates the total charges, discounts, fees, and taxes for the invoice. |
8. |
Billing Server |
Calculate Rounding (Compensation) |
Calculates any rounding adjustments or compensations for the invoice. |
9. |
Billing Server |
Determine Tax Exemption |
Determines if the invoice is eligible for tax exemption based on specific criteria. |
10. |
Billing Server |
Calculate Tax Summary |
Calculates the tax summary for the invoice, including tax amounts and rates. |
11. |
Billing Server |
Check Negative Amount |
Checks if the invoice has a negative amount and handles it appropriately. |
12. |
Billing Server |
Store Invoice |
Stores the invoice in the system. |
13. |
Billing Server |
Store Tax Summary (InvoiceSummaryEvent) |
Stores the tax summary information for the invoice. |
14. |
Billing Server |
Store Aggregations on Subscriber, Account, Invoice level |
Stores the aggregations of charges, discounts, fees, and taxes at the subscriber, account, and invoice levels. |
15. |
Billing Server |
Store Rounding (Compensation) |
Stores the rounding adjustments or compensations for the invoice. |
16. |
Billing Server |
Store New/Updated Chargeable Events |
Stores any new or updated chargeable events related to the invoice. |
Validations
-
accountSemaphore == WAITING
-
paymentResponsible
-
activation date (activationDate < bc.endDate)
-
deactivation date (deactivationDate > bc.startDate)
tax exemption
-
on account level
-
on offer level ()
finish invoice
-
check negative amount
-
store invoice (Invoice)
-
store tax summary (InvoiceSummaryEvent)
-
store aggregated on Subscriber level (InvoiceSummaryEvent)
-
store aggregated on Account level (InvoiceSummaryEvent)
-
store aggregated on Invoice level (InvoiceSummaryEvent)
-
store compensation (InvoiceSummaryEvent)
-
store new/updated Chargeable Events (ChargeableEvent)
Calculate Account
Step | Actor | Action | Description |
---|---|---|---|
1. |
Billing Server |
Validate |
Ensures the input data or conditions required for the process are valid. |
2. |
Billing Server |
Call Calculate Subscriber |
Calls the "Calculate Subscriber" process for each subscriber associated with the account. |
3. |
Billing Server |
Apply Pro-Rate |
Determines the duration of time for which the account is active and will be billed. |
4. |
Billing Server |
Call Calculate Offer Subscription on Account |
Calls the "Calculate Subscription" process for each offer subscription associated with the account. |
5. |
Billing Server |
Process Events on Account |
Includes the chargeable and aggregated events for one-time fees that are not associated with any subscription on the account. |
6. |
Billing Server |
Summarize Account |
Calculates the total charges for the account based on the calculated charges for account and for sub-ordinate subscribers and offer subscriptions. |
7. |
Billing Server |
Apply Billing Discounts on Account |
Applies applicable absolute or percentage discounts to the calculated charges on the account level. |
8. |
Billing Server |
Apply Billing Fees on Account |
Includes any additional charges or fees in the calculated charges on the account level. |
Validate
-
activation date (activationDate < bc.endDate)
-
deactivation date (deactivationDate > bc.startDate)
Apply Pro-Rate
-
Lifecycle Stage History: Retrieve the lifecycle stage history of the account.
-
Chargeable Period Calculation: Compute the ratio between the duration of the chargeable period and the length of the billing cycle.
-
State Eligibility: Determine state eligibility for charges based on the associated State Reason.
-
Same-Day Changes: Account for changes occurring within the same day, excluding states like Suspension if the account is re-activated on the same day.
Process Events on Account
-
Chargeable Events: Collect and process chargeable events, which include one-time fees and specific transactions at the account level.
-
Aggregated Events: Collect and process aggregated events, providing a high-level overview of related activities.
Summarize Account
-
Charge Aggregation: Summarize all charges at the account level based on Charging Class classification.
-
Summary Utilization: Use these summaries as the foundation for applying fees or discounts in subsequent steps.
Apply Billing Discounts on Account
-
Priority-Based Implementation: Apply discounts based on their designated priority level.
-
Order of Application: Apply discounts in a hierarchical order if multiple discounts share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for absolute billing discounts, applying a fraction of the discount based on the account’s chargeable duration.
Apply Billing Fees on Account
-
Priority-Based Implementation: Apply fees based on their designated priority level.
-
Order of Application: Apply fees in a hierarchical order if multiple fees share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for fees like Minimal Commitment or Maximal Spent, applying a fraction of the fee based on the account’s chargeable duration.
Calculate Subscriber
Step | Actor | Action | Description |
---|---|---|---|
1. |
Billing Server |
Validate |
Ensures the input data or conditions required for the process are valid. |
2. |
Billing Server |
Apply Pro-Rate |
Determines the duration of time for which the subscriber is active and will be billed. |
3. |
Billing Server |
Call Calculate Offer Subscription on Subscriber |
Calls the "Calculate Offer Subscription" process for each offer subscription associated with the subscriber. |
4. |
Billing Server |
Process Events on Subscriber |
Includes the chargeable and aggregated events for one-time fees that are not associated with any offer subscription on the subscriber. |
5. |
Billing Server |
Summarize Subscriber |
Calculates the total charges for the subscriber based on the calculated charges for the subscriber and for the offer subscriptions. |
6. |
Billing Server |
Apply Billing Discounts on Subscriber |
Applies applicable absolute or percentage discounts to the calculated charges on the subscriber level. |
7. |
Billing Server |
Apply Billing Fees on Subscriber |
Includes any additional charges or fees in the calculated charges on the subscriber level. |
Validate
-
activation date (activationDate < bc.endDate)
-
deactivation date (deactivationDate > bc.startDate)
Apply Pro-Rate
-
Lifecycle Stage History: Retrieve the lifecycle stage history of the subscriber.
-
Chargeable Period Calculation: Compute the ratio between the duration of the chargeable period and the length of the billing cycle.
-
State Eligibility: Determine state eligibility for charges based on the associated State Reason.
-
Same-Day Changes: Account for changes occurring within the same day, excluding states like Suspension if the subscriber is re-activated on the same day.
Process Events on Subscriber
-
Chargeable Events: Collect and process chargeable events, which include one-time fees and specific transactions at the subscriber level.
-
Aggregated Events: Collect and process aggregated events, providing a high-level overview of related activities.
Summarize Subscriber
-
Charge Aggregation: Summarize all charges at the subscriber level based on Charging Class classification.
-
Summary Utilization: Use these summaries as the foundation for applying fees or discounts in subsequent steps.
Apply Billing Discounts on Subscriber
-
Priority-Based Implementation: Apply discounts based on their designated priority level.
-
Order of Application: Apply discounts in a hierarchical order if multiple discounts share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for absolute billing discounts, applying a fraction of the discount based on the subscriber’s chargeable duration.
Apply Billing Fees on Subscriber
-
Priority-Based Implementation: Apply fees based on their designated priority level.
-
Order of Application: Apply fees in a hierarchical order if multiple fees share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for fees like Minimal Commitment or Maximal Spent, applying a fraction of the fee based on the subscriber’s chargeable duration.
Calculate Offer Subscription
Step | Actor | Action | Description |
---|---|---|---|
1. |
Billing Server |
Validate |
Ensures the input data or conditions required for the process are valid. |
2. |
Billing Server |
Calculate Active Millis |
Determines the duration of time for which the offer subscription is active and therefore will be billed. |
3. |
Billing Server |
Include Chargeable Events on Offer Subscription |
Includes the chargeable events registered on the offer subscription level. Pro-rate calculations may be performed in case the offer subscription changes its state during the period. |
4. |
Billing Server |
Include Aggregated Events on Offer Subscription |
Includes the aggregated events registered on the offer subscription level. No pro-rate calculations are performed. |
5. |
Billing Server |
Summarize Offer Subscription |
Calculates the total charges for the offer subscription based on the calculated charges, discounts, and fees. |
6. |
Billing Server |
Calculate Billing Discounts on Offer Subscription |
Applies applicable absolute or percentage discounts to the calculated charges on the offer subscription level. |
7. |
Billing Server |
Calculate Billing Fees on Offer Subscription |
Includes any additional charges or fees in the calculated charges on the offer subscription level. |
8. |
Billing Server |
Aggregate on Offer Subscription Level |
Aggregates the calculated charges, discounts, and fees to store the final billing information for the offer subscription. |
Validate
-
activation date (activationDate < bc.endDate)
-
deactivation date (deactivationDate > bc.startDate)
Apply Pro-Rate
-
Lifecycle Stage History: Retrieve the lifecycle stage history of the subscription.
-
Chargeable Period Calculation: Compute the ratio between the duration of the chargeable period and the length of the billing cycle.
-
State Eligibility: Determine state eligibility for charges based on the associated State Reason.
-
Same-Day Changes: Account for changes occurring within the same day, excluding states like Suspension if the subscription is re-activated on the same day.
Process Events on Subscription
-
Chargeable Events: Collect and process chargeable events, which include one-time fees and specific transactions at the subscription level.
-
Aggregated Events: Collect and process aggregated events, providing a high-level overview of related activities.
Summarize Subscription
-
Charge Aggregation: Summarize all charges at the subscription level based on Charging Class classification.
-
Summary Utilization: Use these summaries as the foundation for applying fees or discounts in subsequent steps.
Apply Billing Discounts on Subscription
-
Priority-Based Implementation: Apply discounts based on their designated priority level.
-
Order of Application: Apply discounts in a hierarchical order if multiple discounts share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for absolute billing discounts, applying a fraction of the discount based on the subscription’s chargeable duration.
Apply Billing Fees on Subscription
-
Priority-Based Implementation: Apply fees based on their designated priority level.
-
Order of Application: Apply fees in a hierarchical order if multiple fees share the same priority.
-
Pro-Rate Consideration: Incorporate pro-rate calculations for fees like Minimal Commitment or Maximal Spent, applying a fraction of the fee based on the subscription’s chargeable duration.