bug fixed
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -5,11 +5,11 @@
|
|||||||
"info": {
|
"info": {
|
||||||
"0000": {
|
"0000": {
|
||||||
"ProductVersion": "0.1.0",
|
"ProductVersion": "0.1.0",
|
||||||
"CompanyName": "My Company",
|
"CompanyName": "Notitek Yazılım A.Ş",
|
||||||
"FileDescription": "My Product Description",
|
"FileDescription": "Bordro Robotu",
|
||||||
"LegalCopyright": "© now, My Company",
|
"LegalCopyright": "© now, Notitek Yazılım A.Ş",
|
||||||
"ProductName": "My Product",
|
"ProductName": "Bordro Robotu",
|
||||||
"Comments": "This is a comment"
|
"Comments": "Luca Bordro Robotu"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,9 @@ func (l *Luca) ErrFunc(index bool) {
|
|||||||
CloseBrowser(l.Browser)
|
CloseBrowser(l.Browser)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (l *Luca) ClosingBrowserFromExternalLink() {
|
||||||
|
CloseBrowser(l.Browser)
|
||||||
|
}
|
||||||
func VerifyCaptcha(page *rod.Page) error {
|
func VerifyCaptcha(page *rod.Page) error {
|
||||||
captcha := "#captcha"
|
captcha := "#captcha"
|
||||||
picturePreparation := []string{
|
picturePreparation := []string{
|
||||||
@@ -216,6 +219,7 @@ func (l *Luca) Login(company company.Company, month float64, year float64) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Wait(frame4, 1500)
|
||||||
companiesSelectBoxWait, err := frame4.Element("#SirketCombo > option")
|
companiesSelectBoxWait, err := frame4.Element("#SirketCombo > option")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -257,6 +261,7 @@ func (l *Luca) Login(company company.Company, month float64, year float64) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Wait(frame4, 1500)
|
||||||
companiesSelectYear, err := frame4.Elements("#DonemCombo > option")
|
companiesSelectYear, err := frame4.Elements("#DonemCombo > option")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -396,7 +401,11 @@ func (l *Luca) PayrollPageLogin() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
Wait(newPage, 200)
|
err = frame.WaitLoad()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
Wait(newPage, 500)
|
||||||
err = ClickItem(frame, "#apy1000m0i1ITD", 1)
|
err = ClickItem(frame, "#apy1000m0i1ITD", 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -429,6 +438,11 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
}
|
}
|
||||||
isyeriId := ""
|
isyeriId := ""
|
||||||
bolumId := ""
|
bolumId := ""
|
||||||
|
err = WaitLoad(frame3)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
Wait(frame3, 1000)
|
||||||
bordroCompanySelectBox, err := frame3.Elements("#isyeriId > option")
|
bordroCompanySelectBox, err := frame3.Elements("#isyeriId > option")
|
||||||
for j := 0; j < len(bordroCompanySelectBox); j++ {
|
for j := 0; j < len(bordroCompanySelectBox); j++ {
|
||||||
text, err := bordroCompanySelectBox[j].Text()
|
text, err := bordroCompanySelectBox[j].Text()
|
||||||
@@ -441,7 +455,14 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if isyeriId == "" {
|
||||||
|
return errors.New("Kayıtlı Şube Bulunamadı")
|
||||||
|
}
|
||||||
|
err = WaitLoad(frame3)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
Wait(frame3, 500)
|
||||||
element, err := frame3.Element("#isyeriId")
|
element, err := frame3.Element("#isyeriId")
|
||||||
element.WaitLoad()
|
element.WaitLoad()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -456,9 +477,14 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Wait(frame3, 1000)
|
||||||
bordroDepartmentSelectBox, err := frame3.Elements("#bolumId > option")
|
bordroDepartmentSelectBox, err := frame3.Elements("#bolumId > option")
|
||||||
element, err = frame3.Element("#bolumId > option")
|
element, err = frame3.Element("#bolumId > option")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
element.WaitLoad()
|
element.WaitLoad()
|
||||||
|
err = WaitLoad(frame3)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -474,6 +500,9 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
}
|
}
|
||||||
fmt.Print(text, value)
|
fmt.Print(text, value)
|
||||||
}
|
}
|
||||||
|
if bolumId == "" {
|
||||||
|
return errors.New("Kayıtlı Bölüm Bulunamadı")
|
||||||
|
}
|
||||||
|
|
||||||
element, err = frame3.Element("#bolumId")
|
element, err = frame3.Element("#bolumId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -496,7 +525,7 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Wait(frame3, 1000)
|
||||||
var isEmpty bool = false
|
var isEmpty bool = false
|
||||||
//var targetID string
|
//var targetID string
|
||||||
elems, err := frame3.Elements("#scroll > table > tbody > tr > td[id^='tcKimlikNo']")
|
elems, err := frame3.Elements("#scroll > table > tbody > tr > td[id^='tcKimlikNo']")
|
||||||
@@ -521,7 +550,6 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
l.ErrFunc(lastItem)
|
|
||||||
return errors.New("Böyle Bir Kullanıcı Bulunamadı")
|
return errors.New("Böyle Bir Kullanıcı Bulunamadı")
|
||||||
}
|
}
|
||||||
for j := 0; j < len(elems); j++ {
|
for j := 0; j < len(elems); j++ {
|
||||||
@@ -551,7 +579,6 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
l.ErrFunc(lastItem)
|
|
||||||
return errors.New("Yazılı Bordro Var Lütfen Siliniz")
|
return errors.New("Yazılı Bordro Var Lütfen Siliniz")
|
||||||
}
|
}
|
||||||
if foundIndex != -1 && isEmpty == false {
|
if foundIndex != -1 && isEmpty == false {
|
||||||
@@ -579,6 +606,8 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = el.Input(v.String())
|
err = el.Input(v.String())
|
||||||
|
//el.Eval(`this.dispatchEvent(new KeyboardEvent('keydown', {'key': 'Enter'}))`)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Print(v, k)
|
fmt.Print(v, k)
|
||||||
@@ -610,7 +639,6 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
return err
|
return err
|
||||||
|
|
||||||
}
|
}
|
||||||
l.ErrFunc(lastItem)
|
|
||||||
return errors.New(saveButtonMessage)
|
return errors.New(saveButtonMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -634,6 +662,5 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
l.ErrFunc(lastItem)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ type userInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
||||||
|
emitLog("")
|
||||||
type CompanyInfo struct {
|
type CompanyInfo struct {
|
||||||
company *company.Company // float64.Company türünü gömme
|
company *company.Company // float64.Company türünü gömme
|
||||||
month float64 // yeni bir alan ekliyoruz
|
month float64 // yeni bir alan ekliyoruz
|
||||||
@@ -100,6 +101,11 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
|||||||
slog.Error(err.Error())
|
slog.Error(err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(rows) < 3 {
|
||||||
|
emitLog("Boş Excel Yüklemesi")
|
||||||
|
b.ClosingBrowserFromExternalLink()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if rows[0][0] == "" {
|
if rows[0][0] == "" {
|
||||||
rows = rows[1:]
|
rows = rows[1:]
|
||||||
}
|
}
|
||||||
@@ -139,13 +145,13 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
|
|||||||
emitLog(str)
|
emitLog(str)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
str += "işlem başarılı, "
|
str += "Şube : " + brd.Sube + "Bölüm : " + brd.Bolum + "işlem başarılı, "
|
||||||
emitLog(str)
|
emitLog(str)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
b.ClosingBrowserFromExternalLink()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user