smadmin
smadmin is responsible for keeping a summary of usages each month, deleting old or duplicate entries in certain tables and determining which topups are still available for use for each new month. smadmin must be set up to run monthly, on the first day of the new month (crontab).
# Usage: ./smadmin [args] --config=/path/file Configuration file --debug Put into debug mode --cleanup Cleanup database records
Several modules have functions that smadmin calls.
mod_config_sql_topups.pm
Topups that have been depleted are marked so. Partially used topups, if they are still valid, are added to the topups_summary table.
mod_accounting_sql.pm
A sum of all records from the previous month are added to the accounting_summary table with a period key in datetime format.