file transfer occurred #1

Open
huseyindervis wants to merge 19 commits from bordorBot into main
4 changed files with 47 additions and 14 deletions
Showing only changes of commit cb0008f870 - Show all commits

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -5,11 +5,11 @@
"info": {
"0000": {
"ProductVersion": "0.1.0",
"CompanyName": "My Company",
"FileDescription": "My Product Description",
"LegalCopyright": "© now, My Company",
"ProductName": "My Product",
"Comments": "This is a comment"
"CompanyName": "Notitek Yazılım A.Ş",
"FileDescription": "Bordro Robotu",
"LegalCopyright": "© now, Notitek Yazılım A.Ş",
"ProductName": "Bordro Robotu",
"Comments": "Luca Bordro Robotu"
}
}
}

View File

@@ -37,6 +37,9 @@ func (l *Luca) ErrFunc(index bool) {
CloseBrowser(l.Browser)
}
}
func (l *Luca) ClosingBrowserFromExternalLink() {
CloseBrowser(l.Browser)
}
func VerifyCaptcha(page *rod.Page) error {
captcha := "#captcha"
picturePreparation := []string{
@@ -216,6 +219,7 @@ func (l *Luca) Login(company company.Company, month float64, year float64) error
if err != nil {
return err
}
Wait(frame4, 1500)
companiesSelectBoxWait, err := frame4.Element("#SirketCombo > option")
if err != nil {
return err
@@ -257,6 +261,7 @@ func (l *Luca) Login(company company.Company, month float64, year float64) error
if err != nil {
return err
}
Wait(frame4, 1500)
companiesSelectYear, err := frame4.Elements("#DonemCombo > option")
if err != nil {
@@ -396,7 +401,11 @@ func (l *Luca) PayrollPageLogin() error {
if err != nil {
return err
}
Wait(newPage, 200)
err = frame.WaitLoad()
if err != nil {
return err
}
Wait(newPage, 500)
err = ClickItem(frame, "#apy1000m0i1ITD", 1)
if err != nil {
return err
@@ -429,6 +438,11 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
}
isyeriId := ""
bolumId := ""
err = WaitLoad(frame3)
if err != nil {
return err
}
Wait(frame3, 1000)
bordroCompanySelectBox, err := frame3.Elements("#isyeriId > option")
for j := 0; j < len(bordroCompanySelectBox); j++ {
text, err := bordroCompanySelectBox[j].Text()
@@ -441,7 +455,14 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
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.WaitLoad()
if err != nil {
@@ -456,9 +477,14 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
if err != nil {
return err
}
Wait(frame3, 1000)
bordroDepartmentSelectBox, err := frame3.Elements("#bolumId > option")
element, err = frame3.Element("#bolumId > option")
if err != nil {
return err
}
element.WaitLoad()
err = WaitLoad(frame3)
if err != nil {
return err
}
@@ -474,6 +500,9 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
}
fmt.Print(text, value)
}
if bolumId == "" {
return errors.New("Kayıtlı Bölüm Bulunamadı")
}
element, err = frame3.Element("#bolumId")
if err != nil {
@@ -496,7 +525,7 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
if err != nil {
return err
}
Wait(frame3, 1000)
var isEmpty bool = false
//var targetID string
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 {
return err
}
l.ErrFunc(lastItem)
return errors.New("Böyle Bir Kullanıcı Bulunamadı")
}
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 {
return err
}
l.ErrFunc(lastItem)
return errors.New("Yazılı Bordro Var Lütfen Siliniz")
}
if foundIndex != -1 && isEmpty == false {
@@ -579,6 +606,8 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
return err
}
err = el.Input(v.String())
//el.Eval(`this.dispatchEvent(new KeyboardEvent('keydown', {'key': 'Enter'}))`)
break
}
}
fmt.Print(v, k)
@@ -610,7 +639,6 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
return err
}
l.ErrFunc(lastItem)
return errors.New(saveButtonMessage)
}
@@ -634,6 +662,5 @@ func (l *Luca) BordroYaz(month, year int, b *LucaBordro, lastItem bool) error {
if err != nil {
return err
}
l.ErrFunc(lastItem)
return err
}

View File

@@ -52,6 +52,7 @@ type userInfo struct {
}
func (s *Srv) Rpa(companyName string, month float64, year float64) error {
emitLog("")
type CompanyInfo struct {
company *company.Company // float64.Company türünü gömme
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())
return err
}
if len(rows) < 3 {
emitLog("Boş Excel Yüklemesi")
b.ClosingBrowserFromExternalLink()
return nil
}
if rows[0][0] == "" {
rows = rows[1:]
}
@@ -139,13 +145,13 @@ func (s *Srv) Rpa(companyName string, month float64, year float64) error {
emitLog(str)
} else {
str += "işlem başarılı, "
str += "Şube : " + brd.Sube + "Bölüm : " + brd.Bolum + "işlem başarılı, "
emitLog(str)
}
}
b.ClosingBrowserFromExternalLink()
return nil
}