123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- <?xml version="1.0" encoding="utf-8" ?>
- <PrintSqlDataSet>
- <PrintSql>
- <FormName>FrmSaleBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- Declare @Special bit
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- set @Special={2}
- SELECT SaleBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
- Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Location.No_Location, Location.Name_Location, Employee.No_Employee AS No_Principal,Employee.Name_Employee AS Principal_SaleBill,Customer.ID_Creator As CustomerCreator
- FROM SaleBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = SaleBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = SaleBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = SaleBill.LastModUser_SaleBill
- LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal
- 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
-
-
- 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
- ]]>
- </SqlText>
- <TableName>SaleBill,SaleBillProduct,ReportComment</TableName>
- </PrintSql>
- <PrintSql>
- <FormName>FrmIndentBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- Declare @Special bit
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- set @Special={2}
- SELECT IndentBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
- Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Location.No_Location, Location.Name_Location, Employee.No_Employee AS No_Principal,Employee.Name_Employee AS Principal_IndentBill,Customer.ID_Creator As CustomerCreator
- FROM IndentBill
- LEFT JOIN Customer ON Customer.ID_Customer = IndentBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = IndentBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = IndentBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = IndentBill.LastModUser_IndentBill
- LEFT JOIN Location ON Location.ID_Location = IndentBill.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee = IndentBill.ID_Principal
- 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
-
- 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
- ]]>
- </SqlText>
- <TableName>IndentBill,IndentBillProduct,ReportComment</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmPriceQueryBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Customer.ID_Creator As CustomerCreator,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- 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)
- 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
- ]]>
- </SqlText>
- <TableName>PriceQueryBill,PriceQueryBillProduct,ReportComment</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmSaleRtnBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- DECLARE @ID_SaleOutDepotBill uniqueidentifier
- SELECT @ID_SaleOutDepotBill = ID_SaleOutDepotBill FROM SaleOutDepotBill JOIN SaleRtnBillProduct ON SaleOutDepotBill.No_SaleOutDepotBill = SaleRtnBillProduct.No_FromBill
- SELECT SaleRtnBill.*, Customer.No_Customer, Customer.ShortName_Customer, Location.Name_Location,Location.No_Location,Customer.ID_Creator As CustomerCreator,
- SaleRtnBill.IsPrevBill_SaleRtnBill,
- SaleRtnBill.AssessDate_SaleRtnBill,
- AppUser.LoginName_User as Name_Creator, Employee.No_Employee AS No_Principal,
- Employee.Name_Employee AS Principal_SaleRtnBill,
- A1.LoginName_User as Name_Assessor,
- A2.LoginName_User as LastModUserName_SaleRtnBill
- FROM SaleRtnBill
- JOIN Customer ON Customer.ID_Customer = SaleRtnBill.ID_Customer
- JOIN Location ON Location.ID_Location = SaleRtnBill.ID_Location
- JOIN AppUser ON AppUser.ID_User = SaleRtnBill.ID_Creator
- LEFT JOIN AppUser A1 ON A1.ID_User = SaleRtnBill.ID_Assessor
- LEFT JOIN AppUser A2 ON A2.ID_User = SaleRtnBill.LastModUser_SaleRtnBill
- LEFT JOIN Employee ON Employee.ID_Employee = SaleRtnBill.ID_Principal
- 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 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)
- ]]>
- </SqlText>
- <TableName>SaleRtnBill,SaleRtnBillProduct</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmPurchaseBill</FormName>
- <SqlText>
- <![CDATA[
- declare @StartNo nvarchar(64)
- declare @EndNo nvarchar(64)
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- SELECT PurchaseOrderBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,Name_Location,No_Location,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
- FROM PurchaseOrderBill
- LEFT JOIN AppUser a ON a.ID_User=PurchaseOrderBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User=PurchaseOrderBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User=PurchaseOrderBill.LastModUser_PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseOrderBill.ID_Supplier
- LEFT JOIN Location ON Location.ID_Location=PurchaseOrderBill.ID_Location
- LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseOrderBill.ID_Principal
- LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseOrderBill.Name_Linkman
- WHERE No_PurchaseOrderBill between (case DataLength(@StartNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @EndNo end)
- AND Disable_PurchaseOrderBill=0
- SELECT PurchaseOrderBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct*PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct As Money,BillType.Name_BillType,PurchaseOrderBill.No_PurchaseOrderBill as No_PurchaseOrderBill
- FROM PurchaseOrderBillProduct
- LEFT JOIN Product ON PurchaseOrderBillProduct.ID_Product=Product.ID_Product
- LEFT JOIN BillType ON BillType.Value_BillType=PurchaseOrderBillProduct.Type_FromBill
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBillProduct.ID_PurchaseOrderBill=PurchaseOrderBill.ID_PurchaseOrderBill
- WHERE No_PurchaseOrderBill between (case DataLength(@StartNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @EndNo end)
- AND Disable_PurchaseOrderBill=0
- Order By CAST(No_PurchaseOrderBillProduct AS INT)
- SELECT ReportComment.*,PurchaseOrderBill.No_PurchaseOrderBill
- FROM ReportComment
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill=ReportComment.ID_Bill
- WHERE No_PurchaseOrderBill between (case DataLength(@StartNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseOrderBill.No_PurchaseOrderBill else @EndNo end)
- AND Disable_PurchaseOrderBill=0
- ORDER BY ReportComment.No_ReportComment
- ]]>
- </SqlText>
- <TableName>PurchaseOrderBill,PurchaseOrderBillProduct,ReportComment</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmPurchaseQueryBill</FormName>
- <SqlText>
- <![CDATA[
- declare @StartNo nvarchar(64)
- declare @EndNo nvarchar(64)
- set @StartNo = '{0}'
- set @EndNo = '{1}'
- SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
- FROM PurchaseQueryBill
- LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
- LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
- LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
- WHERE No_PurchaseQueryBill between (case DataLength(@StartNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @EndNo end)
- SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money, PurchaseQueryBill.No_PurchaseQueryBill as No_PurchaseQueryBill
- From PurchaseQueryBillProduct
- LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
- LEFT JOIN PurchaseQueryBill ON PurchaseQueryBillProduct.ID_PurchaseQueryBill=PurchaseQueryBill.ID_PurchaseQueryBill
- WHERE No_PurchaseQueryBill between (case DataLength(@StartNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @EndNo end)
- Order By CAST(PurchaseQueryBillProduct.No_PurchaseQueryBillProduct AS INT)
- SELECT ReportComment.*,PurchaseQueryBill.No_PurchaseQueryBill
- FROM ReportComment
- LEFT JOIN PurchaseQueryBill ON PurchaseQueryBill.ID_PurchaseQueryBill=ReportComment.ID_Bill
- WHERE No_PurchaseQueryBill between (case DataLength(@StartNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @StartNo end) and (case DataLength(@EndNo) when 0 then PurchaseQueryBill.No_PurchaseQueryBill else @EndNo end)
- ORDER BY ReportComment.No_ReportComment
- ]]>
- </SqlText>
- <TableName>PurchaseQueryBill,PurchaseQueryBillProduct,ReportComment</TableName>
- </PrintSql>
- <PrintSql>
- <FormName>FrmPurchaseInDepotBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo_PurchaseInDepotBill nvarchar(64)
- Declare @EndNo_PurchaseInDepotBill nvarchar(64)
- Set @StartNo_PurchaseInDepotBill='{0}'
- Set @EndNo_PurchaseInDepotBill='{1}'
- SELECT PurchaseInDepotBill.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Location.Name_Location,Location.No_Location,Employee.No_Employee As No_Principal,Employee.Name_Employee As Name_Principal,Supplier.No_Supplier,Supplier.ShortName_Supplier
- FROM PurchaseInDepotBill
- LEFT JOIN AppUser a ON PurchaseInDepotBill.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInDepotBill.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInDepotBill.LastModUser_PurchaseInDepotBill=c.ID_User
- LEFT JOIN Location ON PurchaseInDepotBill.ID_Location=Location.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee=PurchaseInDepotBill.ID_QA
- LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseInDepotBill.ID_Supplier
- 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)
- 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)
- ]]>
- </SqlText>
- <TableName>PurchaseInDepotBill,PurchaseInDepotBillProduct</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmSaleOutDepotBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo_SaleOutDepotBill nvarchar(64)
- Declare @EndNo_SaleOutDepotBill nvarchar(64)
- Declare @Right nvarchar(64)
-
- Set @StartNo_SaleOutDepotBill='{0}'
- Set @EndNo_SaleOutDepotBill='{1}'
- Set @Right = '{2}'
-
- select * From
- (
- SELECT SaleOutDepotBill.*,a.Name_User,b.Name_User as Name_UserAuti,c.Name_User as Name_LastModUser,
- Location.Name_Location,Location.No_Location,Customer.Name_Customer, Customer.ShortName_Customer,Customer.No_Customer
- FROM SaleOutDepotBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleOutDepotBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = SaleOutDepotBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = SaleOutDepotBill.ID_Assessor
- Left JOIN AppUser c ON c.ID_User = SaleOutDepotBill.LastModUser_SaleOutDepotBill
- LEFT JOIN Location ON Location.ID_Location = SaleOutDepotBill.ID_Location
- 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
- )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
- ]]>
- </SqlText>
- <TableName>SaleOutDepotBill,ReportComment,SaleBill</TableName>
- </PrintSql>
-
-
- <PrintSql>
- <FormName>FrmInventoryChangeBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo_ModifyDepotBill nvarchar(64)
- Declare @EndNo_ModifyDepotBill nvarchar(64)
- Declare @Right NVARCHAR(64);
-
- Set @StartNo_ModifyDepotBill='{0}'
- Set @EndNo_ModifyDepotBill='{1}'
- Set @Right = '{2}'
- SELECT M.*,
- L.Name_Location AS ChangedDepot_ModifyDepotBill,
- L.No_Location AS ChangedDepotNo_ModifyDepotBill,
- MD.ModName_ModifyTypeSettings AS ModifyDepotBill_ModifyDepotBill,
- E.Name_Employee AS Proposer_ModifyDepotBill,
- E.No_Employee AS ProposerNo_ModifyDepotBill,
- A.Name_User AS Maker_ModifyDepotBill,
- A1.Name_User AS Assessor_ModifyDepotBill,
- A2.Name_User AS lastModflyuser_ModifyDepotBill,
- B.Sum_ModifyDepotBill
- FROM ModifyDepotBill M
- INNER JOIN LOCATION L ON M.ID_Location = L.ID_Location
- LEFT JOIN ModifyTypeSettings MD ON MD.ID_ModifyTypeSettings = M.Style_ModifyDepotBill
- INNER JOIN Employee E ON E.ID_Employee = M.ID_Proposer
- INNER JOIN AppUser A ON A.ID_User = M.ID_Creator
- LEFT JOIN AppUser A1 ON A1.ID_User = M.ID_Assessor
- LEFT JOIN AppUser A2 ON A2.ID_User = M.LastModUser_ModifyDepotBill
- Left Join (
- Select ID_ModifyDepotBill,SUM(Quantity_ModifyDepotBillProduct) As Sum_ModifyDepotBill
- From ModifyDepotBillProduct
- Group By ID_ModifyDepotBill )B On B.ID_ModifyDepotBill=M.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)
- 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)
- ]]>
- </SqlText>
- <TableName>ModifyDepotBill,ModifyDepotBillProduct</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmStocktakingBill</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo_StocktakingBill nvarchar(64)
- Declare @EndNo_StocktakingBill nvarchar(64)
- Declare @Right nvarchar(64)
- Set @StartNo_StocktakingBill='{0}'
- Set @EndNo_StocktakingBill='{1}'
- Set @Right = '{2}'
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- 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)
-
- 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)
- ]]>
- </SqlText>
- <TableName>StocktakingBill,StocktakingBillProduct</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmSaleInvoicce</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- Set @StartNo='{0}'
- Set @EndNo='{1}'
- SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer,Customer.Account_Customer,Customer.GetMethod_Customer,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- 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)
- 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)
- ]]>
- </SqlText>
- <TableName>SaleInvoice,SaleInvoiceProduct</TableName>
- </PrintSql>
-
- <PrintSql>
- <FormName>FrmPurchaseInvoice</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- Set @StartNo='{0}'
- Set @EndNo='{1}'
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- 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)
-
- 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)
- ]]>
- </SqlText>
- <TableName>PurchaseInvoice,PurchaseInvoiceProduct</TableName>
- </PrintSql>
- <PrintSql>
- <FormName>FrmIndentBillOnNet</FormName>
- <SqlText>
- <![CDATA[
- Declare @StartNo nvarchar(64)
- Declare @EndNo nvarchar(64)
- Set @StartNo='{0}'
- Set @EndNo='{1}'
- 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 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)
- ]]>
- </SqlText>
- <TableName>IndentBillOnNet,IndentBillOnNetProduct</TableName>
- </PrintSql>
- </PrintSqlDataSet>
|