HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /www/exchange2/sql/archive/2016-09-02-TT376.sql
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-3-4",1,8,1,3,1750,NULL,NULL,NULL,"Paid twice and money sent twice so should be on the statement as a partial redemption -  Patrick",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
   status=1,
   authorised_by=1,
   authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
change_id=813,
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id;
    
UPDATE `investor_investments` SET `public_comment`='Coupon paid on 2015-02-26' WHERE  `investment_id`=32;

UPDATE `investor_investments` SET `removed_at`='2016-09-02 13:56:08', `removed_by`=1, `remove_comment`='Remove renewal; Calculate Full Redemption as if it happened on the maturity date.  - Przemek' WHERE  `investment_id`=39;
UPDATE `investor_investments` SET `status`=2 WHERE  `investment_id`=39;
UPDATE `investor_investments` SET `amount`=27013.95 WHERE  `investment_id`=40;


UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-02 14:16:41', `removed_by`=1, `remove_comment`='Removed as part of audit check', `is_latest`=0 WHERE  `investment_id`=52;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-02 14:17:41', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=51;
UPDATE `investor_investments` SET `investment_type`=3, `amount`=19000, `change_principal`=19000, `modified_by`=1, `modified_at`='2016-09-02 14:18:57' WHERE  `investment_id`=50;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=49;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,change_principal,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-6-8",16,23,1,4,24199.82,21000.00,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id2 = LAST_INSERT_ID();

UPDATE investor_investments SET 
    status=1,
    authorised_by=1,
    authorised_at=NOW()
 WHERE investment_id=@trans_id2;
 
 UPDATE investor_investments SET
    change_id = @trans_id2,
    early_exit="2015-06-08",
    modified_by=1,
    modified_at=NOW()
 WHERE investment_id=@trans_id;
 
 
 
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-04 17:28:06', `removed_by`=1, `remove_comment`='Remode as part of audit check' WHERE  `investment_id`=61;
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=61;
 UPDATE `investor_investments` SET `amount`=34237.50 WHERE  `investment_id`=62;
 
 
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `status`=2, `removed_at`='2016-09-04 17:31:33', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=66;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-09 14:25:15', `removed_by`=1, `remove_comment`='Removed as part of audit chec' WHERE  `investment_id`=66;
 UPDATE `investor_investments` SET `amount`=34237.50 WHERE  `investment_id`=67;
 
 
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-04 18:11:01', `removed_by`=1, `remove_comment`='Removed as part of audit check', `is_latest`=0 WHERE  `investment_id`=57;
UPDATE `investor_investments` SET `amount`=120127.69, `change_principal`=0, `modified_by`=1, `modified_at`='2016-09-04 18:12:48' WHERE  `investment_id`=56;
UPDATE `investor_investments` SET `investment_type`=3 WHERE  `investment_id`=56;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=55;



UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-04 18:21:34', `removed_by`=1, `remove_comment`='Removed as part of audit check', `is_latest`=0 WHERE  `investment_id`=77;
UPDATE `investor_investments` SET `investment_type`=3, `amount`=111790.91, `change_principal`=0, `modified_by`=1, `modified_at`='2016-09-04 18:24:30' WHERE  `investment_id`=76;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=75;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-04 18:25:45', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=75;
UPDATE `investor_investments` SET `investment_group`=24 WHERE  `investment_id`=76;
UPDATE `investor_investments` SET `investment_type`=3, `amount`=52000, `change_principal`=0, `modified_by`=1, `modified_at`='2016-09-04 18:27:04' WHERE  `investment_id`=74;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=73;
UPDATE `investor_investments` SET `is_latest`=0 WHERE  `investment_id`=74;
UPDATE `investor_investments` SET `is_completed`=0 WHERE  `investment_id`=73;


UPDATE `investor_investments` SET `investment_date`='2016-01-12' WHERE  `investment_id`=694;


UPDATE `investor_investments` SET `amount`=15000.00 WHERE  `investment_id`=718;
UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-04 18:52:37' WHERE  `investment_id`=718;
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,change_principal,change_date,change_id,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-2-4",386,51,1,8,13968,13968,"2016-2-4",718,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE `investor_investments` SET `status`=1, `authorised_by`=1, `authorised_at`='2016-09-04 18:57:25' WHERE  `investment_id`=@trans_id;



UPDATE `investor_investments` SET `change_principal`=0, `status`=2, `removed_at`='2016-09-04 19:11:36', `removed_by`=1, `remove_comment`='Removed as part of audit check', `is_latest`=0 WHERE  `investment_id`=127;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `is_latest`=1 WHERE  `investment_id`=126;
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2014-7-11",41,51,1,5,10385.00,3.85,1.5,12,"",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE `investor_investments` SET `comment`='Added as part of audit check' WHERE  `investment_id`=@trans_id;

UPDATE investor_investments SET 
    status=1,
    authorised_by=1,
    authorised_at=NOW()
 WHERE investment_id=@trans_id;
 
 UPDATE investor_investments SET 
    is_latest=0 
 WHERE investor_id=51 AND investment_group=41;
 UPDATE investor_investments SET 
    is_latest=1
 WHERE investor_id=51 AND investment_group=41 AND status=1
 ORDER BY investment_id DESC 
 LIMIT 1;
 
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-04 19:21:11', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=129;
 
 UPDATE `investor_investments` SET `amount`=10385.00 WHERE  `investment_id`=130;
 UPDATE `investor_investments` SET `amount`=10748.47 WHERE  `investment_id`=131;
 
 
 UPDATE `investor_investments` SET `amount`=390 WHERE  `investment_id`=136;
 UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-05 12:41:53' WHERE  `investment_id`=136;
 
 INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-01-31', 44, 40, 1, 11, 200.00, 0.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, NOW(), 0, NULL, 1, NOW(), NULL, NULL, NULL, 0, 0, NULL);
 
 INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-04-29', 44, 40, 1, 11, 200.00, 0.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, NOW(), 0, NULL, 1, NOW(), NULL, NULL, NULL, 0, 0, NULL);
 
 
 UPDATE `investor_investments` SET `amount`=380 WHERE  `investment_id`=141;
 UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-05 12:54:12' WHERE  `investment_id`=141;
 
 
 UPDATE `investor_investments` SET `amount`=29975.65, `modified_at`='2016-09-05 18:00:56' WHERE  `investment_id`=163;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 14:18:21', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=166;
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=165;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 14:19:23', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=165;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 14:21:10', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=164;
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=163;
 
 INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2013-12-13', 53, 61, 1, 3, 6094.21 , 6094.21, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, NOW(), NULL,NULL , 1, NULL, NULL, NULL, NULL, 1, 0, NULL);
 
 UPDATE `investor_investments` SET `is_latest`=1 WHERE  `investment_id`=163;
 
 INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2014-8-2",53,61,1,5,24990.78,3.95,1.6,12,"Added as part of audit check",1,NOW());


SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
    status=1,
    authorised_by=1,
    authorised_at=NOW()
WHERE investment_id=@trans_id;
 
 
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=61 AND investment_group=53;

UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=61 AND investment_group=53 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,change_principal,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-01-13",53,61,1,4,25434.31,29975.65,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id2 = LAST_INSERT_ID();


UPDATE investor_investments SET 
    status=1,
    authorised_by=1,
    authorised_at=NOW()
 WHERE investment_id=@trans_id2;
 
 UPDATE investor_investments SET
    change_id = @trans_id2,
    early_exit="2015-01-13",
    modified_by=1,
    modified_at=NOW()
 WHERE investment_id=@trans_id;
 
 UPDATE `investor_investments` SET `amount`=25435.51 WHERE  `investment_id`=@trans_id2;
 UPDATE `investor_investments` SET `change_principal`=23881.44 WHERE  `investment_id`=@trans_id2;
 
 
 UPDATE `investor_investments` SET `amount`=26012.88 WHERE  `investment_id`=162;
 UPDATE `investor_investments` SET `amount`=156394.33 WHERE  `investment_id`=118;
 UPDATE `investor_investments` SET `amount`=725631.51 WHERE  `investment_id`=72;
 
 
 UPDATE `investor_investments` SET `investment_type`=3 WHERE  `investment_id`=168;
 UPDATE `investor_investments` SET `amount`=36865, `change_principal`=36865 WHERE  `investment_id`=168;
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=167;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 14:58:07', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=169;
 
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 15:03:35', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=171;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 15:04:04', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=170;
 
 INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
 VALUES(NULL,"2014-09-03",55,63,1,5,15010.00,3.5,0.75,12,"Added as part of audit check",1,NOW());
 
 SET @trans_id = LAST_INSERT_ID();
 
 UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=63 AND investment_group=55;

UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=63 AND investment_group=55 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-09-03",55,63,1,2,525.35,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE `investor_investments` SET `amount`=541.1 WHERE  `investment_id`=@trans_id;

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=63 AND investment_group=55;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=63 AND investment_group=55 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-09-03",55,63,1,9,15010.00,3.25,0.75,12,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=63 AND investment_group=55;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=63 AND investment_group=55 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

UPDATE `investor_investments` SET `investment_date`='2014-05-13' WHERE  `investment_id`=204;
UPDATE `investor_investments` SET `investment_date`='2015-05-13' WHERE  `investment_id`=205;
UPDATE `investor_investments` SET `investment_date`='2016-05-13' WHERE  `investment_id`=929;



UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 15:28:08', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=199;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=198;
UPDATE `investor_investments` SET `is_latest`=1 WHERE  `investment_id`=198;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 15:29:16', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=201;
UPDATE `investor_investments` SET `is_latest`=1 WHERE  `investment_id`=200;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-11-13",64,90,1,5,32448.00,4,0,12,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=90 AND investment_group=64;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=90 AND investment_group=64 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

UPDATE `investor_investments` SET `public_comment`='Coupon paid on 2014-12-17' WHERE  `investment_id`=248;


UPDATE `investor_investments` SET `public_comment`='Paid on 2015-01-13' WHERE  `investment_id`=261;



INSERT INTO address_details (address_id) VALUES(NULL);

SET @address_id  = LAST_INSERT_ID();

INSERT INTO `user_login` (`user_id`, `username`, `user_password`, `user_type`, `user_status`, `modified_at`, `modified_by`, `consent_status`, `consent_success_date`, `consent_request`, `access_token`, `certificate`, `certificate_name`, `consent_signature`) VALUES (NULL, 'phowett002', 'Ph89!Jhln', 6, 1, '0000-00-00 00:00:00', 0, 0, NULL, 0, '', NULL, NULL, NULL);

SET @user_id = LAST_INSERT_ID();

INSERT INTO `temp_registration` (`temp_reg_id`, `ref_id`, `rsa_id`, `username`, `password`, `first_name`, `middle_name`, `last_name`, `job_title`, `register_type`, `organization_name`, `organization_address_id`, `secret_question_id`, `secret_answer`, `user_type`, `nace_group_id`, `nace_id`, `desc`, `user_id`, `doj`, `verification_code`, `ipaddress`, `csr`, `public_key`, `result`, `payment_id`, `payment_status`, `status`, `confirm`, `permission`, `interface`, `dp_type`, `dp_organisation`, `confirm_type`, `partner_id`, `partner_hashkey`, `created_at`, `modified_at`, `currency_id`, `email`, `apply_id`, `verified`, `certificate`, `certificate_name`, `uged_d`, `uged_c`, `accounting_software_id`, `idf_st`, `idf_r`, `upload_idf`) VALUES (133, '20140312000133', 0, 'phowett002', 'Ph89!Jhln', 'Paul', '', 'Howett', '', 0, 'Paul Howett', @address_id , 53, 'Question not answered', 6, NULL, NULL, NULL, @user_id, '2014-03-12', '', '10.189.246.5', '', '', NULL, 0, 0, 4, 0, 1, 5, 0, 0, 0, 0, '', '0000-00-00 00:00:00', '2014-03-12 00:00:00', 1, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);

SET @temp_reg_id = 133;

INSERT INTO address_details (address_id) VALUES(NULL);

SET @address_id2  = LAST_INSERT_ID();

INSERT INTO address_details (address_id) VALUES(NULL);

INSERT INTO `organisation_details` (`organisation_id`, `user_id`, `organisation_reference_id`, `organisation_name`, `organisation_ticker`, `organisation_start_price`, `organisation_trade_name`, `organisation_overview`, `tradingas`, `agreed_rate`, `posting_fee`, `processing_fee`, `trade_fee`, `purchase_price`, `trade_limit`, `valid_date`, `membership`, `arrangement`, `instalment_etr`, `reserve`, `nace_group_id`, `nace_id`, `organisation_address_id`, `organisation_regoffice_id`, `corporation_number`, `vat_number`, `tax_number`, `tax_url`, `tax_username`, `tax_password`, `parent_company_name`, `business_entity_type`, `business_function_type`, `organisation_jurisdiction`, `formation_year`, `last_filling`, `share_capital`, `filling_year`, `organisation_risk`, `organisation_limit`, `active_debtors`, `debtor_credit_limit`, `mail_address_id`, `billing_address_id`, `website`, `management_assets`, `duns_number`, `organisation_type`, `type`, `total_employee`, `accounting_software`, `exchange_timeframe`, `previous_company_name`, `other_changes`, `other_details`, `submitter_firstname`, `submitter_lastname`, `submitted_date`, `submitter_legally_approved`, `application_status`, `application_step`, `organisation_status`, `organisation_confirm`, `org_interface`, `auto_trade`, `rate_status`, `etr_auto_submit`, `etr_manual_submit`, `etr_pod_mandatory`, `etr_pod_mail`, `modified_at`, `modified_by`, `created_at`, `created_by`, `number_of_directors`, `consent_level`, `insurance_provider_id`, `discount_provider_id`, `credit_agreed_rate`, `trade_limit_c_etr`, `trade_limit_threshold`, `trade_limit_level`) VALUES (NULL, @user_id, 11403000113, 'phowett002', '', NULL, 'phowett002', '', '', '4.500', 0.00, 0.00, 0.00, '', '', '0000-00-00', '', '', 0, 0.000, 0, 0, 0, 'NULL', '', '', '', '', '', '', '', 0, NULL, 104, '0000', '0000', 0, '0000', NULL, NULL, 2, 0, @address_id2, 0, '', NULL, NULL, 0, 0, 0, '', '', '', '', '', 'NULL', 'NULL', '2014-03-12', 2, 1, '7', 1, 0, 0, 0, 0, 1, 1, 1, 0, '2014-03-12 08:38:55', 0, '0000-00-00 00:00:00', 0, 0, '1', NULL, NULL, 4.5000, 0, NULL, 0);

