﻿-- =============================================
-- Description:	Returns the raw field values of a single manually entered
--				banking transaction (TransactionTypeIdCode = 'MAN'), so the
--				"manuelle Buchung ändern" dialog can be pre-filled.
-- =============================================
CREATE PROCEDURE [dbo].[fds__getBankingtransaction_manual]
	@taID varchar(10),
	@authuser varchar(100)
AS
BEGIN
	SET NOCOUNT ON;
	IF [dbo].[fis_getModuleAuth]('fds_bam', @authuser) < 1
		THROW 60000, N'not authorized', 1;

	SELECT
		[taID]
		, [ValueDate]
		, [Amount]
		, [NameOfPayer]
		, [SepaRemittanceInformation]
	FROM [dbo].[fds__bankingtransactions]
	WHERE [taID] = @taID
		AND [TransactionTypeIdCode] = 'MAN';
END
