BillRun billing can run the cycle directly from the UI. We recommend to use the GUI instead of the CLI.
If you want to use the CLI, please use the next instructions. This is good practice for billing cycle automation.
Running the bill run will sum up each account usage and will create a DB object with the account balance for the billing cycle date and create all the related discounts, flats, credits and services lines in the DB.
- env : The configuration file to load to match a given running environment test (testing)/dev (development)/prod (production)/int(internal).
- aggregate : The actual action that should be done in this operation in this case should be aggregate in order to run the BillRun aggregator.
- type : the type of aggregation to be done in this case should be customer for regular billing aggregation of customers.
- stamp : should be the billing cycle month key parsed as YYYYMM for example:
- For a billing cycle from 01/12/2014 to 01/01/2015 it should be 201501
- size : The amount of accounts to aggregate.
- page : The page offset to run (starting from zero).
- force_accounts: A comma-separated list of customer IDs to aggregate (optional. Note this parameter is specific to the aggregation command and should not be prefixed with “--” )
¶ Running command
php -t <billrun_dir_path> <billrun_dir_path>/public/index.php --env <env> --aggregate --type customer --stamp <YYYYmm> --page <PAGE> --size <SIZE>
php -t <billrundirpath> <billrundirpath>/public/index.php --env <env> --aggregate --type customer --stamp <YYYYmm> --page <PAGE> --size <SIZE> force_accounts=50271,50273
This process generates the pdf/ps files that will be used for invoices (either online or printed) it saves the pdf under : <BillRun root directory>/files/invoices
- env : The configuration file to load to match a given running environment test (testing)/dev (development)/prod (production)/int(internal).
- generate : The actual action that should be done in this operation in this case should be generate in order to run the invoice generator action.
- type : the type of generation to be done in this case should be invoice_export in order to create the invoice pdf/postscript files.
- stamp : should be the billing cycle month key parsed as YYYYMM for example:
- To generate invoices for a billing cycle from 01/12/2014 to 01/01/2015 it should be 201501
¶ Running command
php -t <billrun_dir_path> <billrun_dir_path>/public/index.php --env <env> --generate --type WkPdf --stamp <YYYYmm>
This process generates bill entries using the invoices (billrun collection) and inserts them to the bills collection. This action actually confirms invoices and it is irreversible.
- env : The configuration file to load to match a given running environment test (testing)/dev (development)/prod (production)/int(internal).
- generate : The actual action that should be done in this operation in this case should be generate in order to run the invoice generator action.
- type : the type of generation to be done in this case should be billrunToBill in order to generate the bills from the billrun (invoices) entries
- stamp : should be the billing cycle month key parsed as YYYYMM for example:
- To generate bills from all the invoices of 01/12/2014 to 01/01/2015 billing run it should be 201501
- invoices: A comma-separated list of invoices IDs to confirm (optional. Note this parameter is specific to the confirmation command and should not be prefixed with “--” )
¶ Running command
php -t <billrun_dir_path> <billrun_dir_path>/public/index.php --env <env> --generate --type billrunToBill --stamp <YYYYmm>
php -t <billrun_dir_path> <billrun_dir_path>/public/index.php --env <env> --generate --type billrunToBill --stamp <YYYYmm> invoices=400290834466,400290834467