Let $K$ be a quadratic number field. Let $R$ be an order of $K$, i.e. a subring of $K$ which is a free $\mathbb{Z}$-module of rank $2$. Let $D$ be the discriminant of $R$. Let $x_1,\cdots, x_n$ be a sequence of elements of $R$. We denote by $[x_1,\cdots,x_n]$ the $\mathbb{Z}$-submodule of $R$ generated by $x_1,\cdots, x_n$. By this question, $R = [1, \omega]$, where $\omega = (D + \sqrt D)/2$. Let us consider the following problem.
Problem Let $I, J$ be non-zero ideals of $R$. Under what condition does there exist $\alpha \in K$ such that $I = \alpha J$?
This problem is clearly important in computing the ideal class group of $R$(see this question for the definition of the ideal class group of $R$). Clearly we can assume that $I$ and $J$ are primitive ideals(see this question for the definition of a primitive ideal).
My question Is the following proposition correct? If yes, how do you prove it?
Proposition Let $I = [a, k + \omega], J = [b, l + \omega]$ be primitive ideals of $R$, where $a,k, b, l \in \mathbb{Z}, a \gt 0, b \gt 0$. Let $\theta = (k + \omega)/a, \tau = (l + \omega)/b$. Then there exists $\alpha \in K$ such that $I = \alpha J$ if and only if there exist integers $p, q, r, s$, such that $ps - qr = \pm 1$ and $\theta = (p\tau + q)/(r\tau + s)$. Moreover, if we require an additional condition $N(\alpha) \gt 0$, then we must replace $ps - qr = \pm 1$ by $ps - qr = 1$. Note that when $D \lt 0$, this condition is automatically satisfied, i.e. $N(\alpha) \gt 0$ for all non-zero $\alpha \in K$.