AnsweredAssumed Answered

Snapshot of contents of a portal's contents

Question asked by AlexR on Jun 27, 2012
Latest reply on Jul 1, 2012 by AlexR

Title

Snapshot of contents of a portal's contents

Post

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? 

Outcomes