add_crm_person($_POST['CustName'], $_POST['cust_ref'], '', $_POST['address'],
$_POST['phone'], $_POST['phone2'], $_POST['fax'], $_POST['email'], '', '');
- add_crm_contact('cust_branch', 'general', $selected_branch, db_insert_id());
+ $pers_id = db_insert_id();
+ add_crm_contact('cust_branch', 'general', $selected_branch, $pers_id);
- add_crm_contact('customer', 'general', $selected_id, db_insert_id());
+ add_crm_contact('customer', 'general', $selected_id, $pers_id);
}
commit_transaction();