feat: add automated account validation and complete payment history and complement fields in RPA process

This commit is contained in:
2026-08-09 17:58:28 -04:00
parent 735703a600
commit 3186bd5ee1

View File

@@ -487,10 +487,30 @@ class SigaDespesasAutomation:
target_option_text=expense.forma_pagamento,
)
# 10.1 Validação do Campo Conta (Auto-preenchido pelo SIGA ao escolher DÉBITO AUTOMÁTICO)
conta_field = page.locator("#s2id_f_conta .select2-chosen, #s2id_f_id_conta .select2-chosen").first
if await conta_field.is_visible():
conta_text = await conta_field.inner_text()
logger.info(f"🏦 Validando Campo Conta: '{conta_text.strip()}' (Esperado: 10130 - BRADESCO...)")
# 11. N° Documento (Pagamento)
logger.info(f"1️⃣1️⃣ Preenchendo N° Documento (Pagamento): '{expense.numero_doc_pagamento}'...")
num_doc_pag_input = page.locator("#f_documento2").first
await mouse.human_type(num_doc_pag_input, expense.numero_doc_pagamento)
await human_delay(300, 600)
# 12. Histórico (Pagamento)
logger.info("1️⃣2️⃣ Selecionando Histórico (Pagamento)...")
await self._select_select2_option(
container_selector="#s2id_f_historico",
search_text="012",
target_option_text="012 - DESP.BANCÁRIAS",
)
# 13. Complemento (Pagamento)
logger.info(f"1️⃣3️⃣ Preenchendo Complemento (Pagamento): '{expense.complemento}'...")
complemento_pag_input = page.locator("#f_complemento").first
await mouse.human_type(complemento_pag_input, expense.complemento)
await human_delay(500, 1000)
logger.info("✨ Todos os campos foram preenchidos e validados com sucesso!")