SELECT
  RetainerReallocationID,
  CMSInvNo,
  Description AS Narration,
  AccountBookType,
  AccountBookID,
  ClientID AS CMSClientID,
  YearMonth AS AppointmentID,
  'reallocation' AS JournalType,
  DebitAccount,
  DebitBranchRegion,
  DebitProductCategory,
  CreditAccount,
  CreditBranchRegion,
  CreditProductCategory,
  LineAmount,
  CMSJournalNo
FROM
  taRetainerReallocation
WHERE
  (CMSInvNo = @nCMSInvNo)
ORDER BY
  RetainerReallocationID
