1 Running Billing Scripts
Learn how to run the Oracle Communications Billing and Revenue Management (BRM) billing utilities.
For an overview of the BRM billing process, see "Overview of Billing" in BRM Concepts.
Topics in this document:
Note:
Before running billing, you must set the billing configuration defaults, as described in "Configuring Billing".
Running the Billing Scripts
Billing scripts run one or more billing utilities on a daily, weekly, or monthly basis. By default, billing scripts are located in BRM_home/bin.
You can customize the scripts.
Note the following:
-
Use billing scripts for regular bills only, not for corrective bills.
-
Run billing as pin_user, not as root. Running billing as pin_user provides the read and write permissions for billing.
-
Since billing generates a lot of system activity, it's best to run billing scripts at night.
-
Use a different time for all three scripts so you do not run billing utilities simultaneously.
-
Check for billing errors daily. The log file for the billing utilities is pin_billd.pinlog.
To run the billing scripts, use a cron job with a crontab entry.
-
The following crontab entry runs pin_bill_day at 1:00 a.m. daily:
0 1 * * * BRM_home/bin/pin_bill_day &
-
The following crontab entry runs pin_bill_week every Sunday at 12:05 a.m.
5 0 * * 0 BRM_home/bin/pin_bill_week &
Note:
By default, the pin_bill_week script runs the pin_collect utility with the utility's end parameter set to 7. If you modify the script to run the utility with the end parameter set to 1 or 0, do not run the script at the same time that you run the pin_bill_day script. If you do, accounts whose payment collection date is on the day or the day before the utility runs may be double charged. -
The following crontab entry runs pin_bill_month at 12:05 a.m. on the first day of the month:
5 0 1 * * BRM_home/bin/pin_bill_month &
Table 1-1 shows the billing utilities in each script.
Table 1-1 Utilities in Billing Scripts
Billing Script | Description |
---|---|
pin_bill_day |
Run daily. Runs the following billing utilities:
|
pin_bill_week |
Run weekly. Runs the pin_collect utility with the -rebill option on all active accounts with a payment collection date of at least 8 days old. Collects outstanding balances from active credit card or direct debit accounts that could not be collected during regular daily billing. For example, a daily billing run might return a soft decline on a BRM-initiated payment. In that case, the payment is not collected, but the bill is left open so that the pin_collect utility can attempt to collect the payment again when you run the pin_bill_week script. |
pin_bill_month |
Run monthly. Runs the pin_collect utility with the -rebill option on all closed and inactive accounts with a payment collection date that is at least 31 days old. Collects outstanding balances from closed or inactive accounts. |
Changing the Path in the Billing Scripts
You can change the path to the billing utilities in the billing scripts. For example, to change the path for the pin_bill_day script, edit these lines:
PINDIR=/opt/portal/${VERSION} CNFDIR=${PINDIR}/apps/pin_billd NVDIR=${PINDIR}/apps/pin_inv OGDIR=/var/portal/${VERSION}/pin_billd PATH=/usr/bin:/bin:${PINDIR}/bin cd ${CNFDIR}
Running the pin_bill_day Script for Bill Run Management
You must run the pin_bill_day script manually instead of automatically to do the following:
-
Reduce the load and duration of a large daily billing run. See "Configuring a Split Billing Run".
-
Add days to the due dates of bills in a daily billing run at run-time. See "Specifying Due Date Adjustments in a Billing Run".
When running pin_bill_day manually with bill run management, use this syntax:
pin_bill_day -file file_name
Where file_name is the name and location of a billing run configuration file.
The -file parameter when used with pin_bill_day, affects only the pin_bill_accts utility.
Note:
When you use a cron job to run pin_bill_day, do not include the configuration file name. If you do, some bill units might never be billed.
Handling Billing Failures
Billing can fail in the following cases:
-
When an internal BRM component, such as a CM or DM, goes offline.
-
When the online payment processor goes offline.
-
When a connection between BRM components is broken.
If the pin_collect utility or the pin_deposit utility is interrupted while it is in progress, you can run it again. However, you might need to resolve failed BRM-initiated payment transactions. See "Resolving Failed BRM-Initiated Payment Transactions" in BRM Configuring and Collecting Payments.
All other billing utilities, pin_cycle_fees, pin_deferred_act, pin_inv_accts, and pin_bill_accts, can be run again. You do not need to resolve failed transactions.
If the billing utilities were not run at all, for example, if the database was offline, you could run all of the billing utilities with no problems. The pin_bill_accts utility bills all accounts that are due for billing, not just those that are due on the day that you run the utility.
The pin_collect and pin_inv_accts utilities act on accounts that were billed by the pin_bill_accts utility, so if you run the pin_bill_accts utility first, payments for all accounts that are due are collected or invoiced.