project flow completed
This commit is contained in:
@@ -32,6 +32,17 @@ func (s *Srv) CreateCompany(name, memberNumber, username, password string) error
|
||||
|
||||
return c.Create()
|
||||
}
|
||||
func (s *Srv) EditCompany(id float64, name, memberNumber, username, password string) error {
|
||||
c := &company.Company{
|
||||
Id: int(id),
|
||||
Name: name,
|
||||
MemberNumber: memberNumber,
|
||||
Username: username,
|
||||
Password: password,
|
||||
}
|
||||
|
||||
return c.Edit()
|
||||
}
|
||||
|
||||
func (s *Srv) UploadExcel() string {
|
||||
dialog := application.OpenFileDialog()
|
||||
@@ -51,13 +62,13 @@ type userInfo struct {
|
||||
accountNo string
|
||||
}
|
||||
|
||||
func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
||||
func (s *Srv) Rpa(companyID float64, month float64, year float64) error {
|
||||
type CompanyInfo struct {
|
||||
company *company.Company // float64.Company türünü gömme
|
||||
month float64 // yeni bir alan ekliyoruz
|
||||
year float64
|
||||
}
|
||||
user, err := company.GetCompany(companyName)
|
||||
user, err := company.GetCompany(companyID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -69,15 +80,14 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
||||
|
||||
//todo: readb company details by name
|
||||
b := bot.NewLucaBot()
|
||||
emitLog("Aktarım Başladı")
|
||||
err = b.Login(user, month, year)
|
||||
if err != nil {
|
||||
//todo: inform user about process and errors
|
||||
emitLog("Şifreniz Hatalı")
|
||||
return nil
|
||||
|
||||
}
|
||||
err = b.PayrollPageLogin()
|
||||
|
||||
slog.Debug("inputs", "year", year, "month", month)
|
||||
|
||||
f, err := excelize.OpenFile(s.xlsFileName)
|
||||
@@ -124,8 +134,7 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
||||
key := rows[0][ndx]
|
||||
brd.Ucretler[key], err = decimal.NewFromString(col)
|
||||
if err != nil {
|
||||
//todo: kullanıcıya hata logu ver
|
||||
//veya tekrar okuma denebilinir
|
||||
// emitLog(`excel okunurken sorun oluştu`)
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
@@ -145,6 +154,7 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
||||
}
|
||||
|
||||
}
|
||||
emitLog("İşlem Tamamlandı")
|
||||
b.ClosingBrowserFromExternalLink()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user