"[It was] ordained for you," meaning: it was obligated upon you, "when death approaches one of you," the verse. Qatadah said: 'The good' refers to wealth. Allah, Blessed and Exalted is He, commanded in this verse that a bequest be made for the parents and near relatives, then that was abrogated in Surat An-Nisa' by His saying: "for his parents, to each one of them is a sixth," and the bequest became reserved for those who do not inherit, whether they are close relatives or distant.
Muhammad said: And His saying, Mighty and Majestic is He, "as a duty upon the righteous," the word "duty" (haqqan) is in the accusative case (mansub) based on the meaning: that was a duty upon them.