سامانه صدور فاکتور و حسابداری
test(wp4): link draft invoice fixture to its voucher in both delete directions
davoodmehraban89 committed
Nov 23, 2026 at 23:04 UTC
9ede2a596b2f12ad05e530e27d8dcf6587a6ca69
1 file changed
+4
-2
supabase/tests/wp4_journal_document_lifecycle.sql
+4
-2
@@ -171,7 +171,8 @@ BEGIN
171
VALUES(auth.uid(),org,'invoices','WP4_INV_A',
172
jsonb_build_object('companyId',company,'date',
173
(SELECT data->>'startDate' FROM public.records WHERE organization_id=org AND collection='fiscalYears' AND id=fy),
174
- 'documentStatus','draft','accountingStatus','draft'));
174
+ 'documentStatus','draft','accountingStatus','draft',
175
+ 'journalVoucherId','WP4_SOURCE_V_A'));
176
177
INSERT INTO public.records(owner_id,organization_id,collection,id,data)
178
VALUES(auth.uid(),org,'journalVouchers','WP4_SOURCE_V_A',
@@ -195,7 +196,8 @@ BEGIN
196
VALUES(auth.uid(),org,'invoices','WP4_INV_B',
197
jsonb_build_object('companyId',company,'date',
198
(SELECT data->>'startDate' FROM public.records WHERE organization_id=org AND collection='fiscalYears' AND id=fy),
198
- 'documentStatus','draft','accountingStatus','draft'));
199
+ 'documentStatus','draft','accountingStatus','draft',
200
+ 'journalVoucherId','WP4_SOURCE_V_B'));
201
202
INSERT INTO public.records(owner_id,organization_id,collection,id,data)
203
VALUES(auth.uid(),org,'journalVouchers','WP4_SOURCE_V_B',