Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Mar 29, 2024 9:39 am
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Handling of customer history
PostPosted: Wed Aug 01, 2012 3:41 am 
Offline

Joined: Mon Jan 18, 2010 11:50 pm
Posts: 24
There is what I would perceive is a bug in a2billing where when you delete the customer history it deletes based on the description and not the ID in the cc_card_history table. I'm pretty sure that it relates to this chunk of code in admin/Public/form_data/FG_var_card.inc


$HD_Form -> AddEditElement (gettext("CUSTOMER HISTORY"),
"description",
'$value',
"HAS_MANY",
"multiline",
"",
"",
"",
"",
"",
"", "", "", "", "", "cc_card_history:description:description,id_cc_card,datecreated:id_cc_card = %id::id_cc_card::2:::::0");

// cc_card_history:description:description,id_cc_card:id_cc_card = %id::id_cc_card
// Above function will provid Has Many functionality
// Each parameter is seperated by (:) notation
// 0. HAS_MANY will allow to get one to many functionality
// 1. First param is the table name
// 2. Second param is the join condition coloumn
// 3. Third will get all the columns (but first should be joining column)
// 4. Fourth param generates the where cluase
// 5. Last, Sixth param is the FK column

I'm not 100% sure what to change so that the id of the record in cc_call_history is used as the key and not the description. I tried changing the last parameter to:
cc_card_history:description:id,description,id_cc_card,datecreated:id_cc_card = %id::id_cc_card::3:::::1"
but that didn't seem to work. Any assistance would be greatly appreciated.

Thanks.


Top
 Profile  
 
 Post subject: Re: Handling of customer history
PostPosted: Wed Jul 03, 2013 2:00 pm 
Offline

Joined: Wed Jul 03, 2013 1:49 pm
Posts: 1
./admin/Public/form_data/FG_var_card.inc
Code:
@line 952 (approx)
change to this:
$HD_Form -> AddEditElement (gettext("CUSTOMER HISTORY"),
                                   "description",
                                   '$value',
                                   "HAS_MANY",
                                   "multiline",
                                   "",
                                   "",
                                   "",
                                   "",
                                   "",
                                   "", "", "", "", "", "cc_card_history:description:description,id_cc_card,datecreated,***id***:id_cc_card = %id::id_cc_card::2:::::0");
// basically add id at the end of retrieved fields. you will use this ID later to delete based on it (no asteriscs of course)


in ./common/lib/Form/Class.FormHandler.EditForm.inc.php
Code:
@line 593 (approx)
change $split_select_list[$j][0] to $split_select_list[$j][3]
// these are indexes of the fields retrieved. if you parse retrieved fields by comma you get
// 0 - description
// 1 - id_cc_card
// 2 - date_created
// 3 - id (the one we added in FG_var_card.inc)


in ./common/lib/Form/Class.FormHandler.inc.php
Code:
@line 1865 (approx). immedately after $SPLIT_FG_DELETE_CLAUSE = ...; and before $instance_sub_table -> ...;
// insert this code
if($this->FG_TABLE_EDITION[$sub_action][0] == 'CUSTOMER HISTORY'){
        $SPLIT_FG_DELETE_CLAUSE = "id='".$value."'";
}
// what this does is it checks if we are deleting customer history entry and if so then we replace the delete clause with a simpler one because we know value is an id


tested and used in production by me


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 
Auto Dialer Software


All times are UTC


Who is online

Users browsing this forum: No registered users and 15 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group