SET @organisation_id = LAST_INSERT_ID();

UPDATE organisation_details SET
 organisation_details.organisation_reference_id=CONCAT('11403000',@organisation_id)
 WHERE organisation_details.organisation_id=@organisation_id;
 
 
 INSERT INTO `organisation_currency` (`org_currency_id`, `organisation_id`, `branch_id`, `currency_id`, `bank_account_type`, `currency_bank_id`, `created_at`, `is_main`) VALUES (NULL, @organisation_id, 0, 1, 0, 0, '2016-01-09 10:14:37', 1);


INSERT INTO `investor_relation` (`relation_id`, `investor_id`, `intermediary_id`) VALUES (NULL, @temp_reg_id, 124);


INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id  = LAST_INSERT_ID();

INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id2  = LAST_INSERT_ID();

INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id3  = LAST_INSERT_ID();

INSERT INTO `contact_details` (`contact_id`, `parent_id`, `temp_reg_id`, `debtor_id`, `sub_debtor_id`, `retailer_id`, `organisation_id`, `debtor_masterid`, `bank_id`, `prospect_id`, `prospect_type`, `first_name`, `middle_name`, `last_name`, `phone1`, `phone2`, `job_title`, `pronounced`, `home_address_id`, `hq_address_id`, `work_address_id`, `birth_date`, `passport_number`, `passport_issue_date`, `driving_licence_number`, `driving_licence_number_issue_date`, `percent_owned`, `ownership`, `active_participation`, `modified_at`, `modified_by`, `position`, `contact_flag`, `type`, `dmc`) VALUES (NULL, NULL, @temp_reg_id, NULL, 0, NULL, NULL, 0, 0, NULL, 0, 'Paul', '', 'Howett', NULL, '', '', '', @address_id, @address_id2, @address_id3, '1963-10-30', '', '0000-00-00', '', '0000-00-00', 0, 0, 0, '0000-00-00 00:00:00', 0, 0, 0, NULL, 0);


INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id  = LAST_INSERT_ID();

INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id2  = LAST_INSERT_ID();

INSERT INTO address_details (address_id) VALUES(NULL);
SET @address_id3  = LAST_INSERT_ID();


INSERT INTO `contact_details` (`contact_id`, `parent_id`, `temp_reg_id`, `debtor_id`, `sub_debtor_id`, `retailer_id`, `organisation_id`, `debtor_masterid`, `bank_id`, `prospect_id`, `prospect_type`, `first_name`, `middle_name`, `last_name`, `phone1`, `phone2`, `job_title`, `pronounced`, `home_address_id`, `hq_address_id`, `work_address_id`, `birth_date`, `passport_number`, `passport_issue_date`, `driving_licence_number`, `driving_licence_number_issue_date`, `percent_owned`, `ownership`, `active_participation`, `modified_at`, `modified_by`, `position`, `contact_flag`, `type`, `dmc`) VALUES (NULL, NULL, @temp_reg_id, NULL, 0, NULL, NULL, 0, 3, NULL, 0, 'Paul', '', 'Howett', NULL, '', '', '', @address_id, @address_id2, @address_id3, '0000-00-00', '', '0000-00-00', '', '0000-00-00', 0, 0, 0, '0000-00-00 00:00:00', 0, 1, 0, NULL, 0);



UPDATE investor_investments
SET investor_investments.investor_id=@user_id
WHERE investor_investments.investor_id=124;

UPDATE invoice_closed
SET invoice_closed.won_by = @user_id
WHERE invoice_closed.won_by = 124;



UPDATE `investor_investments` SET `public_comment`='Paid on 2015-04-15' WHERE  `investment_id`=317;
UPDATE `investor_investments` SET `public_comment`='Paid on 2015-05-25' WHERE  `investment_id`=333;



UPDATE `investor_investments` SET `investment_type`=5, `amount`=31125.00, `modified_by`=1, `modified_at`='2016-09-05 17:46:19' WHERE  `investment_id`=340;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 17:46:35', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=339;
UPDATE `investor_investments` SET `amount`=1167.19 WHERE  `investment_id`=835;



UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 17:50:11', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=354;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 17:50:36', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=353;
UPDATE `investor_investments` SET `investment_type`=3, `amount`=20000, `change_principal`=20000, `modified_by`=1, `modified_at`='2016-09-05 17:51:22' WHERE  `investment_id`=352;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-05 18:01:28' WHERE  `investment_id`=351;
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-5-16",127,149,1,5,9746.83,3.25,1,12,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=149 AND investment_group=127;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=149 AND investment_group=127 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;
 
 UPDATE `investor_investments` SET `amount`=190 WHERE  `investment_id`=356;
 UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-05 18:52:36' WHERE  `investment_id`=356;
 
 
 UPDATE `investor_investments` SET `public_comment`='Paid on 2015-06-12' WHERE  `investment_id`=367;
 UPDATE `investor_investments` SET `public_comment`='Paid on 2015-06-12' WHERE  `investment_id`=369;
 
 
 
 UPDATE `investor_investments` SET `investment_date`='2015-07-16', `investment_type`=3, `amount`=50000, `change_principal`=50000, `modified_by`=1, `modified_at`='2016-09-05 19:08:50' WHERE  `investment_id`=381;
 UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=380;
 UPDATE `investor_investments` SET `status`=2, `modified_by`=1, `modified_at`='2016-09-05 19:10:06', `removed_at`='2016-09-05 19:10:08', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=383;
 UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 19:10:34', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=382;
 UPDATE `investor_investments` SET `investment_date`='2015-07-01', `public_comment`='Paid on 2015-07-16' WHERE  `investment_id`=381;
 
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-7-1",140,164,1,5,415043.70,3.65,1.6,12,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=164 AND investment_group=140;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=164 AND investment_group=140 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,change_principal,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-09-10",140,164,1,4,417316.09,398019,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id2 = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id2;

UPDATE investor_investments SET
change_id = @trans_id2,
early_exit="2015-09-10",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id;

UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=164 AND investment_group=140;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=164 AND investment_group=140 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

UPDATE `investor_investments` SET `amount`=417284.95, `modified_by`=1, `modified_at`='2016-09-05 19:34:34' WHERE  `investment_id`=@trans_id2;


UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 21:35:23', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=390;
UPDATE `investor_investments` SET `amount`=20760 WHERE  `investment_id`=391;

UPDATE `investor_investments` SET `investment_type`=3, `amount`=50000, `change_principal`=50000, `modified_by`=1, `modified_at`='2016-09-05 21:39:12' WHERE  `investment_id`=400;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-05 18:01:33' WHERE  `investment_id`=399;
UPDATE `investor_investments` SET `investment_type`=5 WHERE  `investment_id`=401;
UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-05 21:41:13' WHERE  `investment_id`=401;



