123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmInventorySearch">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="库存异动查询";
- GetSchema();
- Search("SearchLocation");
- SuspendLayout();
- for(@i=0;@i<RowCount("#Location");@i=@i+1)
- {
- SetPosition("#Location", @i);
- cbLocation.Items.Add(#Location.Name_Location);
- }
- ResumeLayout();
- Search("SearchType");
- Search("SearchLowLocation");
- Empty();
- EndDate.Value=GetCurrentTime();
- StartDate.Value=GetCurrentTime();
-
- cbLocation.Text = GetCurrentDepot();
- ]]>
- </Load>
- <Closing>
- ;<!--TODO-->
- </Closing>
- <Closed>
- ;<!--TODO-->
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- </Mode>
- <Controls>
- <!--<IKCheckedListBox name="CLB_Location" DataSource="Location" DisplayMember="Name_location" ValueMember="ID_Location">
- <Events>
- <ItemCheck>
- if(CLB_Location.SelectedIndex == 0)
- CLB_Location.SelectAllItems();
- </ItemCheck>
- </Events>
- </IKCheckedListBox>-->
- <IKComboBox name ="cbLocation" DataSource="Location" DisplayMember="Name_Location" >
- </IKComboBox>
- <IKTextButton name="tbLocationNo1" DataSource="LowLocation.No_Location">
- <Events>
- <Click>
- <![CDATA[
- if (tbLocationNo1.ReadOnly == false)
- {
- @temp = ShowSearchBox("LocationSearch","INFOMATION",tbLocationNo1.CValue,cbLocation.SelectedItem);
- if( @temp == "" )
- return;
- tbLocationNo1.CValue = @temp;
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbLocationNo2" DataSource="LowLocation.No_Location">
- <Events>
- <Click>
- <![CDATA[
- if (tbLocationNo2.ReadOnly == false)
- {
- @temp = ShowSearchBox("LocationSearch","INFOMATION",tbLocationNo2.CValue,cbLocation.SelectedItem);
- if( @temp == "" )
- return;
- tbLocationNo2.CValue = @temp;
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbType1" DataSource="Type" DisplayMember="Name_TypeDef" />
- <IKComboBoxEx name="cbType2" DataSource="Type" DisplayMember="Name_TypeDef" />
- <IKExtendGrid name="dgProduct" DataSource="Total" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Total.No_Product"/>
- <DataColumn Index="1" DataSource="Total.Name_Product"/>
- <DataColumn Index="2" DataSource="Total.Type_Product"/>
- <DataColumn Index="3" DataSource="Total.No_Location"/>
- <DataColumn Index="4" DataSource="Total.OpeningStockQty_ProductStocks"/>
- <DataColumn Index="5" DataSource="Total.Quantity_SaleOutDepotBillProduct"/>
- <DataColumn Index="6" DataSource="Total.OutQuantity_ModifyDepotBillProduct"/>
- <DataColumn Index="7" DataSource="Total.Quantity_PurchaseInDepotBillProduct"/>
- <DataColumn Index="8" DataSource="Total.InQuantity_ModifyDepotBillProduct"/>
- <DataColumn Index="9" DataSource="Total.InQuantity_StocktakingBillProduct"/>
- <DataColumn Index="10" DataSource="Total.OutQuantity_StocktakingBillProduct"/>
- <DataColumn Index="11" DataSource="Total.StockQty_ProductStocks"/>
- <Events>
- <ClickPreview>
- PrintReport(dgProduct.CurrentView);
- </ClickPreview>
- <ClickRefresh>
- Empty();
- <Lable name="btnActionClick"/>
- </ClickRefresh>
- <ClickFilter>
- txtSum.CValue=SumOfCol("#Total.Quantity_RealSale",dgProduct.FilterCondition,true);
- </ClickFilter>
- <ClickNOFilter>
- txtSum.CValue=SumOfCol("#Total.Quantity_RealSale",dgProduct.FilterCondition,true);
- </ClickNOFilter>
- </Events>
- </IKExtendGrid>
- <IKButton name="btnAction">
- <Events>
- <Click>
- <Lable name="btnActionClick"/>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnEmpty">
- <Events>
- <Click>
- Empty();
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="LocationSearch" DataSource="Location" SearchFunction="SearchAllLocation" SearchFunctionByNo="" MappingName="库位" >
- <DataColumn Index="0" MappingName="#Location.No_Location" HeaderText="库位编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#LowLocation.No_Location"/>
- <DataColumn Index="1" MappingName="#Location.Name_Location" HeaderText="库位名称" Width="120" ColumnType="IKDataGridTextBoxColumn" />
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="Total" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- Select Top 0 Product.No_Product,Product.Name_Product,Product.Type_Product,Product.Cost_Product,ProductStocks.OpeningAvailableQty_ProductStocks,OpeningStockQty_ProductStocks,ProductStocks.AvailableQty_ProductStocks,StockQty_ProductStocks,SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct,SaleRtnBillProduct.Quantity_SaleRtnBillProduct,
- a.Quantity_ModifyDepotBillProduct As OutQuantity_ModifyDepotBillProduct,b.Quantity_ModifyDepotBillProduct As InQuantity_ModifyDepotBillProduct,PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct,
- c.Quantity_StocktakingBillProduct As OutQuantity_StocktakingBillProduct,d.Quantity_StocktakingBillProduct As InQuantity_StocktakingBillProduct,No_Location
- From Product
- Left Join ProductStocks On ProductStocks.ID_Product=Product.ID_Product
- Left Join SaleOutDepotBillProduct On SaleOutDepotBillProduct.ID_Product=Product.ID_Product
- Left Join SaleRtnBillProduct On SaleRtnBillProduct.ID_Product=Product.ID_Product
- Left Join ModifyDepotBillProduct a On a.ID_Product=Product.ID_Product
- Left Join ModifyDepotBillProduct b On b.ID_Product=Product.ID_Product
- Left Join PurchaseInDepotBillProduct On PurchaseInDepotBillProduct.ID_Product=Product.ID_Product
- Left Join StocktakingBillProduct c ON c.ID_Product=Product.ID_Product
- Left Join StocktakingBillProduct d On d.ID_Product=Product.ID_Product
- Left Join Location On Location.ID_Location = ProductStocks.ID_Location
- "/>
- </Table>
- </Tables>
- <Search>
- <SearchLocation CmdType="Text" CmdText="Select Name_Location,No_Location from Location where Level_Location = 0
- Union Select '全部' As Name_Location, '00' As No_Location">
- <Tables>
- <Table name="Location"/>
- </Tables>
- </SearchLocation>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=8 Order By Name_TypeDef ">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- <SearchAllLocation CmdType="Text" CmdText="Select No_Location,Name_Location
- From Location Where ID_Warehouse IN(
- Select ID_Location
- From Location
- ">
- <Tables>
- <Table name="AllLocation" />
- </Tables>
- </SearchAllLocation>
- <SearchLowLocation CmdType="" CmdText="Select No_Location From Location Where Level_Location = 1">
- <Tables>
- <Table name="LowLocation"/>
- </Tables>
- </SearchLowLocation>
- </Search>
- </Server>
- <Lables>
- <Search>
- </Search>
- <btnActionClick>
- @LocationAll = " la.No_Location In (Select No_Location From Location Where Level_Location = 0)" ;
- if(cbLocation.SelectedItem == "全部")
- {
- @Location = "x.Level_Location = 1";
- }
- else
- {
- @Location = " x.Level_Location = 1 And x.No_Location BETWEEN ISNULL(@StartNo_Location,x.No_Location) AND ISNULL(@EndNo_Location,x.No_Location) And s.Name_Location = '" + cbLocation.SelectedItem + "'";
- }
- @dateCondition=" between "+" DATEADD(day,0,DATEDIFF(day,0,"+"'"+TypeConvert("String",StartDate.Value)+"'"+")) and "+" DATEADD(day,0,(DATEDIFF(day,0,"+"'"+TypeConvert("String",EndDate.Value)+"'"+")+1))";
- @bisNow=" <= DATEADD(day,0,(DATEDIFF(day,0,'"+TypeConvert("String",EndDate.Value)+"')+1))";
- @sqlCmd=" Declare @StartNo_Location Nvarchar(64) Set @StartNo_Location = Null"
- +" Declare @EndNo_Location Nvarchar(64) Set @EndNo_Location = Null";
- if(tbLocationNo1.CValue != "")
- {
- @sqlCmd = @sqlCmd + " Set @StartNo_Location ='" +tbLocationNo1.CValue+"'";
- }
- if(tbLocationNo2.CValue != "")
- {
- @sqlCmd = @sqlCmd + " Set @EndNo_Location ='" +tbLocationNo2.CValue+"'";
- }
- @sqlCmd =@sqlCmd +" Select No_Location,Product.No_Product,Product.Name_Product,Product.Type_Product,Product.Cost_Product,(IsNull(b.OpeningStockQty_ProductStocks,0)-IsNull(d1.Quantity_SaleOutDepotBillProduct,0)-IsNull(f1.OutQuantity_ModifyDepotBillProduct,0)+IsNull(h1.Quantity_PurchaseInDepotBillProduct,0)+IsNull(e1.InQuantity_ModifyDepotBillProduct,0)+IsNull(d.Quantity_SaleOutDepotBillProduct,0)+IsNull(f.OutQuantity_ModifyDepotBillProduct,0)-IsNull(h.Quantity_PurchaseInDepotBillProduct,0)-IsNull(e.InQuantity_ModifyDepotBillProduct,0)) As OpeningStockQty_ProductStocks ,(IsNull(b.OpeningStockQty_ProductStocks,0)-IsNull(d1.Quantity_SaleOutDepotBillProduct,0)-IsNull(f1.OutQuantity_ModifyDepotBillProduct,0)+IsNull(h1.Quantity_PurchaseInDepotBillProduct,0)+IsNull(e1.InQuantity_ModifyDepotBillProduct,0)) As StockQty_ProductStocks,"
- +" IsNull(d.Quantity_SaleOutDepotBillProduct,0) As Quantity_SaleOutDepotBillProduct,IsNull(e.InQuantity_ModifyDepotBillProduct,0) As InQuantity_ModifyDepotBillProduct,IsNull(f.OutQuantity_ModifyDepotBillProduct,0) As OutQuantity_ModifyDepotBillProduct,"
- +" IsNull(h.Quantity_PurchaseInDepotBillProduct,0) As Quantity_PurchaseInDepotBillProduct,IsNull(i.InQuantity_StocktakingBillProduct,0) As InQuantity_StocktakingBillProduct,IsNull(j.OutQuantity_StocktakingBillProduct,0) As OutQuantity_StocktakingBillProduct"
- +" From "
- +" ( "
- +" Select ID_Product,ID_Location From ProductStocks"
- +" )a"
- +" Left Join Product On Product.ID_Product = a.ID_Product"
- +" Join"
- +" ("
- +" Select ID_Location,ProductStocks.ID_Product,Sum(OpeningStockQty_ProductStocks) As OpeningStockQty_ProductStocks"
- +" From ProductStocks"
- +" Where ID_Location IN("
- +" Select x.ID_Location From Location x"
- +" Left Join Location s On x.ID_Warehouse = s.ID_Location Where "
- + @Location
- +" )"
- +" Group By ID_Product,ID_Location"
- +" )b On a.ID_Product=b.ID_Product And a.ID_Location = b.ID_Location"
-
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,SaleOutDepotBillProduct.ID_Product,Sum(SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct) As Quantity_SaleOutDepotBillProduct"
- +" From SaleOutDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = SaleOutDepotBillProduct.ID_Location"
- +" Join SaleOutDepotBill On SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill"
- +" Join Location la On la.ID_Location=SaleOutDepotBill.ID_Location"
- +" Where SaleOutDepotBill.ID_Assessor Is Not Null And SaleOutDepotBill.Date_SaleOutDepotBill "+@dateCondition+ " And "+@LocationAll
- +" Group By SaleOutDepotBillProduct.ID_Product,lb.ID_Location"
- +" )d On a.ID_Product=d.ID_Product And a.ID_Location = d.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,ModifyDepotBillProduct.ID_Product,Sum(Quantity_ModifyDepotBillProduct) As InQuantity_ModifyDepotBillProduct"
- +" From ModifyDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = ModifyDepotBillProduct.ID_Location"
- +" Join ModifyDepotBill On ModifyDepotBillProduct.ID_ModifyDepotBill=ModifyDepotBill.ID_ModifyDepotBill"
- +" Join ModifyTypeSettings On ModifyTypeSettings.ID_ModifyTypeSettings=ModifyDepotBill.Style_ModifyDepotBill"
- +" Join Location la On la.ID_Location=ModifyDepotBill.ID_Location"
- +" Where ModifyDepotBill.ID_Assessor Is Not Null And ModifyTypeSettings.Type_ModifyTypeSettings=1 And Date_ModifyDepotBill "+@dateCondition+ " And "+@LocationAll
- +" Group By ModifyDepotBillProduct.ID_Product,lb.ID_Location"
- +" )e On a.ID_Product=e.ID_Product And a.ID_Location = e.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,ModifyDepotBillProduct.ID_Product,Sum(Quantity_ModifyDepotBillProduct) As OutQuantity_ModifyDepotBillProduct"
- +" From ModifyDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = ModifyDepotBillProduct.ID_Location"
- +" Join ModifyDepotBill On ModifyDepotBillProduct.ID_ModifyDepotBill=ModifyDepotBill.ID_ModifyDepotBill"
- +" Join ModifyTypeSettings On ModifyTypeSettings.ID_ModifyTypeSettings=ModifyDepotBill.Style_ModifyDepotBill"
- +" Join Location la On la.ID_Location=ModifyDepotBill.ID_Location"
- +" Where ModifyDepotBill.ID_Assessor Is Not Null And ModifyTypeSettings.Type_ModifyTypeSettings=0 And Date_ModifyDepotBill "+@dateCondition+ " And "+@LocationAll
- +" Group By ModifyDepotBillProduct.ID_Product,lb.ID_Location"
- +" )f On a.ID_Product=f.ID_Product And a.ID_Location = f.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,PurchaseInDepotBillProduct.ID_Product,Sum(Quantity_PurchaseInDepotBillProduct) As Quantity_PurchaseInDepotBillProduct"
- +" From PurchaseInDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = PurchaseInDepotBillProduct.ID_Location"
- +" Join PurchaseInDepotBill On PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill"
- +" Join Location la On la.ID_Location=PurchaseInDepotBill.ID_Location"
- +" Where PurchaseInDepotBill.ID_Assessor Is Not Null And PurchaseInDepotBill.Date_PurchaseInDepotBill "+@dateCondition+ " And "+@LocationAll
- +" Group By PurchaseInDepotBillProduct.ID_Product,lb.ID_Location"
- +" )h On a.ID_Product=h.ID_Product And a.ID_Location = h.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,StocktakingBillProduct.ID_Product,Sum(StocktakingBillProduct.Quantity_StocktakingBillProduct-StocktakingBillProduct.StockQty_StocktakingBillProduct) As InQuantity_StocktakingBillProduct"
- +" From StocktakingBillProduct"
- +" Left Join Location lb On lb.ID_Location = StocktakingBillProduct.ID_Location"
- +" Join StocktakingBill On StocktakingBill.ID_StocktakingBill=StocktakingBillProduct.ID_StocktakingBill"
- +" Join Location la On la.ID_Location=StocktakingBill.ID_Location"
- +" Where StocktakingBill.ID_Assessor Is Not Null And (StocktakingBillProduct.Quantity_StocktakingBillProduct-StocktakingBillProduct.StockQty_StocktakingBillProduct) > 0 And StocktakingBill.Date_StocktakingBill "+@dateCondition+ " And "+@LocationAll
- +" Group By StocktakingBillProduct.ID_Product,lb.ID_Location"
- +" )i On a.ID_Product=i.ID_Product And a.ID_Location = i.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,StocktakingBillProduct.ID_Product,-Sum(StocktakingBillProduct.Quantity_StocktakingBillProduct-StocktakingBillProduct.StockQty_StocktakingBillProduct) As OutQuantity_StocktakingBillProduct"
- +" From StocktakingBillProduct"
- +" Left Join Location lb On lb.ID_Location = StocktakingBillProduct.ID_Location"
- +" Join StocktakingBill On StocktakingBill.ID_StocktakingBill=StocktakingBillProduct.ID_StocktakingBill"
- +" Join Location la On la.ID_Location=StocktakingBill.ID_Location"
- +" Where StocktakingBill.ID_Assessor Is Not Null And (StocktakingBillProduct.Quantity_StocktakingBillProduct-StocktakingBillProduct.StockQty_StocktakingBillProduct) < 0 And StocktakingBill.Date_StocktakingBill "+@dateCondition+ " And "+@LocationAll
- +" Group By StocktakingBillProduct.ID_Product,lb.ID_Location"
- +" )j On a.ID_Product=j.ID_Product And a.ID_Location = i.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,SaleOutDepotBillProduct.ID_Product,Sum(SaleOutDepotBillProduct.Quantity_SaleOutDepotBillProduct) As Quantity_SaleOutDepotBillProduct"
- +" From SaleOutDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = SaleOutDepotBillProduct.ID_Location"
- +" Join SaleOutDepotBill On SaleOutDepotBill.ID_SaleOutDepotBill=SaleOutDepotBillProduct.ID_SaleOutDepotBill"
- +" Join Location la On la.ID_Location=SaleOutDepotBill.ID_Location"
- +" Where SaleOutDepotBill.ID_Assessor Is Not Null And SaleOutDepotBill.Date_SaleOutDepotBill "+@bisNow+ " And "+@LocationAll
- +" Group By SaleOutDepotBillProduct.ID_Product,lb.ID_Location"
- +" )d1 On a.ID_Product=d1.ID_Product And a.ID_Location = d1.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,ModifyDepotBillProduct.ID_Product,Sum(Quantity_ModifyDepotBillProduct) As InQuantity_ModifyDepotBillProduct"
- +" From ModifyDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = ModifyDepotBillProduct.ID_Location"
- +" Join ModifyDepotBill On ModifyDepotBillProduct.ID_ModifyDepotBill=ModifyDepotBill.ID_ModifyDepotBill"
- +" Join ModifyTypeSettings On ModifyTypeSettings.ID_ModifyTypeSettings=ModifyDepotBill.Style_ModifyDepotBill"
- +" Join Location la On la.ID_Location=ModifyDepotBill.ID_Location"
- +" Where ModifyDepotBill.ID_Assessor Is Not Null And ModifyTypeSettings.Type_ModifyTypeSettings=1 And Date_ModifyDepotBill "+@bisNow+ " And "+@LocationAll
- +" Group By ModifyDepotBillProduct.ID_Product,lb.ID_Location"
- +" )e1 On a.ID_Product=e1.ID_Product And a.ID_Location = e1.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,ModifyDepotBillProduct.ID_Product,Sum(Quantity_ModifyDepotBillProduct) As OutQuantity_ModifyDepotBillProduct"
- +" From ModifyDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = ModifyDepotBillProduct.ID_Location"
- +" Join ModifyDepotBill On ModifyDepotBillProduct.ID_ModifyDepotBill=ModifyDepotBill.ID_ModifyDepotBill"
- +" Join ModifyTypeSettings On ModifyTypeSettings.ID_ModifyTypeSettings=ModifyDepotBill.Style_ModifyDepotBill"
- +" Join Location la On la.ID_Location=ModifyDepotBill.ID_Location"
- +" Where ModifyDepotBill.ID_Assessor Is Not Null And ModifyTypeSettings.Type_ModifyTypeSettings=0 And Date_ModifyDepotBill "+@bisNow+ " And "+@LocationAll
- +" Group By ModifyDepotBillProduct.ID_Product,lb.ID_Location"
- +" )f1 On a.ID_Product=f1.ID_Product And a.ID_Location = f1.ID_Location"
- +" Left Join"
- +" ("
- +" Select lb.ID_Location,PurchaseInDepotBillProduct.ID_Product,Sum(Quantity_PurchaseInDepotBillProduct) As Quantity_PurchaseInDepotBillProduct"
- +" From PurchaseInDepotBillProduct"
- +" Left Join Location lb On lb.ID_Location = PurchaseInDepotBillProduct.ID_Location"
- +" Join PurchaseInDepotBill On PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill"
- +" Join Location la On la.ID_Location=PurchaseInDepotBill.ID_Location"
- +" Where PurchaseInDepotBill.ID_Assessor Is Not Null And PurchaseInDepotBill.Date_PurchaseInDepotBill "+@bisNow+ " And "+@LocationAll
- +" Group By PurchaseInDepotBillProduct.ID_Product,lb.ID_Location"
- +" )h1 On a.ID_Product=h1.ID_Product And a.ID_Location = h1.ID_Location"
- +" Left Join Location On Location.ID_Location = a.ID_Location";
- @where=true;
- if(cbType1.Text!="")
- {
- if(@where==true)
- {
- @sqlCmd=@sqlCmd+" Where Type_Product >=" +"'"+cbType1.Text+"'";
- @where=false;
- }
- else
- {
- @sqlCmd=@sqlCmd+" And Type_Product >=" +"'"+cbType1.Text+"'";
- }
- }
- if(cbType2.Text!="")
- {
- if(@where==true)
- {
- @sqlCmd=@sqlCmd+" Where Type_Product <="+"'"+cbType2.Text+"'";
- @where=false;
- }
- else
- {
- @sqlCmd=@sqlCmd+" And Type_Product <="+"'"+cbType2.Text+"'";
- }
- }
- if(ckSuspend.Checked)
- {
- if(@where==true)
- {
- @sqlCmd=@sqlCmd+" Where (IsNull(IsNull(d.Quantity_SaleOutDepotBillProduct,0)+IsNull(f.OutQuantity_ModifyDepotBillProduct,0)+IsNull(h.Quantity_PurchaseInDepotBillProduct,0)+IsNull(e.InQuantity_ModifyDepotBillProduct,0)+IsNull(i.InQuantity_StocktakingBillProduct,0)+IsNull(j.OutQuantity_StocktakingBillProduct,0),0)) > 0 ";
- @where=false;
- }
- else
- {
- @sqlCmd=@sqlCmd+" And (IsNull(d.Quantity_SaleOutDepotBillProduct,0)+IsNull(f.OutQuantity_ModifyDepotBillProduct,0)+IsNull(h.Quantity_PurchaseInDepotBillProduct,0)+IsNull(e.InQuantity_ModifyDepotBillProduct,0)+IsNull(i.InQuantity_StocktakingBillProduct,0)+IsNull(j.OutQuantity_StocktakingBillProduct,0),0)) > 0 ";
- }
- }
- @sqlCmd=@sqlCmd+" Order By Product.No_Product ";
- MessageBox(@sqlCmd,@Title);
- SearchEx(@sqlCmd,"Total");
-
- </btnActionClick>
-
- </Lables>
- </Form>
- </Forms>
|