The latter matches to have the balls / the guts.
In the former one, the boules are more the glandes (the expression avoir les glandes exists too).
Despite being originally the same balls we were referring to earlier, these glandes/boules are generally understood nowadays to be the ganglia or the tonsils (on each top sides of the neck).
Someone who a les boules is annoyed, upset, worried, scared, frustrated because of something unpleasant has happened or is feared.
On the other hand (no pun intended 😉 ), Reverso translation “tu as les balles ?” would only make sense on a tennis court, a golf course, or similar 😉