FrmSaleBill
= (case DataLength(@StartNo) when 0 then SaleBill.No_SaleBill else @StartNo end) and SaleBill.No_SaleBill <= (case DataLength(@EndNo) when 0 then SaleBill.No_SaleBill else @EndNo end)
and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End --added for Special
SELECT SaleBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
Product.LowSalePrice_Product, BillType.Name_BillType,
(SaleBillProduct.Quantity_SaleBillProduct * SaleBillProduct.UnitPrice_SaleBillProduct ) AS Amount_SaleBillProduct ,SaleBill.No_SaleBill
FROM SaleBillProduct
LEFT JOIN Product ON Product.ID_Product = SaleBillProduct.ID_Product
LEFT JOIN BillType ON BillType.Value_BillType = SaleBillProduct.Type_FromBill
LEFT JOIN SaleBill ON SaleBillProduct.ID_SaleBill = SaleBill.ID_SaleBill
WHERE SaleBill.No_SaleBill >= (case DataLength(@StartNo) when 0 then SaleBill.No_SaleBill else @StartNo end) and SaleBill.No_SaleBill <= (case DataLength(@EndNo) when 0 then SaleBill.No_SaleBill else @EndNo end)
and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End --added for Special
ORDER BY CAST(SaleBillProduct.No_SaleBillProduct AS INT)
SELECT ReportComment.*, SaleBill.No_SaleBill
FROM ReportComment
LEFT JOIN SaleBill ON ReportComment.ID_Bill = SaleBill.ID_SaleBill
WHERE SaleBill.No_SaleBill >= (case DataLength(@StartNo) when 0 then SaleBill.No_SaleBill else @StartNo end) and SaleBill.No_SaleBill <= (case DataLength(@EndNo) when 0 then SaleBill.No_SaleBill else @EndNo end)
and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End --added for Special
ORDER BY ReportComment.No_ReportComment
]]>
SaleBill,SaleBillProduct,ReportComment
FrmIndentBill
= (case DataLength(@StartNo) when 0 then IndentBill.No_IndentBill else @StartNo end) and IndentBill.No_IndentBill <= (case DataLength(@EndNo) when 0 then IndentBill.No_IndentBill else @EndNo end)
and Special_IndentBill=case @Special when 1 then Special_IndentBill else 0 End --added for Special
SELECT IndentBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
Product.LowSalePrice_Product, BillType.Name_BillType,
(IndentBillProduct.Quantity_IndentBillProduct * IndentBillProduct.UnitPrice_IndentBillProduct ) AS Amount_IndentBillProduct ,IndentBill.No_IndentBill
FROM IndentBillProduct
LEFT JOIN Product ON Product.ID_Product = IndentBillProduct.ID_Product
LEFT JOIN BillType ON BillType.Value_BillType = IndentBillProduct.Type_FromBill
LEFT JOIN IndentBill ON IndentBillProduct.ID_IndentBill = IndentBill.ID_IndentBill
WHERE IndentBill.No_IndentBill >= (case DataLength(@StartNo) when 0 then IndentBill.No_IndentBill else @StartNo end) and IndentBill.No_IndentBill <= (case DataLength(@EndNo) when 0 then IndentBill.No_IndentBill else @EndNo end)
and Special_IndentBill=case @Special when 1 then Special_IndentBill else 0 End --added for Special
ORDER BY CAST(IndentBillProduct.No_IndentBillProduct AS INT)
SELECT ReportComment.*, IndentBill.No_IndentBill
FROM ReportComment
LEFT JOIN IndentBill ON ReportComment.ID_Bill = IndentBill.ID_IndentBill
WHERE IndentBill.No_IndentBill >= (case DataLength(@StartNo) when 0 then IndentBill.No_IndentBill else @StartNo end) and IndentBill.No_IndentBill <= (case DataLength(@EndNo) when 0 then IndentBill.No_IndentBill else @EndNo end)
and Special_IndentBill=case @Special when 1 then Special_IndentBill else 0 End --added for Special
ORDER BY ReportComment.No_ReportComment
]]>
IndentBill,IndentBillProduct,ReportComment
FrmPriceQueryBill
= (case DataLength(@StartNo) when 0 then PriceQueryBill.No_PriceQueryBill else @StartNo end) and PriceQueryBill.No_PriceQueryBill <= (case DataLength(@EndNo) when 0 then PriceQueryBill.No_PriceQueryBill else @EndNo end)
SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
Product.LowSalePrice_Product,
(UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,
PriceQueryBill.No_PriceQueryBill
FROM PriceQueryBillProduct
LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
LEFT JOIN PriceQueryBill ON PriceQueryBillProduct.ID_PriceQueryBill=PriceQueryBill.ID_PriceQueryBill
WHERE PriceQueryBill.No_PriceQueryBill >= (case DataLength(@StartNo) when 0 then PriceQueryBill.No_PriceQueryBill else @StartNo end) and PriceQueryBill.No_PriceQueryBill <= (case DataLength(@EndNo) when 0 then PriceQueryBill.No_PriceQueryBill else @EndNo end)
ORDER BY CAST(PriceQueryBillProduct.No_PriceQueryBillProduct AS INT)
SELECT ReportComment.*, PriceQueryBill.No_PriceQueryBill
FROM ReportComment
LEFT JOIN PriceQueryBill ON ReportComment.ID_Bill=PriceQueryBill.ID_PriceQueryBill
WHERE PriceQueryBill.No_PriceQueryBill >= (case DataLength(@StartNo) when 0 then PriceQueryBill.No_PriceQueryBill else @StartNo end) and PriceQueryBill.No_PriceQueryBill <=(case DataLength(@EndNo) when 0 then PriceQueryBill.No_PriceQueryBill else @EndNo end)
ORDER BY ReportComment.No_ReportComment
]]>
PriceQueryBill,PriceQueryBillProduct,ReportComment
FrmSaleRtnBill
=(case DataLength(@StartNo) when 0 then SaleRtnBill.No_SaleRtnBill else @StartNo end) and SaleRtnBill.No_SaleRtnBill<=(case DataLength(@EndNo) when 0 then SaleRtnBill.No_SaleRtnBill else @EndNo end) AND Disable_SaleRtnBill=0
ORDER BY No_SaleRtnBill
SELECT SaleRtnBillProduct.*, SaleRtnBill.No_SaleRtnBill,
BillType.Name_BillType AS FromBill_SaleRtnBillProduct,
SaleRtnBill.IsPrevBill_SaleRtnBill,
SaleRtnBill.AssessDate_SaleRtnBill,
Product.No_Product AS ProductNo_SaleRtnBillProduct,
Product.Name_Product AS ProductName_SaleRtnBillProduct,
Product.Unit_Product AS ProductUnit_SaleRtnBillProduct,
SaleOutDepotBillProduct.UnitCost_SaleOutDepotBillProduct AS UnitCost_SaleRtnBillProduct,
SaleRtnBillProduct.Quantity_SaleRtnBillProduct * SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct AS Cash_SaleRtnBillProduct,SaleRtnBill.No_SaleRtnBill
FROM SaleRtnBillProduct
JOIN SaleRtnBill ON SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
JOIN Product ON Product.ID_Product=SaleRtnBillProduct.ID_Product
JOIN BillType ON BillType.Value_BillType=SaleRtnBillProduct.Type_FromBill
LEFT JOIN SaleOutDepotBillProduct ON SaleOutDepotBillProduct.No_SaleOutDepotBillProduct=SaleRtnBillProduct.No_FromBillProduct
AND SaleOutDepotBillProduct.ID_SaleOutDepotBill=@ID_SaleOutDepotBill
WHERE SaleRtnBill.No_SaleRtnBill>=(case DataLength(@StartNo) when 0 then SaleRtnBill.No_SaleRtnBill else @StartNo end) and SaleRtnBill.No_SaleRtnBill<=(case DataLength(@EndNo) when 0 then SaleRtnBill.No_SaleRtnBill else @EndNo end) AND Disable_SaleRtnBill=0
ORDER BY CAST(No_SaleRtnBillProduct AS INT)
]]>
SaleRtnBill,SaleRtnBillProduct
FrmPurchaseBill
PurchaseOrderBill,PurchaseOrderBillProduct,ReportComment
FrmPurchaseQueryBill
PurchaseQueryBill,PurchaseQueryBillProduct,ReportComment
FrmPurchaseInDepotBill
= (case DataLength(@StartNo_PurchaseInDepotBill) When 0 Then No_PurchaseInDepotBill Else @StartNo_PurchaseInDepotBill End) And No_PurchaseInDepotBill <= (case DataLength(@EndNo_PurchaseInDepotBill) When 0 Then No_PurchaseInDepotBill Else @EndNo_PurchaseInDepotBill End)
SELECT PurchaseInDepotBill.No_PurchaseInDepotBill,PurchaseInDepotBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,Location.Name_Location,BillType.Name_BillType
FROM PurchaseInDepotBillProduct
LEFT JOIN Product ON PurchaseInDepotBillProduct.ID_Product=Product.ID_Product
LEFT JOIN PurchaseInDepotBill ON PurchaseInDepotBillProduct.ID_PurchaseInDepotBill=PurchaseInDepotBill.ID_PurchaseInDepotBill
LEFT JOIN Location ON Location.ID_Location=PurchaseInDepotBillProduct.ID_Location
LEFT JOIN BillType ON BillType.Value_BillType=PurchaseInDepotBillProduct.Type_FromBill
WHERE No_PurchaseInDepotBill >= (case DataLength(@StartNo_PurchaseInDepotBill) When 0 Then No_PurchaseInDepotBill Else @StartNo_PurchaseInDepotBill End) And No_PurchaseInDepotBill <= (case DataLength(@EndNo_PurchaseInDepotBill) When 0 Then No_PurchaseInDepotBill Else @EndNo_PurchaseInDepotBill End)
ORDER BY CAST(No_PurchaseInDepotBillProduct AS INT)
]]>
PurchaseInDepotBill,PurchaseInDepotBillProduct
FrmSaleOutDepotBill
= (case DataLength(@StartNo_SaleOutDepotBill)
When 0 Then No_SaleOutDepotBill Else @StartNo_SaleOutDepotBill End) And No_SaleOutDepotBill <= (case DataLength(@EndNo_SaleOutDepotBill)
When 0 Then No_SaleOutDepotBill Else @EndNo_SaleOutDepotBill End) and SaleOutDepotBill.Disable_SaleOutDepotBill=0
)A
Left Join
(
SELECT SaleOutDepotBill.No_SaleOutDepotBill as No_SaleOutDepotBill1,SaleOutDepotBillProduct.*,
BillType.Name_BillType as Name_FromBill,
UnitPrice_SaleBillProduct = Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End,
convert(decimal(18,2),SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct * (Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End)) as money,
Product.No_Product,Product.Name_Product,
Product.Unit_Product as Unit_Product1 ,Location.Name_location as Name_location1
,SaleBill.No_SaleBill,SaleBill.No_OrderBill,SaleBill.Name_Linkman,SaleBill.SendAddr_SaleBill,SaleBill.Tel_SaleBill,
SaleBill.OutStatus_SaleBill
,SaleBill.TaxCurrency_SaleBill,SaleBill.Currency_SaleBill
FROM SaleOutDepotBillProduct
LEFT JOIN BillType ON BillType.Value_BillType=SaleOutDepotBillProduct.Type_FromBill
LEFT JOIN Product ON SaleOutDepotBillProduct.ID_Product=Product.ID_Product
LEFT JOIN Location ON Location.ID_Location = SaleOutDepotBillProduct.ID_Location
LEFT JOIN SaleOutDepotBill ON SaleOutDepotBill.ID_SaleOutDepotBill= SaleOutDepotBillProduct.ID_SaleOutDepotBill
Left Join
(
select SaleBill.No_SaleBill,SaleBill.No_OrderBill,SaleBill.Name_Linkman,SaleBill.SendAddr_SaleBill,SaleBill.
Tel_SaleBill,SaleBill.OutStatus_SaleBill,SaleBill.TaxCurrency_SaleBill,SaleBill.Currency_SaleBill,
UnitPrice_SaleBillProduct = Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End,SaleBillProduct.No_SaleBillProduct
from SaleBill
left join SaleBillProduct ON SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
) SaleBill ON SaleBill.No_SaleBill= SaleOutDepotBillProduct.No_FromBill
and SaleBill.No_SaleBillProduct=SaleOutDepotBillProduct.No_FromBillProduct
WHERE No_SaleOutDepotBill >= (case DataLength(@StartNo_SaleOutDepotBill)
When 0 Then No_SaleOutDepotBill Else @StartNo_SaleOutDepotBill End) And No_SaleOutDepotBill <= (case DataLength(@EndNo_SaleOutDepotBill)
When 0 Then No_SaleOutDepotBill Else @EndNo_SaleOutDepotBill End)and SaleOutDepotBill.Disable_SaleOutDepotBill=0
) B On A.No_SaleOutDepotBill=B.No_SaleOutDepotBill1
order by Name_Location1
SELECT ReportComment.*,No_SaleOutDepotBill
FROM ReportComment
LEFT JOIN SaleOutDepotBill ON SaleOutDepotBill.ID_SaleOutDepotBill=ReportComment.ID_Bill
WHERE No_SaleOutDepotBill >= (case DataLength(@StartNo_SaleOutDepotBill) When 0 Then No_SaleOutDepotBill
Else @StartNo_SaleOutDepotBill End) And No_SaleOutDepotBill <= (case DataLength(@EndNo_SaleOutDepotBill)
When 0 Then No_SaleOutDepotBill Else @EndNo_SaleOutDepotBill End)
AND Disable_SaleOutDepotBill=0
ORDER BY ReportComment.No_ReportComment
declare @cessIn decimal(14,4)
Select @cessIn=CessIn_SystemSetting From SystemSetting
select SaleBill.No_SaleBill,SaleOutDepotBill.No_SaleOutDepotBill,
GoodsAmount_SaleOutDepotBill = case SaleBill.TaxCurrency_SaleBill
When '内含' Then sum((SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct*(Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End))/(1+@cessIn/100))
else SUM((SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct*(Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End))) end,
TaxAmount_SaleOutDepotBill = case SaleBill.TaxCurrency_SaleBill
When '外加' Then SUM((SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct*(Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End))*(@cessIn)/100)
When '内含' Then SUM((SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct*(Case @Right When 'False' Then 0 Else UnitPrice_SaleBillProduct End))*((@cessIn)/100)/(1+@cessIn/100))
When '零税' Then 0
When '免税' Then 0 end
from SaleBill
left join SaleBillProduct ON SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
left join SaleOutDepotBillProduct on SaleBill.No_SaleBill= SaleOutDepotBillProduct.No_FromBill and SaleBillProduct.No_SaleBillProduct=SaleOutDepotBillProduct.No_FromBillProduct
left join SaleOutDepotBill on SaleOutDepotBillProduct.ID_SaleOutDepotBill=SaleOutDepotBill.ID_SaleOutDepotBill
WHERE No_SaleOutDepotBill >= (case DataLength(@StartNo_SaleOutDepotBill) When 0 Then No_SaleOutDepotBill Else @StartNo_SaleOutDepotBill End) And No_SaleOutDepotBill <= (case DataLength(@EndNo_SaleOutDepotBill) When 0 Then No_SaleOutDepotBill Else @EndNo_SaleOutDepotBill End)
AND Disable_SaleOutDepotBill=0
group by SaleBill.No_SaleBill,SaleOutDepotBill.No_SaleOutDepotBill,SaleBill.TaxCurrency_SaleBill
]]>
SaleOutDepotBill,ReportComment,SaleBill
FrmInventoryChangeBill
= (case DataLength(@StartNo_ModifyDepotBill) When 0 Then No_ModifyDepotBill Else @StartNo_ModifyDepotBill End) And No_ModifyDepotBill <= (case DataLength(@EndNo_ModifyDepotBill) When 0 Then No_ModifyDepotBill Else @EndNo_ModifyDepotBill End)
SELECT ModifyDepotBill.No_ModifyDepotBill,MS.Name_BillType AS SourceBillName_ModifyDepotBillProduct,
No_ModifyDepotBillProduct,Type_FromBill,No_FromBill,No_FromBillProduct,Quantity_ModifyDepotBillProduct,
UnitPrice_ModifyDepotBillProduct = Case @Right When 'false' Then 0 Else UnitPrice_ModifyDepotBillProduct End,Comment_ModifyDepotBillProduct,
(Case @Right When 'false' Then 0 Else UnitPrice_ModifyDepotBillProduct End)*MP.Quantity_ModifyDepotBillProduct AS ProductMoney_FromBillProduct,
P.No_Product AS ProductNo_FromBillProduct,
P.Name_Product AS ProductName_FromBillProduct,
P.Unit_Product AS ProductUnit_FromBillProduct,
L.Name_Location AS Location_FromBillProduct
FROM ModifyDepotBillProduct MP
Left JOIN Product P ON P.ID_Product = MP.ID_Product
INNER JOIN Location L ON L.ID_Location = MP.ID_Location
LEFT JOIN BillType MS ON MS.Value_BillType = MP.Type_FromBill
Left Join ModifyDepotBill On ModifyDepotBill.ID_ModifyDepotBill=MP.ID_ModifyDepotBill
WHERE No_ModifyDepotBill >= (case DataLength(@StartNo_ModifyDepotBill) When 0 Then No_ModifyDepotBill Else @StartNo_ModifyDepotBill End) And No_ModifyDepotBill <= (case DataLength(@EndNo_ModifyDepotBill) When 0 Then No_ModifyDepotBill Else @EndNo_ModifyDepotBill End)
Order By CAST(MP.No_ModifyDepotBillProduct AS INT)
]]>
ModifyDepotBill,ModifyDepotBillProduct
FrmStocktakingBill
= (case DataLength(@StartNo_StocktakingBill) When 0 Then No_StocktakingBill Else @StartNo_StocktakingBill End) And No_StocktakingBill <= (case DataLength(@EndNo_StocktakingBill) When 0 Then No_StocktakingBill Else @EndNo_StocktakingBill End)
SELECT No_StocktakingBillProduct,StockQty_StocktakingBillProduct,Quantity_StocktakingBillProduct,UnitPrice_StocktakingBillProduct = Case @Right When 'False' Then 0 Else UnitPrice_StocktakingBillProduct End,Comment_StocktakingBillProduct,
convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
Product.No_Product,Product.Name_Product,Product.Unit_Product,
Location.No_Location, Location.Name_Location,No_StocktakingBill
FROM StocktakingBillProduct
LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
LEFT JOIN StocktakingBill ON StocktakingBillProduct.ID_StocktakingBill = StocktakingBill.ID_StocktakingBill
WHERE No_StocktakingBill >= (case DataLength(@StartNo_StocktakingBill) When 0 Then No_StocktakingBill Else @StartNo_StocktakingBill End) And No_StocktakingBill <= (case DataLength(@EndNo_StocktakingBill) When 0 Then No_StocktakingBill Else @EndNo_StocktakingBill End)
And (Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct)!=0
order by CAST(No_StocktakingBillProduct AS INT)
]]>
StocktakingBill,StocktakingBillProduct
FrmSaleInvoicce
= (case DataLength(@StartNo) When 0 Then No_SaleInvoice Else @StartNo End) And No_SaleInvoice <= (case DataLength(@EndNo) When 0 Then No_SaleInvoice Else @EndNo End)
SELECT SaleInvoiceProduct.*,SaleInvoiceProduct.Quantity_SaleInvoiceProduct*SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct As Money,
SaleInvoiceProduct.Quantity_SaleInvoiceProduct*SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct*SaleInvoiceProduct.TaxRate_SaleInvoiceProduct As TaxMoney,
Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType,SaleInvoice.No_SaleInvoice
FROM SaleInvoiceProduct
LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
LEFT JOIN SaleInvoice On SaleInvoice.ID_SaleInvoice=SaleInvoiceProduct.ID_SaleInvoice
LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
WHERE No_SaleInvoice >= (case DataLength(@StartNo) When 0 Then No_SaleInvoice Else @StartNo End) And No_SaleInvoice <= (case DataLength(@EndNo) When 0 Then No_SaleInvoice Else @EndNo End)
]]>
SaleInvoice,SaleInvoiceProduct
FrmPurchaseInvoice
= (case DataLength(@StartNo) When 0 Then No_PurchaseInvoice Else @StartNo End) And No_PurchaseInvoice <= (case DataLength(@EndNo) When 0 Then No_PurchaseInvoice Else @EndNo End)
SELECT PurchaseInvoiceProduct.*,No_PurchaseInvoice,PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct*PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct As Money,
PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct*PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct*PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct As TaxMoney,
Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
FROM PurchaseInvoiceProduct
LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
LEFT JOIN PurchaseInvoice On PurchaseInvoice.ID_PurchaseInvoice=PurchaseInvoiceProduct.ID_PurchaseInvoice
LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
WHERE No_PurchaseInvoice >= (case DataLength(@StartNo) When 0 Then No_PurchaseInvoice Else @StartNo End) And No_PurchaseInvoice <= (case DataLength(@EndNo) When 0 Then No_PurchaseInvoice Else @EndNo End)
]]>
PurchaseInvoice,PurchaseInvoiceProduct
FrmIndentBillOnNet
= (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 as No_IndentBillOnNet
FROM IndentBillOnNetProduct
LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
Left Join IndentBillOnNet On IndentBillOnNet.ID_IndentBillOnNet=IndentBillOnNet.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)
]]>
IndentBillOnNet,IndentBillOnNetProduct