       or ( coalesce(i.invoice_date, '') != coalesce(bin.invoice_date,''))
       or ( coalesce(i.target_date, '') != coalesce(bin.target_date,''))
       or ( coalesce(i.currency, '') != coalesce(bin.currency,''))
-      or ( coalesce(i.created_by, '') != coalesce(bin.created_by,''))
       or ( coalesce(i.created_date, '') != coalesce( bin.created_date,''))
       or ( coalesce(i.account_record_id, '') != coalesce(bin.account_record_id,''))
-      -- RI-1966 or ( coalesce(i.tenant_record_id, '') != coalesce(bin.tenant_record_id,''))
+      or ( coalesce(i.tenant_record_id, '') != coalesce(bin.tenant_record_id,''))
 
 -- F1b
 select *

from bipr
     left outer join invoice_payments ip on ip.id = bipr.invoice_payment_id
where coalesce(ip.RECORD_ID, 'NULL') != coalesce(bipr.invoice_payment_record_id,'NULL')
      or  coalesce(ip.ID, 'NULL') != coalesce(bipr.invoice_payment_id,'NULL')
      or  coalesce(ip.invoice_id, 'NULL') != coalesce(bipr.invoice_id,'NULL')
      or  coalesce(ip.type, 'NULL') != coalesce(bipr.invoice_payment_type,'NULL')
      or  coalesce(ip.linked_invoice_payment_id, 'NULL') != coalesce(bipr.linked_invoice_payment_id,'NULL')
      or  coalesce(ip.amount, 'NULL') != coalesce(bipr.amount,'NULL')
      or  coalesce(ip.currency, 'NULL') != coalesce(bipr.currency,'NULL')
      or  coalesce(ip.created_date, 'NULL') != coalesce(bipr.created_date,'NULL')
      or  coalesce(ip.created_by, 'NULL') != coalesce(bipr.created_by,'NULL')
      or  coalesce(ip.account_record_id, 'NULL') != coalesce(bipr.account_record_id,'NULL')
      -- or  coalesce(ip.tenant_record_id, 'NULL') != coalesce(bipr.tenant_record_id,'NULL')
      or  bipr.invoice_payment_type != 'REFUND' -- ?

-- H2
select *
from bipr b
     left outer join accounts a on a.id = b.account_id

from invoice_payments ip
     left outer join bip on ip.id = bip.invoice_payment_id
where ( coalesce(ip.RECORD_ID, 'NULL') != coalesce(bip.invoice_payment_record_id,'NULL')
      or coalesce(ip.ID, 'NULL') != coalesce(bip.invoice_payment_id,'NULL')
      or coalesce(ip.invoice_id, 'NULL') != coalesce(bip.invoice_id,'NULL')
      or coalesce(ip.type, 'NULL') != coalesce(bip.invoice_payment_type,'NULL')
      or coalesce(ip.linked_invoice_payment_id, 'NULL') != coalesce(bip.linked_invoice_payment_id,'NULL')
      or coalesce(ip.amount, 'NULL') != coalesce(bip.amount,'NULL')
      or coalesce(ip.currency, 'NULL') != coalesce(bip.currency,'NULL')
      or coalesce(ip.created_date, 'NULL') != coalesce(bip.created_date,'NULL')
      or coalesce(ip.account_record_id, 'NULL') != coalesce(bip.account_record_id,'NULL')
      -- or coalesce(ip.tenant_record_id, 'NULL') != coalesce(bip.tenant_record_id,'NULL')
     )
      and ip.type = 'ATTEMPT'

