In a decree of divorce or annulment, the court shall determine the rights of both spouses in a claim for reimbursement as provided by Subchapter E, Chapter 3, and shall apply equitable principles to:
(1) determine whether to recognize the claim after taking into account all the relative circumstances of the spouses; and
(2) order a division of the claim for reimbursement, if appropriate, in a manner that the court considers just and right, having due regard for the rights of each party and any children of the marriage.