The Rambam codifies the halakhic order of inheritance established in Parshas Pinchas through the case of Tzelofchad's daughters, including when daughters inherit and the priority sequence among relatives.
סֵדֶר נְחָלוֹת כָּךְ הִיא. מִי שֶׁמֵּת יִירָשׁוּהוּ בָּנָיו וְהֵם קוֹדְמִין לַכּל. וְהַזְּכָרִים קוֹדְמִין לִנְקֵבוֹת: בְּכָל מָקוֹם אֵין לִנְקֵבָה עִם הַזָּכָר יְרֻשָּׁה. אִם אֵין לוֹ בָּנִים יִירָשֶׁנּוּ אָבִיו. וְאֵין הָאֵם יוֹרֶשֶׁת אֶת בָּנֶיהָ וְדָבָר זֶה מִפִּי הַקַּבָּלָה: וְכָל הַקּוֹדֵם בְּנַחֲלָה יוֹצְאֵי יְרֵכוֹ קוֹדְמִין. לְפִיכָךְ מִי שֶׁמֵּת בֵּין אִישׁ בֵּין אִשָּׁה אִם הִנִּיחַ בֵּן יוֹרֵשׁ הַכּל. לֹא נִמְצָא לוֹ בֵּן לְעוֹלָם מְעַיְּנִין בְּזַרְעוֹ שֶׁל בֵּן אִם נִמְצָא לִבְנוֹ זֶרַע בֵּין זְכָרִים בֵּין נְקֵבוֹת אֲפִלּוּ בַּת בַּת בַּת בְּנוֹ עַד סוֹף הָעוֹלָם הִיא תִּירַשׁ אֶת הַכּל. לֹא נִמְצָא לוֹ זֶרַע בֶּן חוֹזְרִין אֵצֶל הַבַּת. הָיְתָה לוֹ בַּת תִּירַשׁ אֶת הַכּל לֹא נִמְצֵאת לוֹ בַּת בָּעוֹלָם מְעַיְּנִין עַל זֶרַע הַבַּת. אִם נִמְצָא לָהּ זֶרַע בֵּין זְכָרִים בֵּין נְקֵבוֹת עַד סוֹף הָעוֹלָם הוּא יוֹרֵשׁ הַכּל. לֹא נִמְצָא לָהּ זֶרַע בַּת חוֹזֵר הַיְרֻשָּׁה לְאָבִיו. לֹא הָיָה אָבִיו קַיָּם מְעַיְּנִין עַל זֶרַע הָאָב שֶׁהֵן אֲחֵי הַמֵּת. נִמְצָא לוֹ אָח אוֹ זֶרַע אָח יוֹרֵשׁ אֶת הַכּל וְאִם לָאו חוֹזְרִין אֵצֶל אָחוֹת. נִמְצֵאת לוֹ אָחוֹת אוֹ זַרְעָהּ יוֹרֵשׁ הַכּל. וְאִם לֹא נִמְצֵאת לוֹ זֶרַע אַחִים וְלֹא זֶרַע אָחוֹת הוֹאִיל וְאֵין לָאָב זֶרַע תַּחְזֹר הַיְרֻשָּׁה לַאֲבִי הָאָב. לֹא הָיָה אֲבִי הָאָב קַיָּם מְעַיְּנִין עַל זֶרַע שֶׁל אֲבִי הָאָב שֶׁהֵן אֲחֵי אָבִיו שֶׁל מֵת וְהַזְּכָרִים קוֹדְמִין לִנְקֵבוֹת וְזַרְעָן שֶׁל זְכָרִים קוֹדְמִין לִנְקֵבוֹת כְּמוֹ שֶׁהָיָה הַדִּין בְּזַרְעוֹ שֶׁל מֵת עַצְמוֹ. לֹא נִמְצְאוּ אַחִים לְאָבִיו לֹא הֵם וְלֹא זַרְעָן תַּחְזֹר הַיְרֻשָּׁה לַאֲבִי אֲבִי הָאָב. וְעַל הַדֶּרֶךְ הַזֹּאת נַחֲלָה מְמַשְׁמֶשֶׁת וְהוֹלֶכֶת עַד רְאוּבֵן. נִמְצֵאתָ אוֹמֵר הַבֵּן קוֹדֵם לַבַּת וְכָל יוֹצְאֵי יְרֵכוֹ שֶׁל בֵּן קוֹדְמִין לַבַּת וְהַבַּת קוֹדֶמֶת לַאֲבִי אָבִיהָ וְכָל יוֹצְאֵי יְרֵכָהּ קוֹדְמִין לַאֲבִי אָבִיהָ. וַאֲבִי הַמֵּת קוֹדֵם לַאֲחֵי הַמֵּת מִפְּנֵי שֶׁהֵם יוֹצְאֵי יְרֵכוֹ וְהָאָח קוֹדֵם לָאָחוֹת. וְכָל יוֹצְאֵי יְרֵכוֹ שֶׁל אָח קוֹדְמִין לָאָחוֹת. וְאָחוֹת קוֹדֶמֶת לַאֲבִי אָבִיהָ. וְכָל יוֹצְאֵי יְרֵכָהּ קוֹדְמִין לַאֲבִי אָבִיהָ. אֲבִי הָאָב קוֹדֵם לַאֲחֵי הָאָב שֶׁל מֵת וַאֲחֵי אָבִיו קוֹדְמִין לַאֲחוֹת אָבִיו וְכָל יוֹצְאֵי יְרֵכוֹ שֶׁל אֲחֵי אָבִיו קוֹדְמִין לַאֲחוֹת אָבִיו וַאֲחוֹת אָבִיו קוֹדֶמֶת לַאֲבִי אֲבִי אָבִיו שֶׁל מֵת. וְכֵן כָּל יוֹצְאֵי יְרֵכָהּ שֶׁל אֲחוֹת אָבִיו קוֹדְמִין לַאֲבִי אֲבִי אָבִיו. וְעַל דֶּרֶךְ זוֹ הוֹלֵךְ וְעוֹלֶה עַד רֹאשׁ הַדּוֹרוֹת. לְפִיכָךְ אֵין לְךָ אָדָם מִיִּשְׂרָאֵל שֶׁאֵין לוֹ יוֹרְשִׁין:
This is the order of inheritance: When a person dies, his children inherit his estate. They receive priority over everyone else, and the sons receive priority over the daughters. In every situation, a female does not inherit together with a male. If a person does not have children, his father inherits his estate. A mother does not inherit her son's estate. This has been conveyed by the Oral Tradition. With regard to every concept of precedence for an inheritance, a person's blood descendants receive precedence. Therefore, when a person - either a man or a woman - dies and he leaves a son, he inherits everything. If the son is no longer alive, we look to see if the son left descendants. If there are descendants of the son, whether male or female - even the daughter of the daughter of the son's daughter, and this chain can be continued endlessly -that descendant inherits everything. If the son does not have descendants, we return to the deceased's daughter. If there are descendants of the daughter, whether male or female - and this chain can be continued endlessly - that descendant inherits everything. If the son does not have descendants, the estate returns to the deceased's father. If the father is no longer alive, -we look to see if the father left descendants - i.e., the brothers of the deceased. If there is a brother of the deceased or the descendant of a brother, he inherits everything. If there are no brothers, we return and look to see if the deceased had a sister. If there is a sister or the descendant of a sister, that person inherits everything. If there are no descendants of the deceased's brothers or sisters, since there are no descendants of the deceased's father, the estate returns to the deceased's paternal grandfather. If the paternal grandfather is no longer alive, we look to see if the paternal grandfather left descendants - i.e., the uncles or aunts of the deceased. The males receive precedence over the females, and even the descendants of the males receive precedence over the females, as is the law with regard to the descendants of the deceased himself. If there are no uncles or none of their descendants, the estate returns to the deceased's paternal great-grandfather. Following this pattern, the chain of inheritance continues to extend until Reuven the son of Jacob. Thus the order of inheritance is as follows: A son takes precedence over a daughter. Similarly, all of the son's descendants take precedence over the daughter. The daughter takes precedence over her paternal grandfather, and similarly, all her descendants take precedence over her paternal grandfather. The deceased's father takes precedence over the deceased's brothers, because they are the father's descendants. The deceased's brothers take precedence over his sisters. Similarly, all their descendants take precedence over the sister. The deceased's sister takes precedence over her paternal grandfather, and similarly, all her descendants take precedence over her paternal grandfather. The deceased's paternal grandfather takes precedence over the deceased's uncles. The uncles take precedence over the aunts. Indeed, all the uncles' descendants take precedence over the aunts. The aunts take precedence over the deceased's paternal great-grandfather. Indeed, all the aunts' descendants take precedence over the deceased's paternal great-grandfather. This pattern should be continued until the beginning of all generations. Thus, there is no Jew who does not have heirs.