[Spce-user] billing free time
Joan Cifre (ibred)
jcifre at ib-red.com
Wed Nov 21 10:13:06 EST 2012
ok I understand now.
Two more easy questions
- The Free time is per account, or per subscriber? I have all my
customers in the same account, so I would need ir per subscriber
- After I unlink and then link again the billing profile from the
account, should work well? Any undesired effects?
Thanks for all and sorry for so many questions.
El 21/11/2012 13:52, Daniel Tiefnig escribió:
> On 11/20/2012 08:39 PM, Joan Cifre (ibred) wrote:
>> then I can't explain why I have a subscriber created since May, and
>> with all the calls with the charge not zero, during all months.
> as I've written in one of my e-mails, the interval change for the
> accounts may not be calculated correctly if you change the billing
> profile settings while it is assigned to these VoIP accounts.
> Just checked the source and the problem indeed is that the free time
> contingent is - simplified - only calculated based on the VoIP account's
> current balance and used free time in the last billing interval like
> follows: (ftb = free time balance)
> new-ftb = old-ftb + old-ftb-used
> So the change in the billing profile is not propagated to the VoIP
> account balance. This certainly is an annoyance if you need to change
> your billing profiles after you've already assigned accounts to it. The
> whole billing stuff is subject for significant change and improvement
> for 3.0, which will be released in spring next year. In the meantime
> this is something we'll have to cope with.
> If you've not added aditional free time to the accounts, you can
> manually fix the current balance of existing accounts in the database by
> running the following query:
> UPDATE contract_balances cb
> INNER JOIN contracts c ON c.id = cb.contract_id
> INNER JOIN billing_mappings bm ON bm.contract_id = c.id
> INNER JOIN billing_profiles bp ON bp.id = bm.billing_profile_id
> SET cb.free_time_balance =
> bp.interval_free_time - cb.free_time_balance_interval
> WHERE c.create_timestamp < cb.start
> AND c.terminate_timestamp IS NULL
> AND (bm.start_date < cb.start OR bm.start_date IS NULL)
> AND (bm.end_date > now() OR bm.end_date IS NULL)
> AND cb.start = '2012-11-01 00:00:00';
> Spce-user mailing list
> Spce-user at lists.sipwise.com
More information about the Spce-user