Topic: CustName being posted in ref field in crm_persons table
To match the order of Nickname (ref), First Name (name), Last Name (name2) in the function that inserts and updates these fields in the crm_persons table, we need it to match the arguments order being passed on during it's invocations.
The function add_crm_persons() is defined in includes/db/crm_contacts_db.inc:
function add_crm_person($ref, $name, $name2,.....
but invoked in line 120 of sales/manage/customers.php by:
add_crm_person($_POST['CustName'], $_POST['cust_ref'], '', ......