Очередь: столбец «списано с» и ссылка на QuickBooks, ответ на проблему и contract_basis (миграция 077), инструкции и процессы; review-done-action.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 $$;
|
||||
Reference in New Issue
Block a user