worker-automate-hub 0.5.90__py3-none-any.whl → 0.5.92__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1042,6 +1042,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1042
1042
  quantidade = item['novaQuantidade']
1043
1043
  preco = item['novoPreco']
1044
1044
  descricao = item['descricao']
1045
+ console.print(quantidade, preco, descricao)
1045
1046
 
1046
1047
  if 'arla' in descricao.lower():
1047
1048
  item_arla = True
@@ -1079,26 +1080,87 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1079
1080
  )
1080
1081
 
1081
1082
 
1082
- console.print("Clicando sobre a lupa para inserir o almoxarifado...\n")
1083
- app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
1084
- main_window = app["TFrmIncluiItemPreVenda"]
1085
- main_window.set_focus()
1086
- panel_TGroup_Box= panel_TPage.child_window(class_name="TPanel", found_index=2)
1087
- lupa_almoxarifaco = panel_TPage.child_window(class_name="TDBIBitBtn", found_index=1)
1088
- lupa_almoxarifaco.click()
1089
- console.print("Lupa clicado com sucesso inserindo a descrição do almoxarifado...\n")
1083
+ i = 0
1084
+ while i < 3:
1085
+ try:
1086
+ console.print("Clicando sobre a lupa para inserir o almoxarifado...\n")
1087
+ app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
1088
+ main_window = app["TFrmIncluiItemPreVenda"]
1089
+ main_window.set_focus()
1090
+ panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
1091
+ lupa_almoxarifaco = panel_TPage.child_window(class_name="TDBIBitBtn", found_index=1)
1092
+ lupa_almoxarifaco.click()
1093
+ console.print("Lupa clicado com sucesso inserindo a descrição do almoxarifado...\n")
1094
+ await worker_sleep(2)
1095
+
1096
+ dialog_buscar = is_window_open_by_class("TfrmDialogBuscaGeral", "TfrmDialogBuscaGeral")
1097
+ if dialog_buscar["IsOpened"] == True:
1098
+ break
1099
+ else:
1100
+ console.print("Não foi possivel abrir a janela de Busca Geral")
1101
+ i = i+1
1102
+ except Exception as e:
1103
+ console.print(f"Erro ao abrir a janela de Busca Geral: {e}")
1104
+ i = i+1
1105
+
1106
+
1107
+ if i == 3:
1108
+ retorno = f"Não foi possivel abrir a tela para buscar pelo item do produto na seleção do almoxarifado - \nEtapas Executadas:\n{steps}"
1109
+ return RpaRetornoProcessoDTO(
1110
+ sucesso=False,
1111
+ retorno=retorno,
1112
+ status=RpaHistoricoStatusEnum.Falha,
1113
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
1114
+ )
1090
1115
 
1091
1116
  app = Application().connect(class_name="TfrmDialogBuscaGeral", timeout=60)
1092
1117
  main_window = app["TfrmDialogBuscaGeral"]
1093
1118
  main_window.set_focus()
1094
1119
 
1095
- field_descricao_almoxarifado = main_window.child_window(class_name="TEdit", found_index=0)
1096
- field_descricao_almoxarifado.set_edit_text(descricao)
1097
- await worker_sleep(2)
1120
+ console.print("Buscando a mercadoria baseado na descrição...\n")
1121
+ rect = main_window.rectangle()
1122
+ center_x = (rect.left + rect.right) // 2
1123
+ center_y = (rect.top + rect.bottom) // 2
1098
1124
 
1099
- btn_lupa_pesquisar = main_window.child_window(class_name="TBitBtn", found_index=0)
1100
- btn_lupa_pesquisar.click()
1101
- await worker_sleep(2)
1125
+ pyautogui.moveTo(center_x, center_y)
1126
+ pyautogui.click(coords=(center_x, center_y))
1127
+ await worker_sleep(1)
1128
+ send_keys("^({HOME})")
1129
+
1130
+ last_line = ''
1131
+ while True:
1132
+ with pyautogui.hold('ctrl'):
1133
+ pyautogui.press('c')
1134
+ await worker_sleep(1)
1135
+ with pyautogui.hold('ctrl'):
1136
+ pyautogui.press('c')
1137
+
1138
+ win32clipboard.OpenClipboard()
1139
+ descricao_item = win32clipboard.GetClipboardData().strip()
1140
+ win32clipboard.CloseClipboard()
1141
+
1142
+ if last_line == descricao_item:
1143
+ retorno = f"Todos os itens percorridos e não foi possivel encontrar a descrição condizente a {descricao} \nEtapas Executadas:\n{steps}"
1144
+ return RpaRetornoProcessoDTO(
1145
+ sucesso=False,
1146
+ retorno=retorno,
1147
+ status=RpaHistoricoStatusEnum.Falha,
1148
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
1149
+ )
1150
+ else:
1151
+ if descricao.lower() in descricao_item.lower():
1152
+ break
1153
+ else:
1154
+ last_line = descricao_item
1155
+ pyautogui.press('down')
1156
+
1157
+ # field_descricao_almoxarifado = main_window.child_window(class_name="TEdit", found_index=0)
1158
+ # field_descricao_almoxarifado.set_edit_text(descricao)
1159
+ # await worker_sleep(2)
1160
+
1161
+ # btn_lupa_pesquisar = main_window.child_window(class_name="TBitBtn", found_index=0)
1162
+ # btn_lupa_pesquisar.click()
1163
+ # await worker_sleep(2)
1102
1164
 
