left join tab_dept_modul on tab_modul.id=tab_dept_modul.id_modul
left join tab_dept_staff on tab_dept_modul.id_dept=tab_dept_staff.id_dept where tab_dept_staff.id_staff='ranti';
update tab_order_item tor left join tab_layanan tl on tor.id_layanan=tl.id set
tor.hpp=tl.hpp, tor.ppn=tl.ppn, tor.markup=tl.markup, tor.hppn=tl.hppn,tor.update_time=NOW() where tor.waktu_input>='2015-03-11 00:00:00' and tor.waktu_input<NOW() and tl.id_jenis_layanan='FAR' and tor.hpp IS NULL;
update tab_transaksi_item tti
left join tab_transaksi tt on tti.id_transaksi=tt.id left join tab_order tor on tt.id_order=tor.id left join tab_order_item t_ori on tor.id=t_ori.id_order and tti.id_layanan=t_ori.id_layanan set tti.hpp=t_ori.hpp, tti.ppn_q=t_ori.ppn, tti.markup=t_ori.markup, tti.hppn=t_ori.hppn, tti.update_time=NOW() where tti.tanggal>'2015-03-11 00:00:00' and tti.hpp is null ;