feat: update payment input logic to use valor_atual instead of valor_produtos and improve logging details
This commit is contained in:
@@ -724,6 +724,7 @@ class SigaAutomation:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
valor_produtos = await page.locator("#f_valorproduto").input_value()
|
valor_produtos = await page.locator("#f_valorproduto").input_value()
|
||||||
|
valor_atual = await page.locator("#f_valoratual").input_value()
|
||||||
except Exception:
|
except Exception:
|
||||||
valor_produtos = "0,00"
|
valor_produtos = "0,00"
|
||||||
|
|
||||||
@@ -736,19 +737,26 @@ class SigaAutomation:
|
|||||||
if meio_pag == "DINHEIRO":
|
if meio_pag == "DINHEIRO":
|
||||||
field = page.locator("#f_valorcaixa")
|
field = page.locator("#f_valorcaixa")
|
||||||
await mouse.click_element(field)
|
await mouse.click_element(field)
|
||||||
await mouse.human_type(field, valor_produtos)
|
await mouse.human_type(field, valor_atual)
|
||||||
logger.info(f"💰 Dinheiro no Caixa: {valor_produtos}")
|
logger.info(f"💰 Valor Produtos: {valor_produtos}")
|
||||||
|
logger.info(f"💰 Dinheiro no Caixa: {valor_atual}")
|
||||||
|
|
||||||
elif meio_pag == "PIX":
|
elif meio_pag == "PIX":
|
||||||
field = page.locator("#f_valorQrcodePix")
|
field = page.locator("#f_valorcaixa") #f_valorQrcodePix
|
||||||
await mouse.click_element(field)
|
await mouse.click_element(field)
|
||||||
await mouse.human_type(field, valor_produtos)
|
await mouse.human_type(field, valor_atual)
|
||||||
logger.info(f"💰 PIX/QRCode: {valor_produtos}")
|
logger.info(f"💰 Valor Produtos: {valor_produtos}")
|
||||||
|
logger.info(f"💰 PIX/QRCode lançado como DINHEIRO: {valor_atual}")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
field = page.locator("#f_valorcaixa")
|
field = page.locator("#f_valorcaixa")
|
||||||
await mouse.click_element(field)
|
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}")
|
logger.info(f"💰 Fallback dinheiro: {valor_produtos}")
|
||||||
|
|
||||||
|
|
||||||
async def _confirm(self):
|
async def _confirm(self):
|
||||||
page = self.page
|
page = self.page
|
||||||
mouse = self.mouse
|
mouse = self.mouse
|
||||||
|
|||||||
Reference in New Issue
Block a user