feat: Boleto with its bank account and Ajuste Fino by SKU in Tiny (Marcus, 12/11)

A faturado montador order's installments carry the bank account set in
TINY_BOLETO_ACCOUNT as their meioPagamento (Tiny v3 parcelas[]), so Tiny
does not pick another account. The Ajuste Fino line resolves the product
from its code (TINY_SKU_TREATMENT, default DTFIMP.AJF.UN) unless a numeric
TINY_PRODUCT_TREATMENT is set; the connection check verifies it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-12 10:52:46 -03:00
parent 5ca6792221
commit 973cd87b36
6 changed files with 129 additions and 34 deletions

View File

@@ -30,6 +30,7 @@ team's users may not cancel by hand), and read back to show it is.
import argparse
import base64
import json
import os
import sys
import time
from datetime import datetime
@@ -165,6 +166,15 @@ def conferir(orders, out):
method, result = tiny.configured_pickup(orders)
ok &= result == 'ok'
out(f"{tiny.PICKUP_SETTING} (retirada): {result} {method.get('nome') if method else ''}".rstrip())
legacy = os.environ.get('TINY_PRODUCT_TREATMENT', '').strip()
try:
result = tiny.configured_treatment(orders)
except tiny.TinyError as exc:
result = str(exc)[:200]
ok &= result == 'ok'
label = 'TINY_PRODUCT_TREATMENT' if legacy.isdigit() else tiny.TREATMENT_SKU_SETTING
code = legacy if legacy.isdigit() else tiny.treatment_sku()
out(f'{label} (Ajuste Fino): {result} {code}'.rstrip())
out(f"{tiny.STATUS_UPDATES_SETTING}: {'ligado' if tiny.status_updates() else 'desligado'}")
for name, result in tiny.check(orders=orders).items():
if name in ('pedidos', 'contatos'):