The proprietor is only bound, in the former case, to pay to the heirs of the undertaker the value of the work that has already been done and that of the materials already prepared, proportionably to the price agreed on, in case such work and materials may be useful to him.