Surely, the Smith normal form does it all. But if you need a more concrete condition, here is one.
Let $X$ be the set of all $n\times n$ minors of $A$, and let $Y$ be the set of all $n\times n$ minors of $(A|B)$. Then the equivalent condition is that $\gcd(X)=\gcd(Y)$. Indeed, this condition is equivalent if the system is in the Smith form, and moreover it is preserved by $SL(n,\mathbb Z)$-transforms.