Hi,
This is repeating request as I see it. This type of accounting is similar to the jobbing requirement for contractors. See the following brief discussion. Contractor Jobs
Perhaps someone has already got a similar erpnext configuration setup already could help here.