When automatic creating a branch the contact is also created on the customer (Rerun).
authorJoe <unknown>
Mon, 14 Oct 2013 09:15:51 +0000 (11:15 +0200)
committerJoe <unknown>
Mon, 14 Oct 2013 09:15:51 +0000 (11:15 +0200)
sales/manage/customers.php

index c66649676dd75e9db09961be893e6857ec5c7989..93768344ec214fa20eec1d5bf4d0c56c3fe3478c 100644 (file)
@@ -120,9 +120,10 @@ function handle_submit(&$selected_id)
                        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();