Correccion de cosas .w. No estoy seguro que e hecho
This commit is contained in:
@@ -215,4 +215,24 @@ public class MysqlEfectivoDAO extends EfectivoDAO {
|
||||
return updates > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalEfectivo(Caja caja) {
|
||||
int total = 0;
|
||||
try {
|
||||
Connection conn = connectionHolder.getConnection();
|
||||
PreparedStatement ps = conn.prepareStatement("select veinte_mil + diez_mil + cinco_mil + dos_mil + mil + quinientos + cien + cincuenta + diez from efectivos where caja_id = ?");
|
||||
ps.setInt(1, caja.getId());
|
||||
|
||||
ResultSet rs = ps.executeQuery();
|
||||
rs.next();
|
||||
total = rs.getInt(1);
|
||||
|
||||
rs.close();
|
||||
ps.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user