linking credits in Transcend to t_payment

I'm stuck trying to link credits in Transcend/TPAU to the t_payment table. The stored procedure I'm trying to tweak links the CCREF_NO field in t_payment to tpau's TransactionID in the t_batch_details table. This works fine when the Transaction Type is 'Auth Only'  but for our credit transaction types the tpau transactionid does not exist in tessitura's CCREF_NO.

Does anybody have an example of linking credit card credits from tessitura to TPAU?

Here's the current query (many thanks to Lucie from FGO for the original stored procedure!)..

select distinct
    p.description            as payment_method_group,
    m.description            as payment_method,
    a.RowID,
    a.BatchID,
    --g.BatchName,
    --g.BatchRunTime,
    a.TransactionID,
    b.TransactionRowID,
    b.OrderNumber,
    b.MerchantID,
    --f.MerchantName,
    b.DepartmentID,
    b.AuthAmount,
    b.TransactionTypeID,
    d.VerbalDesc            as VerbalDescTranType,
    b.TransactionStatusID,
    c.VerbalDesc            as VerbalDescStatus,
    b.CardTypeID,
    e.VerbalDesc            as VerbalDescCardType,
    b.AuthorizedTime,
    b.ApprovalCode,
    h.account_no

from tpau.dbo.t_batch_details a
join tpau.dbo.t_transaction_browser_info b
on
    a.TransactionID = b.TransactionID
join tpau.dbo.t_ref_transaction_status c
on
     b.TransactionStatusID = c.TransactionStatusID
join tpau.dbo.t_ref_transaction_type d
on
    b.TransactionTypeID = d.TransactionTypeID    -- credit vs auth only
join tpau.dbo.t_ref_card_types e
on
    b.CardTypeID = e.CardTypeID
--join tpau.dbo.t_merchant_info f
--on
--    b.MerchantID = f.MerchantID
join tpau.dbo.t_batch_summary_records g
on
    a.BatchID = g.BatchID
join impresario.dbo.t_payment h
on
    a.TransactionID = h.ccref_no
join impresario.dbo.tr_payment_method m
on
    m.id = h.pmt_method
join impresario.dbo.tr_pmt_method_group p
on
    p.id = m.pmt_method_group

--where b.MerchantID in (2,3,4,5)
  and g.BatchRunTime between impresario.dbo.lf_get_midnight(@start_dt) and impresario.dbo.lf_get_endofday(@end_dt)
order by b.MerchantID,
    p.description,
    m.description,
    e.VerbalDesc,
    b.AuthorizedTime

Parents Reply Children
No Data