UPDATE `investor_investments` SET `investment_type`=3, `amount`=73000, `change_principal`=73000, `modified_by`=1, `modified_at`='2016-09-05 21:53:46' WHERE  `investment_id`=395;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=394;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 21:54:47', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=396;


UPDATE `investor_investments` SET `investment_type`=3, `amount`=15000, `change_principal`=15000, `modified_by`=1, `modified_at`='2016-09-05 22:53:35' WHERE  `investment_id`=407;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-05 18:01:34' WHERE  `investment_id`=406;
UPDATE `investor_investments` SET `investment_group`=152, `investment_type`=5, `amount`=69322.06, `modified_by`=1, `modified_at`='2016-09-05 22:55:08' WHERE  `investment_id`=408;


UPDATE `investor_investments` SET `investment_type`=3, `amount`=37280, `change_principal`=37280 WHERE  `investment_id`=432;
UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-05 23:02:15' WHERE  `investment_id`=432;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-05 18:01:36' WHERE  `investment_id`=431;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 23:10:03', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=433;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 23:12:14', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=434;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 23:12:48', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=435;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 23:13:16', `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=436;
UPDATE `investor_investments` SET `removed_by`=1 WHERE  `investment_id`=436;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-10-23",164,196,1,5,74434.35,3.25,0.75,12,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=196 AND investment_group=164;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=196 AND investment_group=164 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-12-10",164,196,1,3,35000,NULL,NULL,NULL,"",1,NOW());

SET @trans_id2 = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id2;
 
 UPDATE investor_investments SET 
change_id=@trans_id,
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id2;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=196 AND investment_group=164;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=196 AND investment_group=164 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

UPDATE `investor_investments` SET `public_comment`='Paid on 2015-11-30' WHERE  `investment_id`=440;



UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-05 23:45:43', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=463;
UPDATE `investor_investments` SET `months`=12 WHERE  `investment_id`=460;
UPDATE `investor_investments` SET `investment_date`='2015-12-16' WHERE  `investment_id`=461;
UPDATE `investor_investments` SET `early_exit`='2015-12-16' WHERE  `investment_id`=460;
UPDATE `investor_investments` SET `amount`=52771.02 WHERE  `investment_id`=461;
UPDATE `investor_investments` SET `amount`=19614.90 WHERE  `investment_id`=464;
UPDATE `investor_investments` SET `amount`=19622.83 WHERE  `investment_id`=464;



UPDATE `investor_investments` SET `investment_type`=3, `amount`=30000, `change_principal`=30000, `modified_by`=1, `modified_at`='2016-09-06 00:00:48' WHERE  `investment_id`=466;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-06 18:01:41' WHERE  `investment_id`=465;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 00:01:40', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=468;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 00:02:04', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=467;

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-12-16",183,215,1,5,21722.27,3.650,1,12,"Added as part of audit check",1,NOW());


SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=215 AND investment_group=183;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=215 AND investment_group=183 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;

UPDATE `investor_investments` SET `public_comment`='Paid on 2016-01-20' WHERE  `investment_id`=482;


UPDATE `investor_investments` SET `investment_date`='2015-01-20' WHERE  `investment_id`=488;
UPDATE `investor_investments` SET `investment_date`='2016-01-20' WHERE  `investment_id`=489;

UPDATE `investor_investments` SET `amount`=229138.94 WHERE  `investment_id`=978;



UPDATE `investor_investments` SET `investment_type`=3, `amount`=25000, `change_principal`=25000, `modified_by`=1, `modified_at`='2016-09-06 00:27:16' WHERE  `investment_id`=535;
UPDATE `investor_investments` SET `status`=2,  `removed_at`='2016-09-06 00:27:43', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=536;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 00:29:23', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=793;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=534;


INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,change_principal,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-03-16",224,268,1,4,130039.03,150000.00,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;

UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=534;

UPDATE `investor_investments` SET `change_principal`=125000.00 WHERE  `investment_id`=@trans_id;


UPDATE `investor_investments` SET `investment_date`='2015-04-28' WHERE  `investment_id`=558;


UPDATE `investor_investments` SET `investment_date`='2015-04-28' WHERE  `investment_id`=560;



UPDATE `investor_investments` SET `investment_type`=3, `amount`=5000, `change_principal`=5000, `modified_by`=1, `modified_at`='2016-09-06 07:56:51' WHERE  `investment_id`=551;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=550;
UPDATE `investor_investments` SET `modified_at`='2016-09-06 18:01:48' WHERE  `investment_id`=550;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 07:59:03', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id` IN (552,553,554,555,556,765,990);

INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-1-27",234,303,1,3,4000,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
change_id=550,
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=303 AND investment_group=234;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=303 AND investment_group=234 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;



INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-02-08",234,303,1,3,4000,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
change_id=550,
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=303 AND investment_group=234;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=303 AND investment_group=234 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;
                                         
INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2016-03-07",234,303,1,3,4000,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE investor_investments SET 
status=1,
authorised_by=1,
authorised_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
change_id=550,
modified_by=1,
modified_at=NOW()
WHERE investment_id=@trans_id;
UPDATE investor_investments SET 
is_latest=0 
WHERE investor_id=303 AND investment_group=234;
UPDATE investor_investments SET 
is_latest=1
WHERE investor_id=303 AND investment_group=234 AND status=1
ORDER BY investment_id DESC 
LIMIT 1;




UPDATE `investor_investments` SET `removed_at`='2016-09-06 08:15:55', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=744;
UPDATE `investor_investments` SET `status`=2 WHERE  `investment_id`=744;
UPDATE `investor_investments` SET `early_exit`='2015-10-21', `change_id`=742 WHERE  `investment_id`=741;
UPDATE `investor_investments` SET `investment_date`='2015-10-21' WHERE  `investment_id`=742;
UPDATE `investor_investments` SET `amount`=50671.23 WHERE  `investment_id`=742;

UPDATE `investor_investments` SET `amount`=101284.93, `change_principal`=100000.00 WHERE  `investment_id`=745;
UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-06 08:22:45' WHERE  `investment_id`=745;
UPDATE `investor_investments` SET `amount`=101952.78 WHERE  `investment_id`=745;


UPDATE `investor_investments` SET `investment_date`='2016-01-13' WHERE  `investment_id`=696;


UPDATE `investor_investments` SET `investment_date`='2015-07-01' WHERE  `investment_id`=577;
UPDATE `investor_investments` SET `investment_date`='2016-07-01' WHERE  `investment_id`=1028;


UPDATE `investor_investments` SET `amount`=70695.53 WHERE  `investment_id`=599;
UPDATE `investor_investments` SET `amount`=100506.94  WHERE  `investment_id`=686;


UPDATE `investor_investments` SET `investment_date`='2015-07-29' WHERE  `investment_id`=591;
UPDATE `investor_investments` SET `investment_date`='2016-07-29' WHERE  `investment_id`=1035;


