auto: 일일 백업 2026-07-25 02:00

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-07-25 02:00:04 +09:00
parent 5410009bea
commit a13133aabe
172 changed files with 3461 additions and 4295 deletions
@@ -88,42 +88,49 @@ def _format_balance_mismatch(info: dict, sms_b: int, whoo_b: int, diff: int, pre
kind_word = "누적사용액" if side == "liability" else "잔액"
actual_whoo_b = info.get("actual_whooing_balance", whoo_b)
payment_offset = info.get("liability_payment_offset", 0) or 0
if payment_offset and actual_whoo_b != whoo_b:
whoo_line = (
f"• 후잉: <b>{actual_whoo_b:,}원</b>"
f" + 카드대금 보정 <b>{payment_offset:,}원</b>"
f" → <b>{whoo_b:,}원</b>"
)
matched_word = "후잉(카드대금 보정 후)"
else:
whoo_line = f"• 후잉: <b>{whoo_b:,}원</b>"
matched_word = "후잉"
has_offset = bool(payment_offset and actual_whoo_b != whoo_b)
matched_word = "후잉(카드대금 보정 후)" if has_offset else "후잉"
if diff == 0:
recovered = abs(prev_diff) if prev_diff is not None else 0
recovered_line = f"\n회복 금액: <b>{recovered:,}원</b>" if recovered else ""
hint_line = f"\n반영 항목: <b>{notify.escape_html(recovery_hint)}</b>" if recovery_hint else ""
return (
f" <b>{kind_word} 정합 회복</b>\n\n"
f"<b>{label}</b> ({acct})\n"
f"SMS / {matched_word} 모두 <b>{sms_b:,}원</b> 일치"
f"{recovered_line}"
f"{hint_line}"
)
lines = [
f"✅ <b>{kind_word} 정합 회복</b>",
"",
f"📌 <b>{label}</b> ({acct})",
f"• SMS · {matched_word}: <b>{sms_b:,}원</b> (일치)",
]
if recovered:
lines.append(f"• 불일치 해소: <b>{recovered:,}원</b>")
if recovery_hint:
lines.append("─────────────")
lines.append(f"• 마지막 반영 거래: <b>{notify.escape_html(recovery_hint)}</b>")
return "\n".join(lines)
sign = "+" if diff > 0 else ""
if side == "liability":
direction = "결제 누락 의심" if diff > 0 else "사용 거래 누락 의심"
else:
direction = "출금 누락 또는 입금 중복" if diff > 0 else "입금 누락 의심"
body = (
f"⚠️ <b>{kind_word} 불일치</b>\n\n"
f"<b>{label}</b> ({acct})\n"
f"• SMS: <b>{sms_b:,}원</b>\n"
f"{whoo_line}\n"
f"• 차이: <b>{sign}{diff:,}원</b> ({direction})"
)
lines = [
f"⚠️ <b>{kind_word} 불일치</b>",
"",
f"📌 <b>{label}</b> ({acct})",
f"• SMS {kind_word}: <b>{sms_b:,}원</b>",
]
if has_offset:
lines.append(
f"• 후잉 {kind_word}: <b>{actual_whoo_b:,}원</b>"
f" + 카드대금 보정 <b>{payment_offset:,}원</b>"
f" = <b>{whoo_b:,}원</b>"
)
else:
lines.append(f"• 후잉 {kind_word}: <b>{whoo_b:,}원</b>")
lines.append(f"• 차이: <b>{sign}{diff:,}원</b> → {direction}")
if prev_diff is not None and prev_diff != diff:
body += f"\n <i>이전 차이: {prev_diff:+,}→ 변동</i>"
return body + "\n\n<i>SMS 누락·잘못 분개·기간 외 거래 등 점검 필요.</i>"
lines.append(f"• 직전 차이: {prev_diff:+,}(변동)")
lines.append("")
lines.append("<i>ℹ️ SMS 누락·잘못 분개·기간 외 거래 등 점검이 필요해요.</i>")
return "\n".join(lines)
def _format_sync_failure(f: dict) -> str: