123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746 |
- from time import sleep
- # from subprocess import check_output
- import re
- import subprocess as sp
- import keyboard as kb
- import pyautogui as gui
- import pywinctl as gw
- sleep_ = 0.025
- CONF = 0.8
- mentor_user = 'utilizator: Master'
- def fill_394():
- sp.run('D:/py_scripts/intocmit/repr.py', shell=True)
- def fill_S1000():
- sp.run('D:/py_scripts/intocmit/int_bil.py', shell=True)
- def sign_bil():
- sp.run('D:/py_scripts/intocmit/bil_automatition.py', shell=True)
- def abbr(short_cut, abbr_message, modifier=''):
- shc = short_cut
- if shc == ' ':
- shc1 = re.findall(' +', shc)
- gui.typewrite(abbr_message)
- gui.press('left', presses=1, interval=sleep_)
- gui.press('backspace', presses=1, interval=sleep_)
- gui.press('right', presses=1, interval=sleep_)
- else:
- shc1 = re.findall('[a-z0-9-]*', shc)
- gui.press('backspace', presses=len(''.join(shc1) + modifier), interval=sleep_)
- # gui.typewrite(abbr_message, interval=sleep_)
- kb.write(abbr_message)
- def mv_mouse_right():
- size = gui.size()
- gui.moveTo(size[0] / 1.01, size[1] / 1.01)
- # gui.click()
- def mv_mouse_cent():
- size = gui.size()
- gui.moveTo(size[0] / 2, size[1] / 2)
- def _printer(func):
- def wrapper():
- print(func.__doc__, 'h_key performed')
- return func()
- return wrapper
- @_printer
- def remake_journal():
- '''refacere jurnal'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindow()
- # print(active_win)
- if mentor_user.upper() in active_win.title.upper():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('enter')
- mv_mouse_cent()
- # gui.move(1, 1)
- @_printer
- def cash_registry():
- '''registru de casa'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.upper() in active_win.upper():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- # print('please activate Window LISTE')
- @_printer
- def clients_ron():
- '''clienti datornici'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('right', 1, sleep_)
- gui.press('down', 11, sleep_)
- gui.press('return', 2, sleep_)
- mv_mouse_cent()
- @_printer
- def verif_balance():
- '''balanta de verificare'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 1, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 2, sleep_)
- mv_mouse_cent()
- @_printer
- def suppliers_ron():
- '''furnizori neachitati'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- # gui.press('down', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 9, sleep_)
- gui.press('return', 2, sleep_)
- mv_mouse_cent()
- @_printer
- def suppliers_val():
- '''furnizori neachitati eur'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 1, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 10, sleep_)
- gui.press('return', 2, sleep_)
- mv_mouse_cent()
- @_printer
- def bank_registry_ron():
- '''registru de banca lei'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def bank_registry_val():
- '''registru de banca val'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 6, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- def close_all_lists():
- '''inchide toate ferestrele'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/inchidere.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- mv_mouse_cent()
- @_printer
- def h_key14():
- '''*****'''
- abbr('`+p', r'61103989', modifier='`')
- @_printer
- def h_key15():
- '''*****'''
- abbr('`+m+p', r'RM1984ent', modifier='`')
- @_printer
- def account_details():
- '''fisa de cont'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/contabile.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 6, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def stocks():
- '''stocuri pe gestiuni'''
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/stocuri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 8, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def product_details():
- '''fisa de magazie'''
- # _date_ = gui.getWindow('LISTE - ')
- # # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/stocuri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('right', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def salary():
- '''stat de plata'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/salarii.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 1, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 3, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- # gui.move(1, 1)
- @_printer
- def sinteza():
- '''contr. sinteza'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/salarii.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 19, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- # gui.move(1, 1)
- @_printer
- def h_key18():
- '''stocuri la terti'''
- try:
- sleep(sleep_)
- dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if dummy.title in active_win:
- try:
- dummy.activate()
- except Exception as e:
- print(str(e))
- mv_mouse_right()
- kb.press_and_release('control+f10')
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('down', 12, sleep_)
- gui.press('return', 2, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def buy_journal():
- '''jurnal de cumparari'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 12, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- # print('please activate Window LISTE')
- @_printer
- def sell_journal():
- '''jurnal de vanzari'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/trezorerie.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 13, sleep_)
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- # print('please activate Window LISTE')
- @_printer
- def h_key19():
- '''pe cont 602.02'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('602.02', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key20():
- '''pe cont 602.08'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('602.08', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key21():
- '''pe cont 542'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('542', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key22():
- '''pe cont 627'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- # gui.press('tab', 2, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('627', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key23():
- '''pe cont 604'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('604', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key24():
- '''pe cont 628'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('628', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def partner_balance():
- '''fisa partener'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 1, sleep_)
- gui.press('down', 7, sleep_)
- gui.press('return', 2, sleep_)
- mv_mouse_cent()
- @_printer
- def partner_balance2():
- '''balanta partener'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/parteneri.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 9, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def assets():
- '''registru imobilizari'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y = gui.locateCenterOnScreen(f'mentor_imgs/miscari.png', confidence=CONF)
- sleep(0.1)
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- gui.press('down', 14, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('down', 5, sleep_)
- # gui.press('return', 1, sleep_)
- mv_mouse_cent()
- @_printer
- def h_key26():
- '''service structuri'''
- try:
- sleep(sleep_)
- declaratii = gw.getWindowsWithTitle('DECLARATII')[0]
- if declaratii.title in gw.getActiveWindowTitle():
- mv_mouse_right()
- kb.press_and_release('control+f10')
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key27():
- '''vector d100'''
- try:
- sleep(sleep_)
- declaratii = gw.getWindowsWithTitle('DECLARATII')[0]
- if declaratii.title in gw.getActiveWindowTitle():
- mv_mouse_right()
- kb.press_and_release('control+f10')
- gui.press('right', 1, sleep_)
- gui.press('down', 1, sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- @_printer
- def h_key28():
- '''pe cont 623'''
- try:
- sleep(sleep_)
- # dummy = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- # active_win = gw.getActiveWindowTitle()
- # if dummy.title in active_win:
- # try:
- # dummy.activate()
- # except Exception as e:
- # print(str(e))
- mv_mouse_right()
- gui.press('return', 1, sleep_)
- gui.press('down', 4, sleep_)
- gui.press('return', 1, sleep_)
- gui.press('backspace', 1, sleep_)
- gui.typewrite('623', interval=sleep_)
- gui.press('return', 1, sleep_)
- except IndexError:
- print('please activate Window LISTE')
- def open_decl():
- try:
- chrome_win = gw.getWindowsWithTitle('https://decl.anaf.mfinante.gov.ro/WAS6DUS/ - Google Chrome')[0]
- active_win = gw.getActiveWindowTitle()
- if chrome_win.title in active_win:
- chrome_win.activate()
- butt_x_y = gui.locateCenterOnScreen('ciel_imgs/decl_choose_file.png', confidence=CONF)
- sleep(0.1)
- # pos_x_y = gui.position()
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- mv_mouse_cent()
- # gui.moveTo(pos_x_y[0], pos_x_y[1])
- except IndexError:
- pass
- def send_decl():
- try:
- chrome_win = gw.getWindowsWithTitle('https://decl.anaf.mfinante.gov.ro/WAS6DUS/ - Google Chrome')[0]
- active_win = gw.getActiveWindowTitle()
- if chrome_win.title in active_win:
- chrome_win.activate()
- butt_x_y = gui.locateCenterOnScreen('ciel_imgs/decl_send.png', confidence=CONF)
- sleep(0.1)
- # pos_x_y = gui.position()
- if butt_x_y:
- gui.click(butt_x_y[0], butt_x_y[1])
- mv_mouse_cent()
- # gui.moveTo(pos_x_y[0], pos_x_y[1])
- except IndexError:
- pass
- @_printer
- def mod_salary():
- '''mudul salarii'''
- # mentor_win = gw.getWindowsWithTitle(mentor_user, condition=gw.Re.CONTAINS)[0]
- active_win = gw.getActiveWindowTitle()
- if mentor_user.title() in active_win.title():
- # mentor_win.activate()
- butt_x_y_1 = gui.locateCenterOnScreen(f'mentor_imgs/modul_salarii.png', confidence=CONF)
- butt_x_y_2 = gui.locateCenterOnScreen(f'mentor_imgs/modul_mentor.png', confidence=CONF)
- sleep(0.01)
- if butt_x_y_1:
- gui.click(butt_x_y_1[0], butt_x_y_1[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- elif butt_x_y_2:
- gui.click(butt_x_y_2[0], butt_x_y_2[1])
- pos_x_y = gui.position()
- gui.moveTo(pos_x_y[0], pos_x_y[1])
- mv_mouse_cent()
- def ment():
- gui.press('backspace', 3)
- gui.typewrite('RM1984ent')
- # kb.register_hotkey('alt+`', h_key2())
- def main():
- '''quick_hotkey_ab'''
- kb.register_hotkey('`+r+j', remake_journal, args=()) # refacere jurnal
- kb.register_hotkey('`+r+c', cash_registry, args=()) # casa
- kb.register_hotkey('`+c+z', clients_ron, args=()) # clienti
- kb.register_hotkey('`+b+v', verif_balance, args=()) # balanta
- kb.register_hotkey('`+r+f', suppliers_ron, args=()) # ron furnizori
- kb.register_hotkey('`+d+x', suppliers_val, args=()) # deviza furnizori
- # kb.register_hotkey('`+d+c', h_key11, args=()) # clienti valuta
- kb.register_hotkey('`+r+b', bank_registry_ron, args=()) # ron banca
- kb.register_hotkey('`+v+j', bank_registry_val, args=()) # valuta banca
- kb.register_hotkey('`+p', h_key14, args=()) # digi
- # kb.register_hotkey('`+m+p', h_key15, args=()) # mentor
- # kb.add_hotkey('`+m+p', abbr, args=('`+m+p', r'RM1984ent', '`'))
- kb.add_abbreviation('mnt', 'RM1984ent')
- kb.add_abbreviation('vau', 'abc0nsu1t1ng')
- # kb.add_word_listener('mnt', lambda: ment(), triggers=['t'])
- kb.register_hotkey('`+f+x', account_details, args=()) # fisa cont
- kb.register_hotkey('`+s+g', stocks, args=()) # stoc gestiuni
- kb.register_hotkey('`+s+m', product_details, args=()) # stoc fisa magazie
- kb.register_hotkey('`+s+t', h_key18, args=()) # stocuri la terti
- kb.register_hotkey('`+f+t', partner_balance, args=()) # fisa terti
- kb.register_hotkey('`+b+p', partner_balance2, args=()) # fisa terti
- kb.register_hotkey('`+s+p', salary, args=()) # stat de plata
- kb.register_hotkey('`+c+s', sinteza, args=()) # contributii sinteza
- kb.register_hotkey('control+alt+o', fill_394, args=())
- kb.register_hotkey('shift+f11', sign_bil, args=())
- kb.register_hotkey('control+q', close_all_lists, args=()) # close all lists
- kb.register_hotkey('`+t+x', buy_journal, args=()) # jurnal de cumparari
- kb.register_hotkey('`+t+v', sell_journal, args=()) # jurnal de vanzari
- # kb.register_hotkey('control+`', open_decl, args=()) # deschide declaratie
- # kb.register_hotkey('shift+`', send_decl, args=()) # trimite declaratii
- # kb.register_hotkey('`+m+n', sp.run, args=(['C:/Users/vnc-console/WinMent/MENTOR.exe']))
- kb.register_hotkey('`+9', mod_salary, args=()) # modul salarii
- kb.register_hotkey('`+b+p', partner_balance2, args=()) # balanta parteneri
- kb.register_hotkey('`+m+u', assets, args=()) # imobilizari
- # kb.register_hotkey('alt+3', h_key28, args=()) # 623, 766
- # kb.register_hotkey('alt+4', h_key22, args=()) # 627
- # kb.register_hotkey('alt+5', h_key21, args=()) # 542
- # kb.register_hotkey('alt+6', h_key23, args=()) # 604, 508.01
- # kb.register_hotkey('alt+7', h_key24, args=()) # 628
- # kb.register_hotkey('alt+8', h_key19, args=()) # 602.02
- # kb.register_hotkey('alt+9', h_key20, args=()) # 602.08
- # kb.register_hotkey('alt+win+c', lambda: sp.run('C:/Users/vnc-console/Winment_declaratii/DeclaratiiR.exe', shell=True))
- # kb.wait()
- if __name__ == '__main__':
- main()
- # ment_app = gw.getWindowsWithTitle('MENTOR', condition=gw.Re.CONTAINS)[0]
- # ment_app.activate()
- # sleep(5)
- # print(gw.getActiveWindowTitle())
- # print('anyad')
|