File: /www/exchange2/sql/archive/2016-08-03-512.sql
UPDATE `manual_transactions` SET `transref_list`='',`specific_deductible`=1,`deductible_amount`=28.94 WHERE `manual_transaction_id`=25379 LIMIT 1;
UPDATE `manual_transactions` SET `transref_list`='',`specific_deductible`=1,`deductible_amount`=28.94 WHERE `manual_transaction_id`=25380 LIMIT 1;
INSERT INTO manual_transactions(manual_transaction_id,transaction_type,debtor_id,originator_id,amount,status,interface,transaction_date,reconcile_ref,reconcile_status)
SELECT null, 16, debtor_id, originator_id, deductible_amount, 1, interface, transaction_date,25380,1
FROM manual_transactions
WHERE manual_transaction_id=25380 AND specific_deductible=1 AND deductible_amount<>0;
SET @sd_id = LAST_INSERT_ID();
UPDATE `manual_transactions` SET `transref_list`=@sd_id WHERE `manual_transaction_id`=25380 LIMIT 1;