invoice-filing: пропускать инвойсы без drive_file_id (импортированные из Excel), иначе Drive 404 каждые 10 минут
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user