gen_firms.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # coding: utf-8
  2. from time import sleep
  3. import pywinctl as gw
  4. from winmentor import (
  5. WinMentor,
  6. Mentorutils,
  7. check_list, # @UnusedImport,
  8. file_open
  9. )
  10. def parse_and_close(title):
  11. close_title = gw.getWindowsWithTitle(title)[0]
  12. # gw.Win32Window.close()
  13. close_title.activate()
  14. sleep(2)
  15. close_title.close()
  16. exclude = [
  17. 'ASIVP',
  18. # 'ASOBS',
  19. # 'COMELECT',
  20. 'DATAV'
  21. # 'ECOPROT',
  22. # 'JOART',
  23. # 'CRH',
  24. # 'RECYC',
  25. # 'QCLINIC'
  26. ]
  27. head = [
  28. 'Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs'
  29. ]
  30. my_headers = [
  31. 'Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs',
  32. 'VAT', 'VAT FINAL', 'INC_TAX', 'DIV_TAX', 'CAS', 'CASS', 'SAL_TAX', 'CAM', 'CA', 'PN', 'month'
  33. ]
  34. mentor = WinMentor()
  35. utils = Mentorutils()
  36. # office = mentor.filtered_firmlist('/firme.db', headers=head, ban=exclude)
  37. # utils.gen_turnover('turn_over', 'to', office, n_headers=my_headers)
  38. office = mentor.filtered_firmlist(headers=head, ban=exclude)
  39. utils.gen_tax_payable('xlsx/firm_list', 'lista_firme', office, m_month=None, n_headers=head, firm_list=True)
  40. # utils.gen_txt('/firme.db', 'lista_cf.txt', _attr_index=1)
  41. # check_list('lista_cf.txt')
  42. file_open('xlsx/firm_list.xlsm')