acc_invoices: сервис WebUI и бэкенд платёжного процесса (миграция 082, правила статусов, согласования, ручная отметка оплаты), статусы оплат, предложения к ТЗ
All checks were successful
ci / test (push) Successful in 59s
ci / deploy (push) Successful in 3m14s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 12:44:58 +03:00
parent 37778d8b11
commit 16e9b2c085
31 changed files with 2458 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ export interface InvoicePaidResult {
export async function runInvoicePaid(deps: { pool: Pool; realmId?: string | null }): Promise<InvoicePaidResult> {
const res: InvoicePaidResult = { matched: 0, errors: [] };
const { rows } = await deps.pool.query(
"select id from acc_invoices where stage not in ('rejected', 'paid') and paid_on is null order by decided_at nulls last, created_at",
"select id from acc_invoices where stage not in ('rejected', 'paid') and paid_on is null and not is_draft and not cancelled order by decided_at nulls last, created_at",
);
for (const { id } of rows as { id: string }[]) {
try {