Sunan an-Nasa'i, Volume 2, Book 13, Hadith 1347 (DarusSalam)

It was narrated from 'Ata bin Abi Marwan, from his father, that: Ka'b swore to him: "By Allah (SWT) Who parted the sea for Musa, we find in the Tawrah that when Dawud, the Prophet of Allah, finished his prayer, he would say: 'Allahumma Aslih li dinya-lladhi ja'altahu li ismatan wa aslih li dunyaya-llati ja'alta fiha ma'ashi, Allahumma inni a-udhu biridaka min sakhatik wa a-udhu bi'afwika min naqmatika wa a-udhu bika mink, la mani' lima a'taita wa la mu'tia lima mana'ta wa la yanfa'u dhal-jaddi minka al-jadd (O Allah, set straight my religious commitment that You have made a protection for me, and set straight my worldly affairs which You have made a means of my livelihood. O Allah, I seek refuge in Your pleasure from Your wrath, and I seek refuge in Your forgiveness from Your punishment, and I seek refuge in You from You. None can withhold what you have given and none can give what you have withheld, and no wealth or fortune can avail the man of wealth and fortune before You.)'" He said: "And Ka'b told me that Suhaib told him that Muhammad used to say (these words) when he had finished praying.'"

أَخْبَرَنَا عَمْرُو بْنُ سَوَّادِ بْنِ الأَسْوَدِ بْنِ عَمْرٍو، قَالَ حَدَّثَنَا ابْنُ وَهْبٍ، قَالَ أَخْبَرَنِي حَفْصُ بْنُ مَيْسَرَةَ، عَنْ مُوسَى بْنِ عُقْبَةَ، عَنْ عَطَاءِ بْنِ أَبِي مَرْوَانَ، عَنْ أَبِيهِ، أَنَّ كَعْبًا، حَلَفَ لَهُ بِاللَّهِ الَّذِي فَلَقَ الْبَحْرَ لِمُوسَى إِنَّا لَنَجِدُ فِي التَّوْرَاةِ أَنَّ دَاوُدَ نَبِيَّ اللَّهِ صلى الله عليه وسلم كَانَ إِذَا انْصَرَفَ مِنْ صَلاَتِهِ قَالَ ‏"‏ اللَّهُمَّ أَصْلِحْ لِي دِينِي الَّذِي جَعَلْتَهُ لِي عِصْمَةً وَأَصْلِحْ لِي دُنْيَاىَ الَّتِي جَعَلْتَ فِيهَا مَعَاشِي اللَّهُمَّ إِنِّي أَعُوذُ بِرِضَاكَ مِنْ سَخَطِكَ وَأَعُوذُ بِعَفْوِكَ مِنْ نِقْمَتِكَ وَأَعُوذُ بِكَ مِنْكَ لاَ مَانِعَ لِمَا أَعْطَيْتَ وَلاَ مُعْطِيَ لِمَا مَنَعْتَ وَلاَ يَنْفَعُ ذَا الْجَدِّ مِنْكَ الْجَدُّ ‏.‏ قَالَ وَحَدَّثَنِي كَعْبٌ أَنَّ صُهَيْبًا حَدَّثَهُ أَنَّ مُحَمَّدًا صلى الله عليه وسلم كَانَ يَقُولُهُنَّ عِنْدَ انْصِرَافِهِ مِنْ صَلاَتِهِ ‏.‏

sunnah.com