private void disminuirVentaBD(itemVenta venta){
        itemVenta it= venta;
        int diferencia= it.getCantVenta();
        ArrayList<HashMap> lista= new ArrayList<>();
        try{
            String sql="SELECT s.fact_ent AS num_fact, s.id_prod, p.nombre_prod, s.can_venta AS cant_venta, s.ttl_cont, s.can_venta AS diferencia "
                        + "FROM salida s, producto p "
                        + "WHERE s.fact_sal='"+it.getFactSal()+"' AND s.id_prod='"+it.getIdProd()+"' AND s.id_prod=p.id_prod";
            Statement st= this.getConexion().createStatement();
            ResultSet res=st.executeQuery(sql);
            ResultSetMetaData rsmt= res.getMetaData();
            while(res.next()){
                HashMap map= new HashMap();
                for (int i = 1; i < rsmt.getColumnCount(); i++) {
                    map.put(rsmt.getColumnLabel(i), res.getString(i));
                }
                lista.add(map);
            }
            for(int i=0; i<lista.size(); i++) {
                HashMap map1= lista.get(i);
                int cantMap1= Integer.valueOf(map1.get("cant_venta")+"");
                diferencia-=cantMap1;
                if(diferencia<=0){
                    int aux= cantMap1+diferencia;
                    sql="UPDATE salida SET can_venta="+aux+", ttl_cont=+"+(it.getTtlCont()*aux)
                        + " WHERE fact_sal='"+it.getFactSal()+"' AND fact_ent='"+map1.get("num_fact")+"' "
                        + "AND id_prod='"+it.getIdProd()+"'";
                    st.execute(sql);
                    for (int j = i+1; j < lista.size(); j++) {
                        sql="DELETE FROM salida WHERE fact_sal='"+it.getFactSal()+
                            "' AND fact_ent='"+lista.get(j).get("num_fact")+"' AND id_prod='"+it.getIdProd()+"'";
                        st.execute(sql);
                    }
                    break;
                }
                
            }
        }catch(SQLException e){
            System.err.println(e.getMessage());
        }
    }