fixed weird issue with timesheet reports

master
dtookey 3 years ago
parent 9a1adf6bd3
commit 7cf9b6cca8

@ -155,11 +155,13 @@ func UpdateTimesheetReport(pathlike string) {
connector.ExecuteSqlScript(tableWipe)
for _, hourReport := range *reports {
log.Printf("Updating database\n")
log.Printf("Updating database with " + hourReport.FilePath + "\n")
db.BlockUpdate[HourReportLine](connector, db.MercuryDatabaseName, "update-mercury-hrPaycorHours.sql", hourReport.ReportLines)
log.Printf("Updates finished.\n")
}
tableJoin := db.NewRunner("update-mercury-hrPaycorHoursJoin.sql", db.MercuryDatabaseName)
connector.ExecuteSqlScript(tableJoin)
tablePrune := db.NewRunner("update-mercury-hrTimesheetsCleanup.sql", db.MercuryDatabaseName)
connector.ExecuteSqlScript(tablePrune)
}
@ -254,6 +256,9 @@ func fileNameToSQLDate(fileName string) string {
year := parts[0][:4]
month := parts[0][4:6]
date := parts[0][6:8]
if fileName == "/home/dtookey/work/clarity-reporting/paycor/20230205_Paycor_W5.csv" {
fmt.Printf("woops")
}
return fmt.Sprintf("%s-%s-%s", year, month, date)
}

Loading…
Cancel
Save