This commit is contained in:
hysn99
2024-04-04 21:33:06 +03:00
parent ce9a40de24
commit a5612d6d9e
2 changed files with 13 additions and 13 deletions

View File

@@ -534,17 +534,6 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
return err return err
} }
var foundIndex int = -1 var foundIndex int = -1
if len(elems) == 0 {
err = ClickItem(frame3, "body > form > table > tbody > tr.altBar.alt-button-bar > th > table > tbody > tr > td:nth-child(1) > button:nth-child(3)", 1)
if err != nil {
return err
}
err = WaitLoad(frame3)
if err != nil {
return err
}
return errors.New("Böyle Bir Kullanıcı Bulunamadı")
}
for j := 0; j < len(elems); j++ { for j := 0; j < len(elems); j++ {
tex, err := elems[j].Text() tex, err := elems[j].Text()
if err != nil { if err != nil {
@@ -563,6 +552,17 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
} }
fmt.Print(elems, tex) fmt.Print(elems, tex)
} }
if foundIndex == -1 {
err = ClickItem(frame3, "body > form > table > tbody > tr.altBar.alt-button-bar > th > table > tbody > tr > td:nth-child(1) > button:nth-child(3)", 1)
if err != nil {
return err
}
err = WaitLoad(frame3)
if err != nil {
return err
}
return errors.New("Böyle Bir Kullanıcı Bulunamadı")
}
if isEmpty == true { if isEmpty == true {
err = ClickItem(frame3, "body > form > table > tbody > tr.altBar.alt-button-bar > th > table > tbody > tr > td:nth-child(1) > button:nth-child(3)", 1) err = ClickItem(frame3, "body > form > table > tbody > tr.altBar.alt-button-bar > th > table > tbody > tr > td:nth-child(1) > button:nth-child(3)", 1)
if err != nil { if err != nil {

View File

@@ -136,10 +136,10 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
err := b.BordroYaz(int(month), int(year), brd, lastItem) err := b.BordroYaz(int(month), int(year), brd, lastItem)
var str string var str string
if err != nil { if err != nil {
emitLog(err.Error()) emitLog("Şube : " + brd.Sube + "Bölüm : " + brd.Bolum + "Kullanıcı Adı: " + brd.AdSoyad + err.Error())
} else { } else {
str = "Şube : " + brd.Sube + "Bölüm : " + brd.Bolum + "işlem başarılı, " str = "Şube : " + brd.Sube + "Bölüm : " + brd.Bolum + "işlem başarılı, " + "Kullanıcı Adı: " + brd.AdSoyad
emitLog(str) emitLog(str)
} }