Star2Billing / a2billing

A2Billing is a telecom switch and billing system capable of providing and billing a range of telecom products and services to customers such as calling card products, residential and wholesale VoIP termination, DID resale and callback services.
www.asterisk2billing.org
Other
181 stars 174 forks source link

service fee charge problems #51

Open outoftheboxx opened 11 years ago

outoftheboxx commented 11 years ago

Looks like 2 bugs..

1 Bug that can exclude some accounts from being charged due to race conditions

Change Cronjobs/a2billing_batch_process.php

    // RULES
    if ($rule == 3) {
            $filter .= " -- card last run date <= period
                         (remove line)   AND UNIX_TIMESTAMP(servicelastrun) <= UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - $oneday * $period \n";
                         (fixed line)       AND UNIX_TIMESTAMP(servicelastrun) <= UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - $oneday * $period + $time_checks *60 \n";
    }

For list of services all is fine.

2 Unable to charge account from more then 1 service fee - servicelastrun is updated by the first applicable Service Fee entry (with biggest id). So for the 2nd service fee this account has already paid for this period of time.

Seems that overall scheme is not compatible with multiple service fee.