Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 16, 2024 7:12 am
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Charging for mthly DID bills customer for all DID's FIXED
PostPosted: Wed Jan 02, 2008 10:48 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
If I setup an monthly charge for DID use, customer is billed for every DID on system.

Not good! :cry:

If someone can give me a clue as to where this is actioned I'll attempt to fix it. My guess it's another missing where clause

regards


Last edited by middletn on Fri Jan 04, 2008 11:21 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 02, 2008 10:51 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Really?!?
This hadn't been reported to me as a problem before, and I've got a couple of customers running DIDs for a few months now.
I receive an email once a month from the DID cron job telling me how many accounts had balance deducted. The DID Billing view confirms exactly what was deducted from each card, and all seems to be in order there too.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 02, 2008 11:05 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
This isn't in the DID billing, but in the billing menu, add charge menu.

I have a situation where I have customers with international DID's which I need to bill for. Adding a charge here causes a real problem, believe me. I've just spent an hour removing these entries from the database.

It only happens on DID monthly charge. All the other types are fine
regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 02, 2008 11:29 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I think most of the code is in form_data/FG_var_charge.inc

Added after 8 minutes:

Yes, I think your initial guess was spot on. The clause to match the username is only invoked if the variable $filterprefix is not null. I can't find where $filterprefix might be defined.

Added after 6 minutes:

Actually $filter_prefix should be set by the framework when the cardnumber field is populated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 03, 2008 10:47 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I'm getting there. I firmly believe it's in the SQL of the invoice forms.

There's a problem with this select. For 1 row in the table it returns 16 in the query result

SELECT t1.amount, t1.creationdate, t1.description, t3.countryname, t2.did, t1.currency FROM cc_charge t1 LEFT JOIN (cc_did t2, cc_country t3 ) ON ( t1.id_cc_did = t2.id AND t2.id_cc_country = t3.id ) WHERE (t1.chargetype = 1 OR t1.chargetype = 2) AND t1.id_cc_card = 1;

DB entry seems fine

Update

I've re-written the query and it now works as expected.

Quote:
$QUERY = "SELECT t1.amount, t1.creationdate, t1.description, t3.countryname, t2.did, t1.currency " .
" FROM cc_charge t1 " .
" LEFT JOIN cc_did t2 " .
" ON t1.id_cc_did = t2.id " .
" LEFT JOIN cc_country t3 " .
" ON t2.id_cc_country = t3.id " .
" WHERE (t1.chargetype = 1 OR t1.chargetype = 2) " .
" AND t1.id_cc_card = ".$customerID.
" AND t1.creationdate >(Select CASE WHEN max(cover_enddate) IS NULL THEN '0001-01-01 01:00:00' ELSE max(cover_enddate) END from cc_invoices)";


I'll update the others and post fix to trac


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 23, 2008 4:08 pm 
Offline

Joined: Thu Sep 13, 2007 12:46 pm
Posts: 254
Location: Naples, Fl ( USA )
middletn wrote:
There's a problem with this select. For 1 row in the table it returns 16 in the query result

SELECT t1.amount, t1.creationdate, t1.description, t3.countryname, t2.did, t1.currency FROM cc_charge t1 LEFT JOIN (cc_did t2, cc_country t3 ) ON ( t1.id_cc_did = t2.id AND t2.id_cc_country = t3.id ) WHERE (t1.chargetype = 1 OR t1.chargetype = 2) AND t1.id_cc_card = 1;


I fix the problem on my box by changing LEFT to INNER. Example:

graher01 wrote:

SELECT t1.amount, t1.creationdate, t1.description, t3.countryname, t2.did, t1.currency FROM cc_charge t1 INNER JOIN (cc_did t2, cc_country t3 ) ON ( t1.id_cc_did = t2.id AND t2.id_cc_country = t3.id ) WHERE (t1.chargetype = 1 OR t1.chargetype = 2) AND t1.id_cc_card = 1;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group