You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.3 KiB
Go
59 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"mercury/src/db"
|
|
"mercury/src/finance"
|
|
"mercury/src/hr"
|
|
"mercury/src/mercury"
|
|
"os"
|
|
"path"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
s := time.Now()
|
|
|
|
// local/update run
|
|
//updateTelecom()
|
|
//processQBARReport()
|
|
|
|
// regular run
|
|
//updateInsightData()
|
|
|
|
updateTimesheets()
|
|
|
|
f := time.Now()
|
|
log.Println(f.Sub(s).Milliseconds())
|
|
|
|
}
|
|
|
|
func updateTelecom() {
|
|
icx := mercury.NewInterconnect()
|
|
icx.PseudoInit()
|
|
icx.InsightDBConnector.ExecuteSqlScript(db.NewRunner("create-mercury-telecomVoice-table.sql", db.MercuryDatabaseName))
|
|
icx.UpdateVerizonReports()
|
|
}
|
|
|
|
func updateTimesheets() {
|
|
hr.UpdateEmployeeDirectory(path.Join("/home/dtookey/work/clarity-reporting/paycor_dir", "EmployeeRoster.csv"))
|
|
hr.UpdateTimesheetReport("/home/dtookey/work/clarity-reporting/paycor")
|
|
}
|
|
|
|
func updateInsightData() {
|
|
icx := mercury.NewInterconnect()
|
|
icx.Init()
|
|
icx.UpdateUsers()
|
|
icx.UpdateTimeEntries()
|
|
}
|
|
|
|
func processQBARReport() {
|
|
reportBase := os.Getenv("mercury_qb_path")
|
|
log.Printf("Searching for documents in %s\n", reportBase)
|
|
if len(reportBase) == 0 {
|
|
log.Fatalln("please set the mercury_qb_path env var. we don't know where to look otherwise")
|
|
}
|
|
finance.GenerateArAgingReport(reportBase)
|
|
//finance.ProcessTrialBalances(reportBase, "./updateInsightData.csv")
|
|
}
|