SELECT CRI.acKey, CRI.anNo, CRI.acName, CRI.acPayMethod, CRI.anAmount,
  CRI.acLnkKey, F.acValue acLnkKeyView, CRI.acAcct, CRI.acCostDrv, CRI.acDept,
  CRI.anUserIns, CRI.adTimeIns, CRI.anUserChg, CRI.adTimeChg
  , CRI.acTrvlType
FROM tHE_CashRegItem CRI
cross apply dbo.fPA_KeyRet_ITF(acLnkKey) F
cross apply dbo.fPA_KeyRet2_ITF(acLnkKey) KR
WHERE acKey = @acKey AND KR.acValue = @POTNALKLJUC
ORDER BY CRI.acKey, CRI.anNo

