acc_invoices: OK в проверках принимается в любом регистре, латиницей и кириллицей (ОК), в базе хранится как OK
Some checks failed
ci / test (push) Successful in 52s
ci / deploy (push) Has been cancelled

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 20:15:24 +03:00
parent d0a22b8cec
commit dd2b8f6df3
4 changed files with 20 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ function LinkBtn({ href, label, off }: { href?: string | null; label: string; of
? <a className="btn small" href={href} target="_blank" rel="noopener noreferrer">{label} ↗</a>
: <button className="btn small" disabled title={off}>{label}</button>;
}
const isOkText = (v: string): boolean => v.trim().toLowerCase().replace(/о/g, "o").replace(/к/g, "k") === "ok";
const hashFilter = (): string => new URLSearchParams(location.hash.slice(1)).get("f") ?? "to_pay";
export function App() {
@@ -181,8 +182,8 @@ function Main({ me, onLogout }: { me: Me; onLogout: () => void }) {
<td>{r.project_name ?? r.project_customer_id}</td>
<td className="r">{money(r.amount)}</td>
<td>
<span title={`Агент: ${r.llm_result ?? "не проверялся"}`} className={`chk ${r.llm_result ? (r.llm_result.toLowerCase() === "ok" ? "ok" : "bad") : ""}`}>A</span>{" "}
<span title={`Сотрудник: ${r.manual_result ?? "не проверялся"}`} className={`chk ${r.manual_result ? (r.manual_result.toLowerCase() === "ok" ? "ok" : "bad") : ""}`}>С</span>{" "}
<span title={`Агент: ${r.llm_result ?? "не проверялся"}`} className={`chk ${r.llm_result ? (isOkText(r.llm_result) ? "ok" : "bad") : ""}`}>A</span>{" "}
<span title={`Сотрудник: ${r.manual_result ?? "не проверялся"}`} className={`chk ${r.manual_result ? (isOkText(r.manual_result) ? "ok" : "bad") : ""}`}>С</span>{" "}
<span title={r.approves_rejected ? "Согласование отклонено" : r.approves_pending ? "Ждёт согласования" : "Согласовано (или не требуется)"} className={`chk ${r.approves_rejected ? "bad" : r.approves_pending ? "" : "ok"}`}>✓</span>
</td>
<td>{r.paid_on ? `${shortDate(r.paid_on)} QB` : r.is_paid_manual ? "отмечен, ждём QB" : ""}</td>