345. Even if the defendant ceases to carry out compensatory work before completing it, the amount of the sums due at the time of the agreement is reduced proportionately to the ratio between the number of hours already carried out or paid and the number of hours to be carried out at the time of the agreement.