feat: update payment input logic to use valor_atual instead of valor_produtos and improve logging details

This commit is contained in:
2026-03-29 06:27:53 -04:00
parent a8bdbde453
commit b366d914a4

View File

@@ -724,6 +724,7 @@ class SigaAutomation:
try:
valor_produtos = await page.locator("#f_valorproduto").input_value()
valor_atual = await page.locator("#f_valoratual").input_value()
except Exception:
valor_produtos = "0,00"
@@ -736,19 +737,26 @@ class SigaAutomation:
if meio_pag == "DINHEIRO":
field = page.locator("#f_valorcaixa")
await mouse.click_element(field)
await mouse.human_type(field, valor_produtos)
logger.info(f"💰 Dinheiro no Caixa: {valor_produtos}")
await mouse.human_type(field, valor_atual)
logger.info(f"💰 Valor Produtos: {valor_produtos}")
logger.info(f"💰 Dinheiro no Caixa: {valor_atual}")
elif meio_pag == "PIX":
field = page.locator("#f_valorQrcodePix")
field = page.locator("#f_valorcaixa") #f_valorQrcodePix
await mouse.click_element(field)
await mouse.human_type(field, valor_produtos)
logger.info(f"💰 PIX/QRCode: {valor_produtos}")
await mouse.human_type(field, valor_atual)
logger.info(f"💰 Valor Produtos: {valor_produtos}")
logger.info(f"💰 PIX/QRCode lançado como DINHEIRO: {valor_atual}")
else:
field = page.locator("#f_valorcaixa")
await mouse.click_element(field)
await mouse.human_type(field, valor_produtos)
await mouse.human_type(field, valor_atual)
logger.info(f"💰 Valor Produtos: {valor_produtos}")
logger.info(f"💰 Fallback dinheiro: {valor_produtos}")
async def _confirm(self):
page = self.page
mouse = self.mouse