UPDATE `investor_investments` SET `investment_date`='2016-02-17' WHERE  `investment_id`=725;


UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=619;
UPDATE `investor_investments` SET `investment_type`=3, `amount`=3000, `change_principal`=3000 WHERE  `investment_id`=620;
UPDATE `investor_investments` SET `modified_by`=1, `modified_at`='2016-09-06 08:59:43' WHERE  `investment_id`=620;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 09:00:13', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=621;
UPDATE `investor_investments` SET `investment_group`=291 WHERE  `investment_id`=823;

UPDATE `investor_investments` SET `investment_date`='2016-01-13' WHERE  `investment_id`=697;


UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-06 16:25:43' WHERE  `investment_id`=658;
UPDATE `investor_investments` SET `status`=1, `removed_at`=NULL, `removed_by`=NULL WHERE  `investment_id`=750;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 09:10:43', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=802;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 09:11:18', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=803;
UPDATE `investor_investments` SET `investment_group`=329, `change_id`=658, `modified_by`=1, `modified_at`='2016-09-06 09:45:55' WHERE  `investment_id`=1050;



UPDATE `investor_investments` SET `investment_date`='2015-11-25', `amount`=30000.42, `modified_by`=1, `modified_at`='2016-09-06 09:14:21' WHERE  `investment_id`=663;
UPDATE `investor_investments` SET `investment_date`='2016-05-25' WHERE  `investment_id`=944;
UPDATE `investor_investments` SET `amount`=30483.92 WHERE  `investment_id`=944;


UPDATE `investor_investments` SET `investment_date`='2015-12-07' WHERE  `investment_id`=669;
UPDATE `investor_investments` SET `amount`=8000, `change_principal`=8000, `modified_by`=1, `modified_at`='2016-09-06 09:30:38' WHERE  `investment_id`=670;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-06 18:01:58' WHERE  `investment_id`=669;
UPDATE `investor_investments` SET `investment_type`=3 WHERE  `investment_id`=670;
UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-06 09:31:38', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=671;


UPDATE `investor_investments` SET `investment_date`='2015-12-07' WHERE  `investment_id`=667;
UPDATE `investor_investments` SET `investment_date`='2015-12-07' WHERE  `investment_id`=668;
UPDATE `investor_investments` SET `investment_date`='2015-12-08' WHERE  `investment_id`=674;
UPDATE `investor_investments` SET `investment_date`='2015-12-08' WHERE  `investment_id`=675;
UPDATE `investor_investments` SET `investment_date`='2016-01-13' WHERE  `investment_id`=695;
UPDATE `investor_investments` SET `investment_date`='2016-01-19' WHERE  `investment_id`=699;
UPDATE `investor_investments` SET `amount`=29999.58 WHERE  `investment_id`=721;
UPDATE `investor_investments` SET `investment_date`='2016-02-17' WHERE  `investment_id`=723;
UPDATE `investor_investments` SET `investment_date`='2016-02-17' WHERE  `investment_id`=726;
UPDATE `investor_investments` SET `investment_date`='2016-02-22' WHERE  `investment_id`=734;
UPDATE `investor_investments` SET `investment_date`='2016-03-01' WHERE  `investment_id`=805;

UPDATE `investor_investments` SET `public_comment`='Two payments received on the same date 61,209.89 and 38,798.11' WHERE  `investment_id`=798;
UPDATE `investor_investments` SET `public_comment`='Two payments received on the same date 20,000.00 and 20,000.00' WHERE  `investment_id`=825;

UPDATE `investor_investments` SET `investment_date`='2016-04-21' WHERE  `investment_id`=924;
UPDATE `investor_investments` SET `public_comment`='Two payments received on the same date 3,556.00 and 66,444.10' WHERE  `investment_id`=913;

UPDATE `investor_investments` SET `investment_group`=152 WHERE  `investment_id`=936;




UPDATE `investor_investments` SET `amount`=36488 WHERE  `investment_id`=15;
UPDATE `investor_investments` SET `amount`=15275 WHERE  `investment_id`=17;
UPDATE `investor_investments` SET `amount`=34237.5, `change_principal`=31800.00 WHERE  `investment_id`=67;

UPDATE `investor_investments` SET `amount`=5000.00 WHERE  `investment_id`=68;
UPDATE `investor_investments` SET `amount`=5200.00 WHERE  `investment_id`=69;
UPDATE `investor_investments` SET `amount`=5395.00 WHERE  `investment_id`=70;
UPDATE `investor_investments` SET `amount`=5583.82 WHERE  `investment_id`=969;

SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2013-06-10', @next_group, 27, 1, 1, 5000.00, 0.00, NULL, 4.000, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:00:34', 0, NULL, 1, '2016-02-24 18:00:34', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-06-10', @next_group, 27, 1, 5, 5200.00, 0.00, NULL, 3.750, 0.750, 12, NULL, 0, '', 1, 1, '2016-02-24 18:00:34', 0, NULL, 1, '2016-02-24 18:00:34', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-06-10', @next_group, 27, 1, 5, 5395.00, 0.00, NULL, 3.500, 0.750, 12, NULL, 0, '', 1, 1, '2016-02-24 18:00:35', 0, NULL, 1, '2016-02-24 18:00:35', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-06-10', @next_group, 27, 1, 5, 5583.82, 0.00, NULL, 1.950, 1.000, 12, NULL, 0, '', 1, 20, '2016-07-12 14:39:16', 0, NULL, 20, '2016-07-12 14:39:24', NULL, NULL, NULL, 0, 1, NULL);


UPDATE `investor_investments` SET `amount`=111780.91 WHERE  `investment_id`=76;
UPDATE `investor_investments` SET `amount`=129480 WHERE  `investment_id`=80;
UPDATE `investor_investments` SET `amount`=1669 WHERE  `investment_id`=94;


UPDATE `investor_investments` SET `investment_date`='2013-07-02' WHERE  `investment_id`=96;
UPDATE `investor_investments` SET `investment_date`='2014-07-02' WHERE  `investment_id`=97;
UPDATE `investor_investments` SET `investment_date`='2015-07-02' WHERE  `investment_id`=98;
UPDATE `investor_investments` SET `investment_date`='2016-07-02' WHERE  `investment_id`=992;

UPDATE `investor_investments` SET `amount`=71870.26 WHERE  `investment_id`=96;
UPDATE `investor_investments` SET `amount`=74745.07 WHERE  `investment_id`=97;
UPDATE `investor_investments` SET `amount`=77585.38 WHERE  `investment_id`=98;
UPDATE `investor_investments` SET `amount`=80417.24 WHERE  `investment_id`=992;



UPDATE `investor_investments` SET `amount`=502820.64 WHERE  `investment_id`=106;

UPDATE `investor_investments` SET `amount`=10878.01 WHERE  `investment_id`=90;

UPDATE `investor_investments` SET `amount`=21318.94 WHERE  `investment_id`=125;

UPDATE `investor_investments` SET `amount`=50732.57 WHERE  `investment_id`=144;
UPDATE `investor_investments` SET `amount`=15281.25 WHERE  `investment_id`=156;

