<?php
date_default_timezone_set('America/Lima');
class cFlujocaja{
	

	function resumen_ingreso($fec1,$fec2,$usu_id,$caj_id){
		$sql="select sum(i.tb_ingreso_imp) as 'total' from tb_ingreso i 
		inner join tb_caja cj on cj.tb_caja_id = i.tb_caja_id
		inner join tb_moneda mon on mon.tb_moneda_id = cj.tb_moneda_id
		where i.tb_ingreso_xac = '1' and i.tb_ingreso_usureg = '$usu_id' and i.tb_caja_id = '$caj_id' and i.tb_ingreso_fec BETWEEN '$fec1' AND '$fec2'  "; 
		$oCado = new Cado();
		$rst=$oCado->ejecute_sql($sql);
		return $rst;
	}
	
	function resumen_egreso($fec1,$fec2,$usu_id,$caj_id){
		$sql="select sum(e.tb_egreso_imp) as 'total' from tb_egreso e
		inner join tb_caja cj on cj.tb_caja_id = e.tb_caja_id
		inner join tb_moneda mon on mon.tb_moneda_id = cj.tb_moneda_id
		where e.tb_egreso_xac = '1' and e.tb_egreso_usureg = '$usu_id' and e.tb_caja_id = '$caj_id' and e.tb_egreso_fec BETWEEN '$fec1' AND '$fec2'  "; 
		$oCado = new Cado();
		$rst=$oCado->ejecute_sql($sql);
		return $rst;
	}
	
	
	
}
?>