Skip to content

Commit

Permalink
Merge Customers utility script sql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apmuthu committed Sep 28, 2017
1 parent ec0ca26 commit c286f59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions FA24Mods/CHANGELOG_FA24Mods.txt
@@ -1,5 +1,6 @@
Files in this folder overwrite their counterparts in the core to effect the mods by Ap.Muthu.

2017-09-28 Merge Customers utility script sql fixes
2017-09-21 Merge Customers utility script updated
2017-09-17 New sys_prefs parameter **shortname_name_in_list** provisioned in charts as in upstream code
2017-09-17 Merge Customers utility script added but switched off since rarely needed
Expand Down
6 changes: 3 additions & 3 deletions FA24Mods/sales/merge_customers.php
Expand Up @@ -53,13 +53,13 @@
$sql = "DELETE FROM ".TB_PREF."cust_branch WHERE debtor_no = $deletecustomer";
db_query($sql, "An error occured");

$sql = "DELETE FROM ".TB_PREF."crm_contacts WHERE type = 'customer' AND entity_id = $deletecustomer";
$sql = "DELETE FROM ".TB_PREF."crm_contacts WHERE `type` = 'customer' AND entity_id = $deletecustomer";
db_query($sql, "An error occured");

$sql = "DELETE FROM ".TB_PREF."crm_contacts WHERE type = 'cust_branch' AND entity_id = (SELECT branch_code FROM ".TB_PREF."cust_branch WHERE debtor_no = $deletecustomer)";
$sql = "DELETE FROM ".TB_PREF."crm_contacts WHERE `type` = 'cust_branch' AND entity_id = (SELECT branch_code FROM ".TB_PREF."cust_branch WHERE debtor_no = $deletecustomer)";
db_query($sql, "An error occured");

$sql = "DELETE FROM ".TB_PREF."crm_persons WHERE type = 'customer' AND id = (SELECT person_id from ".TB_PREF."crm_contacts WHERE type = 'customer' AND entity_id = $deletecustomer LIMIT 1)";
$sql = "DELETE FROM ".TB_PREF."crm_persons WHERE id = (SELECT person_id from ".TB_PREF."crm_contacts WHERE `type` = 'customer' AND entity_id = $deletecustomer LIMIT 1)";
db_query($sql, "An error occured");

header("Location: ..");
Expand Down

0 comments on commit c286f59

Please sign in to comment.