UPDATE `investor_investments` SET `amount`=183416.13 WHERE  `investment_id`=149;
UPDATE `investor_investments` SET `amount`=199006.48 WHERE  `investment_id`=150;
UPDATE `investor_investments` SET `amount`=215922.01 WHERE  `investment_id`=151;

UPDATE `investor_investments` SET `amount`=927.5 WHERE  `investment_id`=173;
UPDATE `investor_investments` SET `amount`=31446.16 WHERE  `investment_id`=183;
UPDATE `investor_investments` SET `amount`=1010.89 WHERE  `investment_id`=867;
UPDATE `investor_investments` SET `amount`=15929 WHERE  `investment_id`=210;
UPDATE `investor_investments` SET `amount`=16991 WHERE  `investment_id`=186;

UPDATE `investor_investments` SET `amount`=1040 WHERE  `investment_id`=193;

UPDATE `investor_investments` SET `amount`=112550.91 WHERE  `investment_id`=225;
UPDATE `investor_investments` SET `change_principal`=112550.91 WHERE  `investment_id`=226;
UPDATE `investor_investments` SET `amount`=117042.2 WHERE  `investment_id`=226;

UPDATE `investor_investments` SET `amount`=10737.51 WHERE  `investment_id`=229;
UPDATE `investor_investments` SET `amount`=41404.45 WHERE  `investment_id`=239;
UPDATE `investor_investments` SET `amount`=43039.92 WHERE  `investment_id`=240;
UPDATE `investor_investments` SET `amount`=44589.36 WHERE  `investment_id`=241;


UPDATE `investor_investments` SET `amount`=71371.87 WHERE  `investment_id`=236;
UPDATE `investor_investments` SET `change_principal`=71371.87 WHERE  `investment_id`=238;
UPDATE `investor_investments` SET `amount`=75589.06 WHERE  `investment_id`=237;
UPDATE `investor_investments` SET `amount`=75803 WHERE  `investment_id`=238;

UPDATE `investor_investments` SET `amount`=42497.87 WHERE  `investment_id`=270;

UPDATE `investor_investments` SET `amount`=20802.22 WHERE  `investment_id`=317;


UPDATE `investor_investments` SET `amount`=31433.38 WHERE  `investment_id`=315;


UPDATE `investor_investments` SET `amount`=21318.48 WHERE  `investment_id`=326;
UPDATE `investor_investments` SET `amount`=22117.92 WHERE  `investment_id`=327;
UPDATE `investor_investments` SET `amount`=22892.05 WHERE  `investment_id`=1064;


UPDATE `investor_investments` SET `amount`=1125 WHERE  `investment_id`=835;

UPDATE `investor_investments` SET `amount`=10473.92 WHERE  `investment_id`=342;
UPDATE `investor_investments` SET `amount`=2652.78 WHERE  `investment_id`=346;

UPDATE `investor_investments` SET `amount`=83847.33 WHERE  `investment_id`=350;

UPDATE `investor_investments` SET `amount`=20990, `change_principal`=20990 WHERE  `investment_id`=352;


UPDATE `investor_investments` SET `amount`=10226 WHERE  `investment_id`=358;

UPDATE `investor_investments` SET `amount`=68646.6 WHERE  `investment_id`=365;
UPDATE `investor_investments` SET `amount`=264250 WHERE  `investment_id`=371;
UPDATE `investor_investments` SET `amount`=26356.39 WHERE  `investment_id`=379;

UPDATE `investor_investments` SET `investment_date`='2015-08-28' WHERE  `investment_id`=404;
UPDATE `investor_investments` SET `amount`=20000.00 WHERE  `investment_id`=405;


UPDATE `investor_investments` SET `investment_date`='2014-08-29' WHERE  `investment_id`=409;
UPDATE `investor_investments` SET `investment_date`='2015-08-29' WHERE  `investment_id`=410;


UPDATE `investor_investments` SET `amount`=20802.45 WHERE  `investment_id`=415;

UPDATE `investor_investments` SET `investment_date`='2014-09-16' WHERE  `investment_id`=411;
UPDATE `investor_investments` SET `investment_date`='2015-09-16' WHERE  `investment_id`=412;


UPDATE `investor_investments` SET `amount`=10248 WHERE  `investment_id`=428;
UPDATE `investor_investments` SET `investment_date`='2014-10-23' WHERE  `investment_id`=431;


UPDATE `investor_investments` SET `investment_date`='2014-11-17' WHERE  `investment_id`=441;
UPDATE `investor_investments` SET `amount`=40904 WHERE  `investment_id`=442;


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-12-16', @next_group, 215, 1, 1, 5000.00, 0.00, NULL, 3.650, 1.600, 12, NULL, 0, '', 1, 1, '2016-02-24 18:01:59', 0, NULL, 1, '2016-02-24 18:01:59', NULL, NULL, NULL, 0, 1, NULL);

UPDATE `investor_investments` SET `amount`=5000.00 WHERE  `investment_id`=681;


UPDATE `investor_investments` SET `investment_date`='2014-12-18' WHERE  `investment_id`=477;
UPDATE `investor_investments` SET `investment_date`='2015-12-18' WHERE  `investment_id`=478;

UPDATE `investor_investments` SET `amount`=50427.08 WHERE  `investment_id`=487;

UPDATE `investor_investments` SET `amount`=102313.89 WHERE  `investment_id`=492;
UPDATE `investor_investments` SET `amount`=41209.44 WHERE  `investment_id`=499;
UPDATE `investor_investments` SET `amount`=20830.81 WHERE  `investment_id`=870;

UPDATE `investor_investments` SET `amount`=20724.29 WHERE  `investment_id`=512;
UPDATE `investor_investments` SET `amount`=20830.81 WHERE  `investment_id`=871;

UPDATE `investor_investments` SET `amount`=51108.33 WHERE  `investment_id`=519;


UPDATE `investor_investments` SET `amount`=20298.27 WHERE  `investment_id`=521;
UPDATE `investor_investments` SET `amount`=710.47 WHERE  `investment_id`=842;
UPDATE `investor_investments` SET `amount`=20298.27 WHERE  `investment_id`=843;


UPDATE `investor_investments` SET `amount`=20303.8 WHERE  `investment_id`=523;
UPDATE `investor_investments` SET `amount`=20303.8 WHERE  `investment_id`=845;

UPDATE `investor_investments` SET `amount`=130149.63 WHERE  `investment_id`=1115;

UPDATE `investor_investments` SET `amount`=23032.37 WHERE  `investment_id`=537;

UPDATE `investor_investments` SET `amount`=59946.46 WHERE  `investment_id`=544;

UPDATE `investor_investments` SET `amount`=20375.28 WHERE  `investment_id`=549;

UPDATE `investor_investments` SET `investment_date`='2015-04-30' WHERE  `investment_id`=558;

UPDATE `investor_investments` SET `amount`=20109 WHERE  `investment_id`=559;


UPDATE `investor_investments` SET `investment_date`='2015-04-30' WHERE  `investment_id`=560;
UPDATE `investor_investments` SET `amount`=103564.69 WHERE  `investment_id`=874;

UPDATE `investor_investments` SET `investment_date`='2015-04-27' WHERE  `investment_id`=557;

