Очередь: столбец «списано с» и ссылка на QuickBooks, ответ на проблему и contract_basis (миграция 077), инструкции и процессы; review-done-action.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,16 +87,16 @@ async function forwardInvoice(c: PoolClient, r: Row): Promise<void> {
|
||||
// Тот же id; если инвойс уже есть в реестре (вернулся в разбор), обновляем данные, статус не трогаем.
|
||||
await c.query(
|
||||
`insert into acc_invoices (id, source_message_id, drive_file_id, vendor_name, vendor_qbo_id, invoice_number, invoice_date,
|
||||
amount, lines, project_customer_id, jt_job_id, contract_id, stage)
|
||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9::jsonb, $10, $11, $12, 'checking')
|
||||
amount, lines, project_customer_id, jt_job_id, contract_id, contract_basis, stage)
|
||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9::jsonb, $10, $11, $12, $13, 'checking')
|
||||
on conflict (id) do update set
|
||||
source_message_id = excluded.source_message_id, drive_file_id = excluded.drive_file_id, vendor_name = excluded.vendor_name,
|
||||
vendor_qbo_id = excluded.vendor_qbo_id, invoice_number = excluded.invoice_number, invoice_date = excluded.invoice_date,
|
||||
amount = excluded.amount, lines = excluded.lines, project_customer_id = excluded.project_customer_id,
|
||||
jt_job_id = excluded.jt_job_id, contract_id = excluded.contract_id`,
|
||||
jt_job_id = excluded.jt_job_id, contract_id = excluded.contract_id, contract_basis = excluded.contract_basis`,
|
||||
[
|
||||
r.id, r.source_message_id, r.drive_file_id, r.vendor_name, r.vendor_qbo_id ?? null, r.invoice_number ?? null, r.invoice_date,
|
||||
r.amount, r.lines == null ? null : JSON.stringify(r.lines), r.project_customer_id, r.jt_job_id ?? null, r.contract_id ?? null,
|
||||
r.amount, r.lines == null ? null : JSON.stringify(r.lines), r.project_customer_id, r.jt_job_id ?? null, r.contract_id ?? null, r.contract_basis ?? null,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user