Correccion de cosas .w. No estoy seguro que e hecho

This commit is contained in:
Daniel Cortes
2019-01-07 19:32:12 -03:00
parent 3ee8b5c10c
commit cb4ef76861
18 changed files with 1267 additions and 613 deletions

View File

@@ -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;
}
}