UPDATE `investor_investments` SET `amount`=19696.27 WHERE  `investment_id`=573;

UPDATE `investor_investments` SET `investment_date`='2016-01-15' WHERE  `investment_id`=696;


UPDATE `investor_investments` SET `investment_date`='2015-07-02' WHERE  `investment_id`=577;
UPDATE `investor_investments` SET `investment_date`='2016-07-02' WHERE  `investment_id`=1028;

UPDATE `investor_investments` SET `amount`=297.5 WHERE  `investment_id`=583;

UPDATE `investor_investments` SET `investment_date`='2015-08-17' WHERE  `investment_id`=594;
UPDATE `investor_investments` SET `investment_date`='2016-08-17' WHERE  `investment_id`=1054;
UPDATE `investor_investments` SET `investment_date`='2016-08-17' WHERE  `investment_id`=1055;

UPDATE `investor_investments` SET `investment_date`='2015-08-06' WHERE  `investment_id`=595;
UPDATE `investor_investments` SET `investment_date`='2016-02-06' WHERE  `investment_id`=1057;
UPDATE `investor_investments` SET `investment_date`='2016-08-06' WHERE  `investment_id`=1058;


UPDATE `investor_investments` SET `amount`=5000.00 WHERE  `investment_id`=600;
UPDATE `investor_investments` SET `amount`=5040.96 WHERE  `investment_id`=601;




SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-08-25', @next_group, 360, 1, 1, 5000.00, 0.00, NULL, 3.250, 1.600, 3, NULL, 0, '', 1, 1, '2016-02-24 18:01:53', 0, NULL, 1, '2016-02-24 18:01:53', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-11-25', @next_group, 360, 1, 5, 5040.96, 0.00, NULL, 3.250, 1.600, 9, NULL, 0, '', 1, 1, '2016-02-24 18:01:53', 0, NULL, 1, '2016-02-24 18:01:53', NULL, NULL, NULL, 1, 1, NULL);

UPDATE `investor_investments` SET `amount`=50833.67 WHERE  `investment_id`=989;


UPDATE `investor_investments` SET `investment_date`='2016-01-15' WHERE  `investment_id`=697;

UPDATE `investor_investments` SET `investment_date`='2015-11-27' WHERE  `investment_id`=663;
UPDATE `investor_investments` SET `investment_date`='2016-05-27' WHERE  `investment_id`=944;

UPDATE `investor_investments` SET `investment_date`='2015-12-09' WHERE  `investment_id`=669;

UPDATE `investor_investments` SET `investment_date`='2015-12-10' WHERE  `investment_id`=674;

UPDATE `investor_investments` SET `amount`=60270.83 WHERE  `investment_id`=689;

UPDATE `investor_investments` SET `investment_date`='2016-02-02' WHERE  `investment_id`=715;


UPDATE `investor_investments` SET `amount`=5000.00 WHERE  `investment_id`=722;



SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-02-10', @next_group, 499, 1, 1, 5000.00, 0.00, NULL, 3.250, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:02:04', 0, NULL, 1, '2016-02-24 18:02:04', NULL, NULL, NULL, 0, 1, NULL);

SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-02-05', @next_group, 499, 1, 1, 5000.00, 0.00, NULL, 3.250, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:02:04', 0, NULL, 1, '2016-02-24 18:02:04', NULL, NULL, NULL, 0, 1, NULL);


UPDATE `investor_investments` SET `amount`=2890.06 WHERE  `investment_id`=726;

UPDATE `investor_investments` SET `amount`=25225.69 WHERE  `investment_id`=933;

UPDATE `investor_investments` SET `investment_date`='2016-02-26' WHERE  `investment_id`=747;

UPDATE `investor_investments` SET `amount`=100770.64 WHERE  `investment_id`=979;
UPDATE `investor_investments` SET `change_principal`=100000.00 WHERE  `investment_id`=979;


UPDATE `investor_investments` SET `amount`=5000.00 WHERE  `investment_id`=788;

SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-03-11', @next_group, 578, 1, 1, 10000.00, 0.00, NULL, 3.500, 1.600, 12, NULL, 0, '', 1, 20, '2016-03-14 16:56:14', 0, NULL, 20, '2016-03-14 17:00:50', NULL, NULL, NULL, 0, 1, NULL);


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-03-10', @next_group, @user_id, 1, 1, 200000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 10:57:43', 0, NULL, 1, '2016-09-09 11:02:35', NULL, NULL, NULL, 0, 0, NULL);

SET @rpa_id =  LAST_INSERT_ID();

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 207298.62, 200000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:19:19', 0, NULL, 1, '2016-09-09 11:29:36', NULL, NULL, NULL, 0, 1, NULL);

SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-03-18', @next_group, @user_id, 1, 1, 100000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 10:59:01', 0, NULL, 1, '2016-09-09 11:02:53', NULL, NULL, NULL, 0, 1, NULL);


SET @rpa_id =  LAST_INSERT_ID();


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 103550.68, 100000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:19:52', 0, NULL, 1, '2016-09-09 11:29:21', NULL, NULL, NULL, 0, 1, NULL);


SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");




SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-04-03', @next_group, @user_id, 1, 1, 105000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 10:59:36', 0, NULL, 1, '2016-09-09 11:03:01', NULL, NULL, NULL, 0, 1, NULL);



SET @rpa_id =  LAST_INSERT_ID();



INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 108521.09, 105000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:20:18', 0, NULL, 1, '2016-09-09 11:29:14', NULL, NULL, NULL, 0, 1, NULL);


SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");



SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-04-07', @next_group, @user_id, 1, 1, 195000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:00:09', 0, NULL, 1, '2016-09-09 11:03:09', NULL, NULL, NULL, 0, 1, NULL);


SET @rpa_id =  LAST_INSERT_ID();

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 201443.00, 195000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:21:10', 0, NULL, 1, '2016-09-09 11:27:20', NULL, NULL, NULL, 0, 1, NULL);

SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");




SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-04-14', @next_group, @user_id, 1, 1, 95000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:01:01', 0, NULL, 1, '2016-09-09 11:03:21', NULL, NULL, NULL, 0, 1, NULL);

SET @rpa_id =  LAST_INSERT_ID();


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 98056.91, 95000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:21:38', 0, NULL, 1, '2016-09-09 11:27:13', NULL, NULL, NULL, 0, 1, NULL);


SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");




SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-06-16', @next_group, @user_id, 1, 1, 65000.00, 0.00, NULL, 4.500, 0.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:01:42', 0, NULL, 1, '2016-09-09 11:02:21', NULL, NULL, NULL, 0, 1, NULL);


SET @rpa_id =  LAST_INSERT_ID();

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-12-31', @next_group, @user_id, 1, 4, 66586.72, 65000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 11:22:03', 0, NULL, 1, '2016-09-09 11:26:56', NULL, NULL, NULL, 0, 1, NULL);

SET @fr_id = LAST_INSERT_ID();

UPDATE investor_investments SET
change_id = @fr_id,
early_exit="2014-12-31",
modified_by=1,
modified_at=NOW()
WHERE investment_id=@rpa_id AND DATE_ADD(investor_investments.investment_date,INTERVAL investor_investments.months MONTH)>DATE("2014-12-31");


