2024-07-16 20:40:02.970778
SELECT company_code, CONCAT(company_code, ' - ', company_name) company_name 
            FROM group_companies  ORDER BY default_company DESC

2024-07-16 20:40:02.975310
SELECT db_name FROM group_companies 
                WHERE company_code = 'UKE'

2024-07-16 20:40:02.976660
SELECT employee_code, 
                    CONCAT(employee_code, ' - ', initials, ' ', last_name) name 
            FROM uke_db.0_employee_master  ORDER BY name

2024-07-16 20:40:03.43702
SELECT id, value_code, value_name FROM 0_list_values  
		WHERE list_code= 'PETTY_CASH_TYPES' AND value_code='I_OWE_YOU'

2024-07-16 20:40:08.122219
SELECT DISTINCT al.id, al.tran_date, al.amount, al.batch_complete, al.project_name, al.type, al.trans_no, al.pay_trans_date, 
                    al.pay_amount 
                FROM ( (SELECT iou.id, iou.tran_date, iou.amount, iou.batch_complete, pm.description project_name, p.expense_source type, p.id trans_no, 
                p.payment_date pay_date, p.amount pay_amount 
            FROM 0_i_owe_you iou 
                LEFT JOIN 0_i_owe_you_payments p  
                    ON p.iou_id = iou.id 
                        AND p.expense_source = '107' 
                LEFT JOIN 0_projects_master pm 
                    ON pm.project_id = iou.project_id
            WHERE iou.tran_date >= '2024-01-01' 
                AND iou.tran_date <= '2024-07-31'
                AND iou.approval_status IN (30, 130) AND iou.batch_complete = 0  AND iou.employee_code ='KTS016' AND iou.type ='951' AND iou.batch_no = 0   ORDER BY iou.batch_no, iou.id ) UNION (SELECT iou.id, iou.tran_date, iou.amount, iou.batch_complete, pm.description project_name, bt.type, bt.trans_no, bt.trans_date pay_date,
                bt.amount*-1 pay_amount
            FROM 0_i_owe_you iou 
                LEFT JOIN 0_bank_trans bt 
                    ON iou.id = bt.person_id 
                        AND bt.type IN('230', '232')  
                LEFT JOIN 0_projects_master pm 
                    ON pm.project_id = iou.project_id
                LEFT JOIN 0_list_values dp 
                    ON dp.id = pm.department_id
                LEFT JOIN 0_employee_master em 
                    ON em.employee_code = iou.employee_code   
            WHERE iou.tran_date >= '2024-01-01' 
                AND iou.tran_date <= '2024-07-31'
                AND iou.approval_status IN (30, 130) AND iou.batch_complete = 0  AND iou.employee_code ='KTS016' AND iou.type ='951' AND iou.batch_no = 0   ORDER BY iou.batch_no, iou.id ) ) al 
                WHERE 1 = 1 
                ORDER_BY al.id, al.tran_date, al.pay_date, al.trans_no

2024-07-16 20:40:08.124659
rollback

2024-07-16 20:42:54.455595
SELECT company_code, CONCAT(company_code, ' - ', company_name) company_name 
            FROM group_companies  ORDER BY default_company DESC

2024-07-16 20:42:54.457615
SELECT db_name FROM group_companies 
                WHERE company_code = 'UKE'

2024-07-16 20:42:54.458881
SELECT employee_code, 
                    CONCAT(employee_code, ' - ', initials, ' ', last_name) name 
            FROM uke_db.0_employee_master  ORDER BY name

2024-07-16 20:42:54.514203
SELECT id, value_code, value_name FROM 0_list_values  
		WHERE list_code= 'PETTY_CASH_TYPES' AND value_code='I_OWE_YOU'

2024-07-16 20:42:57.800817
SELECT DISTINCT al.id, al.tran_date, al.amount, al.batch_complete, al.project_name, al.type, al.trans_no, al.pay_date, 
                    al.pay_amount 
                FROM ( (SELECT iou.id, iou.tran_date, iou.amount, iou.batch_complete, pm.description project_name, p.expense_source type, p.id trans_no, 
                p.payment_date pay_date, p.amount pay_amount 
            FROM 0_i_owe_you iou 
                LEFT JOIN 0_i_owe_you_payments p  
                    ON p.iou_id = iou.id 
                        AND p.expense_source = '107' 
                LEFT JOIN 0_projects_master pm 
                    ON pm.project_id = iou.project_id
            WHERE iou.tran_date >= '2024-01-01' 
                AND iou.tran_date <= '2024-07-31'
                AND iou.approval_status IN (30, 130) AND iou.batch_complete = 0  AND iou.employee_code ='KTS016' AND iou.type ='951' AND iou.batch_no = 0   ORDER BY iou.batch_no, iou.id ) UNION (SELECT iou.id, iou.tran_date, iou.amount, iou.batch_complete, pm.description project_name, bt.type, bt.trans_no, bt.trans_date pay_date,
                bt.amount*-1 pay_amount
            FROM 0_i_owe_you iou 
                LEFT JOIN 0_bank_trans bt 
                    ON iou.id = bt.person_id 
                        AND bt.type IN('230', '232')  
                LEFT JOIN 0_projects_master pm 
                    ON pm.project_id = iou.project_id
                LEFT JOIN 0_list_values dp 
                    ON dp.id = pm.department_id
                LEFT JOIN 0_employee_master em 
                    ON em.employee_code = iou.employee_code   
            WHERE iou.tran_date >= '2024-01-01' 
                AND iou.tran_date <= '2024-07-31'
                AND iou.approval_status IN (30, 130) AND iou.batch_complete = 0  AND iou.employee_code ='KTS016' AND iou.type ='951' AND iou.batch_no = 0   ORDER BY iou.batch_no, iou.id ) ) al 
                WHERE 1 = 1 
                ORDER_BY al.id, al.tran_date, al.pay_date, al.trans_no

2024-07-16 20:42:57.803124
rollback

