﻿CREATE   PROCEDURE [dbo].[fds__createInvoice_ServiceRequest]
	@InvId varchar(10)
	,@mfr__servicerequest bigint
	,@title nvarchar(max)
	,@value_net numeric(10,3)
	,@SortOrder tinyint
AS
BEGIN
	SET NOCOUNT ON;

	DECLARE @InvRqId varchar(10) = [dbo].[fds__fn_invoice-srq_id]();

    INSERT INTO [dbo].[fds__invoice_servicerequests]
           ([Id]
		   ,[InvId]
           ,[mfr__servicerequest]
		   ,[title]
           ,[value_net]
           ,[SortOrder])
	OUTPUT inserted.*
     VALUES
           (@InvRqId
		   ,@InvId
           ,@mfr__servicerequest
		   ,@title
           ,@value_net
           ,@SortOrder);

END