TYPE=TRIGGERS
triggers='CREATE DEFINER=`root`@`%` TRIGGER `tbl_emp_payroll_adv_after_ins_tr` AFTER INSERT ON `tbl_emp_payroll_adv`
\n  FOR EACH ROW
\nBEGIN
\nIF (@DISABLE_TRIGGERS IS NULL) then
\nUPDATE tbl_emp_advance SET 
\nemp_advance_paid=emp_advance_paid+NEW.emp_adv_value,
\nemp_advance_remain=emp_advance_value-emp_advance_paid
\nWHERE emp_advance_id=NEW.emp_adv_list_id;
\nEND IF;
\nEND' 'CREATE DEFINER=`root`@`%` TRIGGER `tbl_emp_payroll_adv_after_del_tr` AFTER DELETE ON `tbl_emp_payroll_adv`
\n  FOR EACH ROW
\nBEGIN
\nIF (@DISABLE_TRIGGERS IS NULL) then
\nUPDATE tbl_emp_advance SET 
\nemp_advance_paid=emp_advance_paid-OLD.emp_adv_value,
\nemp_advance_remain=emp_advance_value-emp_advance_paid
\nWHERE emp_advance_id=OLD.emp_adv_list_id;
\nEND IF;
\nEND'
sql_modes=1344274434 1344274434
definers='root@%' 'root@%'
client_cs_names='cp1256' 'cp1256'
connection_cl_names='cp1256_general_ci' 'cp1256_general_ci'
db_cl_names='cp1256_general_ci' 'cp1256_general_ci'
