
			Declare @StartNo nvarchar(64)
			Declare @EndNo nvarchar(64)
			Set @StartNo='IBN201904010003'
			Set @EndNo='IBN201904010003'

			SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer, 
		  Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator 
		  FROM IndentBillOnNet 
		  LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer 
		  LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor 
			WHERE No_IndentBillOnNet >= (case DataLength(@StartNo) When 0 Then No_IndentBillOnNet Else @StartNo End)  And No_IndentBillOnNet <= (case DataLength(@EndNo) When 0 Then No_IndentBillOnNet Else @EndNo End)
			
			 SELECT IndentBillOnNetProduct.*,No_IndentBillOnNet,Product.No_Product, Product.Name_Product, Product.Unit_Product, 
			  (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,No_IndentBillOnNet
			  FROM IndentBillOnNetProduct 
			  LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
        Left Join IndentBillOnNet On IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet 
			WHERE No_IndentBillOnNet >= (case DataLength(@StartNo) When 0 Then No_IndentBillOnNet Else @StartNo End)  And No_IndentBillOnNet <= (case DataLength(@EndNo) When 0 Then No_IndentBillOnNet Else @EndNo End)

		