chri55w / QuickBooks-Timer

Savantech QuickBooks Timer - Issue Tracking / Wiki ONLY
3 stars 0 forks source link

Employee Time Log Templates - Duplicates #65

Closed chri55w closed 8 years ago

chri55w commented 8 years ago

Duplicate entries found in the EMPLOYEE_TIME_LOG_TEMPLATE table - constraint on the two columns EMPLOYEE_REFNUM and TIME_LOG_TEMPLATE_ID required?

All duplicates contain the same names too however the LAST_USED changes with each one

image

chri55w commented 8 years ago

@BradConnor had you noticed this at all? as you have 4 duplicates of the same timer from Thursday?

BradConnor commented 8 years ago

Yes – that was the day I was having all sorts of problems with the program!

chri55w commented 8 years ago

@BradConnor Any idea what actions might have caused the duplication?

BradConnor commented 8 years ago

I was creating a new timer log of the same template type for the next day, but it was resetting the existing timer logs from the previous day and creating a duplicate. That’s activities, though, not timer types. Maybe I was trying to create a generic type then customising it for each activity. Sorry, can’t really remember the exact sequence

chri55w commented 8 years ago

Issue seems to occur during the CreateTimeLog function, or at least is worsened by it in that where two EMPLOYEE_TIME_LOG_TEMPLATEs match on the first two columns any attempt to create a new TimeLog causes a new EMPLOYEE_TIME_LOG_TEMPLATE to be created.

chri55w commented 8 years ago

Modified the EMPLOYEE_TIME_LOG TABLE to use a Unique constraint on the EMPLOYEE_REFNUM and TIME_LOG_TEMPLATE_ID columns and changed the function creating new Time Log Templates to prevent the user while showing a useful error message

Possibly fixed but requires further testing

chri55w commented 8 years ago

issue has not appeared since testing began, appears to be fixed