1103
1165
  main_window.set_focus()
1104
1166
  send_keys("%o")
@@ -1107,8 +1169,8 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1107
1169
  app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
1108
1170
  main_window = app["TFrmIncluiItemPreVenda"]
1109
1171
  main_window.set_focus()
1110
- panel_TGroup_Box= panel_TPage.child_window(class_name="TPanel", found_index=2)
1111
- natureza_oper_select = panel_TPage.child_window(class_name="TDBIComboBox", found_index=0)
1172
+ panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
1173
+ natureza_oper_select = panel_TGroup_Box.child_window(class_name="TDBIComboBox", found_index=0)
1112
1174
  natureza_oper_select.click()
1113
1175
  await worker_sleep(1)
1114
1176
  set_combobox("||List", "5656 - VENDA DE COMB OU LUB ADQ DE TERCEIRO C/ FIN S/ ESTOQUE")
@@ -1120,7 +1182,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1120
1182
  panel_TPage_Control= main_window.child_window(class_name="TcxPageControl", found_index=0)
1121
1183
  panel_tabSheet = panel_TPage_Control.child_window(class_name="TcxTabSheet", found_index=0)
1122
1184
 
1123
- field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=9)
1185
+ field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=8)
1124
1186
  console.print("Inserindo a quantidade de Itens...\n")
1125
1187
  field_quantidade.set_edit_text(quantidade)
1126
1188
  await worker_sleep(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.90
3
+ Version: 0.5.92
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -38,7 +38,7 @@ worker_automate_hub/tasks/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
38
38
  worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ0DLLOVJOfNTq_z9krx_t25Q,29476
39
39
  worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=S6QC4xhuo0pB5FjaUJZNMm1LIgEjpjifReCTBDqxH-U,11719
40
40
  worker_automate_hub/tasks/jobs/descartes.py,sha256=0bMCJ0xIcK8TLSgjF6taAbGFLMU-sGDVFIhUYSRtrbg,41092
41
- worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=rVmnceZGyEWGPBu0mt0igRcfTT8o76OyXr7Be2lOb4k,87477
41
+ worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=bP8iHxLwFAtFbPdpwIztZC9VczM9kTvN2JEG1DOroLw,90961
42
42
  worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=dKkf22nH5gp3RErq5u0UzRsKyJ81fc6ZZ4vLtUuMwHA,21002
43
43
  worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=8WmKe4-MRtzHobXz2S4YBDNN8alfawkC-BBlRY-mn1g,1726
44
44
  worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM3Fje-rkyx5tjwmRy4lyL8,25300
@@ -77,7 +77,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
77
77
  worker_automate_hub/utils/util.py,sha256=HMUXpF3bf0v2ntbols6d8xr-okDcRsnV54WAwLAPpJ0,162317
78
78
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=iYpOs7fb7C3bY61QHySr00xlDNzrrCP0zaexOpBPuaQ,31930
79
79
  worker_automate_hub/worker.py,sha256=CT-poyP1ZYvubArYsnnNd9oJ53SPaDwgr6p6keS3nI4,6248
80
- worker_automate_hub-0.5.90.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
81
- worker_automate_hub-0.5.90.dist-info/METADATA,sha256=OTiRmJX5quu2-Uol6I_V8F8jfefpXTedhg-rL-_1ulE,2894
82
- worker_automate_hub-0.5.90.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
83
- worker_automate_hub-0.5.90.dist-info/RECORD,,
80
+ worker_automate_hub-0.5.92.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
81
+ worker_automate_hub-0.5.92.dist-info/METADATA,sha256=OkDDTWYj1huVvfTSn-nAi9YHXuzVnblXVhD1Vt8ung4,2894
82
+ worker_automate_hub-0.5.92.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
83
+ worker_automate_hub-0.5.92.dist-info/RECORD,,