Mishkat al-Masabih 733
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: إِذَا رَأَيْتُمْ مَنْ يَبِيعُ أَوْ يَبْتَاعُ فِي الْمَسْجِدِ فَقُولُوا: لَا أَرْبَحَ اللَّهُ تِجَارَتَكَ. وَإِذَا رَأَيْتُمْ مَنْ يَنْشُدُ فِيهِ ضَالَّةً فَقُولُوا: لَا رَدَّ اللَّهُ عَلَيْكَ . رَوَاهُ التِّرْمِذِيُّ وَالدَّارِمِيُّ
And from Abu Hurayrah, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said: "When you see someone selling or buying in the mosque, say: 'May Allah not make your trade profitable.' And when you see someone calling out in it for a lost animal, say: 'May Allah not return it to you.'" Reported by at-Tirmidhi and ad-Darimi.