Estimado Nicolas,
Espero que entiendes el ingles, para que todos puendan aprovechar de los mensajes ! sino, google es tu amigo
From what I understood, on postpaid billing...
You need to create the customer wit the type postpaid AND set a credit limit (not the notification, just the credit limit - has to be a positive value). You also set the initial balance to 0.
Then, the customer will make calls. When setting up the call with A*, A2B will pass in the Dial command the maximum time allowed for the destination - ie.. (credit limit - balance) / rate = max time - A* will cut the call if this time is reached. So, as your customer makes calls, his balance deepens in negative values until it reaches "-credit limit" - I would assume if you allow simultaneous access, that you can exceed this limit, so be careful there. Going into realtime update of the balance (vs when hooking up the call) is a lot of work & cpu.
Then, once a month, you run the billing script - either through cron, or manually: php a2billing_batch_billing.php - it will process all customers that have a billing day equal to the current day. You may want to look at this script... For customers that have a negative credit, it will:
- generate a receipt - I havent figured out the use
- generate an invoice, with one item, equal to the absolute value of the balance of the customer
- create / update an entry in cc_billing_customer to log the date of the billrun, for next month
done - simple...
then, you need to inform / mail your customers that their bill is ready. They go online and check via the customer UI the invoice, & call details.
At this point, though the invoice is generated, the balance is not reset - your risk is still there!
from there... not as sure....
You collect the money... then create a payment (billing/payment/add payment), and associate a refill with it... your customer balance will be increased by the payment. Alternatively, you can refill manually, without the payment...if you like risking your $$$.
Then, you need to assign the payment to the invoice, and update the status of the invoice (invoice / $$$icon ).
Please, look at a couple of bugs I've reported, and that I dont believe are fixed - I have no clue on how trac works... and didnt get really any answer on these !
Anyone willing to correct this post is welcome !
Attentamente,
Jean