
CREATE PROC [dbo].[sp_GetInvoiceNoSales]
(@ItemType As varchar(50))
AS

DECLARE @invoiceNo INT = 0

BEGIN
	SELECT	@invoiceNo = IsNull(Max(invoiceNo), 0) + 1 
	FROM	pal_Sales
	WHERE itemType = @ItemType
END

SELECT	@invoiceNo AS InvNo


GO


