Snapshot of contents of a portal's contents
I have a table of Employees. This table contains data relating to their conditions of employment (salary, hours per day, ....). I have a table of Payslips (related to Employees) which contains the monthly payslips of employees. When I create a new Payslip, a script copies over the relevant data from Employees table to the Payslip table (so that if the employee's salary changes, for example, it doesn't change past payslips). So far, so good.
The problem is that some of the data relating to an employee is in another table calles Allowances. The reason that there is a separate table for this is that there can be a large number of allowances (housing, transport, ....) and that new types of allowances can be created at any time, so I can't really hard code these allowances as fields in the Employee table. When I create a new Paysiip for an employee I need to know what his allowances were at that point in time and create a snapshot of them, so that if the allowances change, it doesn't change past payslips.
Any ideas how to do this elegantly?