ERP Payroll- Pay to employee from money deposited by employee

My company has peculiar issue when paying interns. Interns will be depositing money for six months and every month stipend for intern will be paid from the money interns deposit. The salary slip should show their deposited money and their payment. In the successive months deposited money will be reduced. Can this be implemented? If so how to implement.