UPDATE `investor_investments` SET `amount`=785457.02 WHERE  `investment_id`=311;
UPDATE `investor_investments` SET `amount`=820802.54 WHERE  `investment_id`=312;


INSERT INTO investor_investments(investment_id,investment_date,investment_group,investor_id,currency_id,investment_type,amount,buy_rate,commission,months,comment,created_by,created_at)
VALUES(NULL,"2015-05-15",107,125,1,3,40000,NULL,NULL,NULL,"Added as part of audit check",1,NOW());

SET @trans_id = LAST_INSERT_ID();

UPDATE `investor_investments` SET `status`=1, `authorised_by`=1, `authorised_at`='2016-09-09 12:09:07' WHERE  `investment_id`=@trans_id;


UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-12 12:29:52', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=310;


UPDATE `investor_investments` SET `amount`=5000 WHERE  `investment_id`=389;
UPDATE `investor_investments` SET `change_principal`=5000 WHERE  `investment_id`=391;
UPDATE `investor_investments` SET `amount`=5190.00 WHERE  `investment_id`=390;
UPDATE `investor_investments` SET `amount`=5190.00 WHERE  `investment_id`=391;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=390;


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-07-22', @next_group, 169, 1, 1, 5000.00, 0.00, NULL, 3.800, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-07-22', @next_group, 169, 1, 5, 5190.00, 0.00, NULL, 3.800, 1.500, 12, NULL, NULL, '', 2, 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', '2016-09-05 21:35:23', 1, 'Removed as part of audit check', 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-08-04', @next_group, 169, 1, 4, 5190.00, 5000.00, NULL, NULL, NULL, NULL, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 1, NULL);


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-07-23', @next_group, 169, 1, 1, 5000.00, 0.00, NULL, 3.800, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-07-23', @next_group, 169, 1, 5, 5190.00, 0.00, NULL, 3.800, 1.500, 12, NULL, NULL, '', 2, 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', '2016-09-05 21:35:23', 1, 'Removed as part of audit check', 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-08-04', @next_group, 169, 1, 4, 5190.00, 5000.00, NULL, NULL, NULL, NULL, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 1, NULL);


SELECT MAX(investor_investments.investment_group)+1 
INTO @next_group
FROM investor_investments;


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2014-07-24', @next_group, 169, 1, 1, 5000.00, 0.00, NULL, 3.800, 1.500, 12, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-07-24', @next_group, 169, 1, 5, 5190.00, 0.00, NULL, 3.800, 1.500, 12, NULL, NULL, '', 2, 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', 1, '2016-02-24 18:01:32', '2016-09-05 21:35:23', 1, 'Removed as part of audit check', 1, 0, NULL);
INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-08-04', @next_group, 169, 1, 4, 5190.00, 5000.00, NULL, NULL, NULL, NULL, NULL, 0, '', 1, 1, '2016-02-24 18:01:32', 0, NULL, 1, '2016-02-24 18:01:32', NULL, NULL, NULL, 1, 1, NULL);


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-03-10', 41, 51, 1, 4, 11035.09, 10000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 17:24:03', 0, NULL, 1, '2016-09-09 17:24:38', NULL, NULL, NULL, 0, 1, NULL);


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-07-11', 41, 51, 1, 5, 10784.82, 0.00, NULL, 3.500, 1.500, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-09 17:45:04', 0, NULL, 1, '2016-09-09 17:45:31', NULL, NULL, NULL, 0, 0, NULL);

UPDATE `investor_investments` SET `amount`=10777.8 WHERE  `investment_id`=984;


UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-19-12 09:15:00', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=221;

UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0, `modified_at`='2016-09-12 18:01:06' WHERE  `investment_id`=220;

UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-12 09:21:43', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=223;


UPDATE investor_investments
SET investor_investments.change_principal=0
WHERE investor_investments.investment_type=3;


UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-12 12:11:36', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=309;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=307;

UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-12 12:13:25', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=308;

UPDATE `investor_investments` SET `status`=2, `removed_at`='2016-09-12 12:16:40', `removed_by`=1, `remove_comment`='Removed as part of audit check' WHERE  `investment_id`=306;
UPDATE `investor_investments` SET `early_exit`=NULL, `change_id`=0 WHERE  `investment_id`=305;


UPDATE `investor_investments` SET `investment_group`=107 WHERE  `investment_id`=1007;
UPDATE `investor_investments` SET `investment_date`='2015-07-11' WHERE  `investment_id`=1006;
UPDATE `investor_investments` SET `amount`=95568.90 WHERE  `investment_id`=1006;

UPDATE `investor_investments` SET `amount`=380.00 WHERE  `investment_id`=1101;

INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-04-07', 305, 40, 1, 3, 562.5, 0.00, NULL, NULL, NULL, NULL, NULL, 634, 'Added as part of audit check', 1, 20, '2016-07-06 09:18:24', 20, '2016-07-06 09:18:31', 20, '2016-07-06 09:18:31', NULL, NULL, NULL, 0, 1, NULL);


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-05-31', 36, 39, 1, 4, 106525.76, 100000.00, NULL, NULL, NULL, NULL, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-13 19:03:22', 0, NULL, 1, '2016-09-13 19:03:43', NULL, NULL, NULL, 0, 1, NULL);

SET @trans_id = LAST_INSERT_ID();

UPDATE `investor_investments` SET `early_exit`='2016-05-31', `change_id`=@trans_id WHERE  `investment_id`=108;


UPDATE `investor_investments` SET `investment_date`='2016-02-06', `change_date`='2016-02-06' WHERE  `investment_id`=918;


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2015-06-10', 73, 85, 1, 5, 15562.50, 0.00, NULL, 3.750, 1.600, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-14 11:06:20', 0, NULL, 1, '2016-09-14 11:06:43', NULL, NULL, NULL, 0, 1, NULL);



INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-06-01', 445, 217, 1, 3, 20250.00, 0.00, NULL, NULL, NULL, NULL, NULL, 797, 'Added as part of audit check', 1, 1, '2016-09-14 13:20:09', 1, '2016-09-14 13:20:24', 1, '2016-09-14 13:20:24', NULL, NULL, NULL, 0, 0, NULL);


INSERT INTO `investor_investments` (`investment_id`, `investment_date`, `investment_group`, `investor_id`, `currency_id`, `investment_type`, `amount`, `change_principal`, `change_date`, `buy_rate`, `commission`, `months`, `early_exit`, `change_id`, `comment`, `status`, `created_by`, `created_at`, `modified_by`, `modified_at`, `authorised_by`, `authorised_at`, `removed_at`, `removed_by`, `remove_comment`, `is_completed`, `is_latest`, `public_comment`) VALUES (NULL, '2016-04-12', 580, 490, 1, 1, 60000.00, 0.00, NULL, 2.750, 1.000, 12, NULL, 0, 'Added as part of audit check', 1, 1, '2016-09-14 13:31:59', 0, NULL, 1, '2016-09-14 13:32:14', NULL, NULL, NULL, 0, 1, NULL);