       or coalesce(a.id , '') != coalesce(b.account_id ,'')
       or coalesce(a.external_key, '') != coalesce(b.account_external_key,'')
       or coalesce(a.name , '') != coalesce(b.account_name ,'')
+
+
+
+-- J4
+select *
+from bst b
+     join audit_log al on b.subscription_event_record_id = al.target_record_id and al.change_type = 'INSERT' and table_name = 'SUBSCRIPTION_EVENTS'
+where coalesce(b.created_reason_code, 'NULL') != coalesce(al.reason_code,'NULL')
+      or coalesce(b.created_comments, 'NULL') != coalesce(al.comments,'NULL')
+      or coalesce(b.created_by, '') != coalesce(al.created_by,'')
+
+
+-- bst_fields
+/* table not currently used */
+
+*****
+
+-- bst_tags
+/* table not currently used */
+
+*****
+      

      or coalesce(a.external_key, '') != coalesce(b.account_external_key,'')
      or coalesce(a.name , '') != coalesce(b.account_name ,'')


*****


      or b.invoice_amount_paid != bin.amount_paid
      or b.invoice_amount_charged != bin.amount_charged
      or b.invoice_original_amount_charged != bin.original_amount_charged
      or b.invoice_amount_credited != bin.amount_credited				
				
-- H5				
select *
from bipr
     left outer join invoice_payments ip on bipr.invoice_payment_id = ip.id
     left outer join payments p on ip.payment_id = p.id
where coalesce(p.RECORD_ID, 'NULL') != coalesce(bipr.payment_number,'NULL')


-- H8
select *
from bipr b
     join audit_log al on b.invoice_payment_record_id = al.target_record_id and al.change_type = 'INSERT' and table_name = 'INVOICE_PAYMENTS'
where coalesce(b.created_reason_code, 'NULL') != coalesce(al.reason_code,'NULL')
      or coalesce(b.created_comments, 'NULL') != coalesce(al.comments,'NULL')
      or coalesce(b.created_by, '') != coalesce(al.created_by,'')


*****

-- bos

-- I1a
select *
from blocking_states bs
     left outer join bos on bs.record_id = bos.blocking_state_record_id
where ( coalesce(bs.RECORD_ID, 'NULL') != coalesce(bos.blocking_state_record_id,'NULL')
      or coalesce(bs.BLOCKABLE_ID, 'NULL') != coalesce(bos.bundle_id,'NULL')
      or coalesce(bs.STATE, 'NULL') != coalesce(bos.status,'NULL')
      or coalesce(bs.CREATED_DATE, 'NULL') != coalesce(bos.created_date,'NULL')
      or coalesce(bs.CREATED_DATE, 'NULL') != coalesce(bos.start_date,'NULL')
      -- or coalesce(bs.ACCOUNT_RECORD_ID, 'NULL') != coalesce(bos.account_record_id,'NULL')
      or coalesce(bs.TENANT_RECORD_ID, 'NULL') != coalesce(bos.tenant_record_id,'NULL') )
      and coalesce(bs.TYPE, 'NULL') = 'SUBSCRIPTION_BUNDLE'

-- I1b
select *
from bos
     left outer join blocking_states bs on bs.record_id = bos.blocking_state_record_id
where coalesce(bs.RECORD_ID, 'NULL') != coalesce(bos.blocking_state_record_id,'NULL')
      or coalesce(bs.BLOCKABLE_ID, 'NULL') != coalesce(bos.bundle_id,'NULL')
      or coalesce(bs.TYPE, 'NULL') != 'SUBSCRIPTION_BUNDLE'
      or coalesce(bs.STATE, 'NULL') != coalesce(bos.status,'NULL')
      or coalesce(bs.CREATED_DATE, 'NULL') != coalesce(bos.created_date,'NULL')
      or coalesce(bs.CREATED_DATE, 'NULL') != coalesce(bos.start_date,'NULL')
      -- or coalesce(bs.ACCOUNT_RECORD_ID, 'NULL') != coalesce(bos.account_record_id,'NULL')
      or coalesce(bs.TENANT_RECORD_ID, 'NULL') != coalesce(bos.tenant_record_id,'NULL')

-- I2
select *
from bos b
     left outer join accounts a on a.id = b.account_id
where coalesce(a.record_id )!=  coalesce(b.account_record_id ,'')
      or coalesce(a.external_key, '') != coalesce(b.account_external_key,'')
      or coalesce(a.name , '') != coalesce(b.account_name ,'')

-- I3
select *
from bos
     left outer join bundles b on b.id = bos.bundle_id
where coalesce(bos.bundle_external_key )!=  coalesce(b.external_key ,'')

-- I4
select *
from bos b
     join audit_log al on b.blocking_state_record_id = al.target_record_id and al.change_type = 'INSERT' and table_name = 'BLOCKING_STATES'
where coalesce(b.created_reason_code, 'NULL') != coalesce(al.reason_code,'NULL')
      or coalesce(b.created_comments, 'NULL') != coalesce(al.comments,'NULL')
      or coalesce(b.created_by, '') != coalesce(al.created_by,'')

*****

-- bst

-- J1
select *
from bst
     left outer join subscription_events se on bst.subscription_event_record_id = se.record_id
where 1=0
      or coalesce(se.requested_date,'') != coalesce(bst.requested_timestamp,'')
      or coalesce(se.effective_date,'') != coalesce(bst.next_start_date,'')
      or coalesce(se.subscription_id,'') != coalesce(bst.subscription_id,'')
      or coalesce(se.phase_name,'') != coalesce(bst.next_slug,'')
      or coalesce(se.price_list_name,'') != coalesce(bst.next_price_list,'')
      or coalesce(se.created_date,'') != coalesce(bst.created_date,'')
      or coalesce(se.account_record_id,'') != coalesce(bst.account_record_id,'')
      or coalesce(se.tenant_record_id,'') != coalesce(bst.tenant_record_id,'')

-- J2
select *
from bst  b
     left outer join accounts a on a.id = b.account_id
