Очередь: столбец «списано с» и ссылка на QuickBooks, ответ на проблему и contract_basis (миграция 077), инструкции и процессы; review-done-action.md
All checks were successful
ci / test (push) Successful in 1m7s
ci / deploy (push) Successful in 3m16s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 17:47:01 +03:00
parent 09f6f81038
commit 1a7515dfbc
9 changed files with 163 additions and 16 deletions

View File

@@ -0,0 +1,17 @@
-- Встреча 2026-11-30: ответ человека на проблему инвойса и основание вместо договора (доп. заказ / change order без отдельного контракта).
-- Колонки нужны во всех трёх таблицах разбора (review, _original, _history), чтобы копирование строк шло без потерь.
alter table acc_invoices_review add column if not exists answer text;
alter table acc_invoices_review add column if not exists contract_basis text;
alter table acc_invoices_review_original add column if not exists answer text;
alter table acc_invoices_review_original add column if not exists contract_basis text;
alter table acc_invoices_review_history add column if not exists answer text;
alter table acc_invoices_review_history add column if not exists contract_basis text;
-- в реестре остаётся только основание (ответ - рабочая заметка разбора)
alter table acc_invoices add column if not exists contract_basis text;
-- contract = договор, invoice = сам инвойс/пропоузел служит основанием (контракт не создаётся), none = без основания
do $$ begin
alter table acc_invoices_review add constraint acc_invoices_review_contract_basis_chk check (contract_basis is null or contract_basis in ('contract','invoice','none'));
exception when duplicate_object then null; end $$;
do $$ begin
alter table acc_invoices add constraint acc_invoices_contract_basis_chk check (contract_basis is null or contract_basis in ('contract','invoice','none'));
exception when duplicate_object then null; end $$;