public function LeerResFinGas() { global $db; //$db->debug=true; $ovariacion = new AsientoVariacionDao(); $ovariacion->sig_cuenta=$cuentasinceros; $ovariacion->ano_presupuesto=$this->ano_presupuesto; $totalvariacion=$ovariacion->LeerSaldoGastos(); $sql=" select (select COALESCE(sum((enero+febrero+marzo+abril+ mayo+junio+julio+agosto+septiembre+octubre +noviembre+diciembre)),000) as montoglobalgas from {$this->_table} where codemp='{$this->codemp}' and ano_presupuesto='{$this->ano_presupuesto}' and ({$this->_table}.sig_cuenta like '411%' or {$this->_table}.sig_cuenta like '405%' or {$this->_table}.sig_cuenta like '412%'))+({$totalvariacion}) as montoresfinanIng"; $rs =$db->Execute($sql); // ver($sql); if($rs==true) { return $rs->fields["montoresfinaning"]; } else { return false; } }