سامانه صدور فاکتور و حسابداری
fix: parenthesize CASE expressions in source guard
davoodmehraban89 committed
Nov 17, 2026 at 17:22 UTC
bb4c1e622195756789dd78dbda2c08a62bf56c37
1 file changed
+2
-2
supabase/migrations/20261117120000_stage3_canonical_source_link_projection.sql
+2
-2
@@ -55,9 +55,9 @@ BEGIN
55
56
IF NEW.data->>'journalVoucherId' IS DISTINCT FROM v_voucher.id
57
OR NEW.data->>'accountingStatus' IS DISTINCT FROM
58
- CASE WHEN v_effective_status = 'reversed' THEN 'reversed' ELSE 'posted' END
58
+ (CASE WHEN v_effective_status = 'reversed' THEN 'reversed' ELSE 'posted' END)
59
OR NEW.data->>'documentStatus' IS DISTINCT FROM
60
- CASE WHEN v_effective_status = 'reversed' THEN 'reversed' ELSE 'posted' END
60
+ (CASE WHEN v_effective_status = 'reversed' THEN 'reversed' ELSE 'posted' END)
61
OR NEW.data->>'accountingPostedAt' IS DISTINCT FROM v_voucher.data->>'postedAt'
62
OR NEW.data->>'documentPostedAt' IS DISTINCT FROM v_voucher.data->>'postedAt'
63
OR NEW.data->>'documentPostedBy' IS DISTINCT FROM