invoice-filing: пропускать инвойсы без drive_file_id (импортированные из Excel), иначе Drive 404 каждые 10 минут
All checks were successful
ci / test (push) Successful in 1m15s
ci / deploy (push) Successful in 3m29s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-06 17:48:56 +03:00
parent 5c9b949d8a
commit 3016b301ab

View File

@@ -48,7 +48,7 @@ export async function runInvoiceFiling(deps: { pool: Pool; drive: FilingDrive; l
const { rows } = await pool.query<{ id: string; drive_file_id: string; vendor_name: string; amount: string; paid_on: string; account_name: string }>(
`select i.id, i.drive_file_id, i.vendor_name, i.amount::text, i.paid_on::text, p.account_name
from acc_invoices i join qbo_purchase p on p.id = i.qbo_txn_id
where i.paid_on is not null and p.account_name is not null
where i.paid_on is not null and p.account_name is not null and i.drive_file_id is not null
and (i.drive_folder is null or i.drive_folder like 'Инвойсы/${UNPAID_FOLDER}/%')
order by i.paid_on limit ${BATCH}`,
);