All perfect praise be to Allah; The Lord of The Worlds; and may His blessings and peace be upon our Prophet Mohammad and upon all his family and companions.
According to Islamic Jurisprudence, an establishment`s profit is divided in line with each partner`s capital. However, if they have agreed that each partner`s profit differs from their share in the capital, then that is valid as well.
So long as the two partners have agreed on dividing the profits in accordance with their shares in the establishment`s capital, it is imperative that they abide by that. Therefore, if any of them has withdrawn a part of his capital while the housing project was being executed and no profits materialized, then his percentage of the profit drops in accordance with his share in the capital. However, if the profits materialized before making that withdrawal, then he takes his share in them in accordance with his share in the capital. Please refer to the book entitled" Rawdat Attalibeen(5/144)" by al-Imam An-Nawawi.
Accordingly, if the flats of the housing project haven`t been sold, as mentioned in the above question, then the profits of the partner who made the withdrawal from his balance decrease in accordance with his share in the remaining capital. And Allah knows best.