123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmCostSearch">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="库存成本查询";
- GetSchema();
- Search("SearchType");
- ChangeMode("Search");
- Empty();
- ]]>
- </Load>
- <Closing>
- ;<!--TODO-->
- </Closing>
- <Closed>
- ;<!--TODO-->
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- </Mode>
- <Controls>
- <IKTextButton name="txtProductNo1">
- <Events>
- <Click>
- @Temp = ShowSearchBox("ProductSearch","INFOMATION");
- if(@Temp != StringEmpty())
- {
- txtProductNo1.CValue = @Temp;
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="txtProductNo2">
- <Events>
- <Click>
- @Temp = ShowSearchBox("ProductSearch","INFOMATION");
- if(@Temp != StringEmpty())
- {
- txtProductNo2.CValue = @Temp;
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBox name="cbUnit1" />
- <IKComboBox name="cbUnit2" />
- <IKExtendGrid name="ikExtendGrid1" DataSource="Product" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Product.No_Product"/>
- <DataColumn Index="1" DataSource="Product.Name_Product"/>
- <DataColumn Index="2" DataSource="Product.InvoiceName_Product"/>
- <DataColumn Index="3" DataSource="Product.Unit_Product"/>
- <DataColumn Index="4" DataSource="Product.Cost_Product"/>
- <DataColumn Index="5" DataSource="Product.Price_Product"/>
- <DataColumn Index="6" DataSource="Product.StockQty_ProductStocks"/>
- <DataColumn Index="7" DataSource="Product.TotalCost"/>
- <Events>
- <ClickPreview>
- PrintReport(ikExtendGrid1.CurrentView);
- </ClickPreview>
- <ClickFilter>
- ;
- </ClickFilter>
- <ClickNOFilter>
- ;
- </ClickNOFilter>
- <ClickRefresh>
- Empty();
- @StartNo_Product =DBNull();
- @EndNo_Product =DBNull();
- @StartName_Product =DBNull();
- @EndName_Product =DBNull();
- @StartUnit_Product =DBNull();
- @EndUnit_Product =DBNull();
-
- if(!Equals(txtProductNo1.CValue,""))
- @StartNo_Product= txtProductNo1.CValue;
- if(!Equals(txtProductNo2.CValue,""))
- @EndNo_Product= txtProductNo2.CValue;
- if(!Equals(txtProductName1.CValue,""))
- @StartName_Product= txtProductName1.CValue;
- if(!Equals(txtProductName2.CValue,""))
- @EndName_Product= txtProductName2.CValue;
- if(!Equals(cbUnit1.Text,""))
- @StartUnit_Product= cbUnit1.Text;
- if(!Equals(cbUnit2.Text,""))
- @EndUnit_Product= cbUnit2.Text;
- Search("SearchCost",@StartNo_Product,@EndNo_Product,@StartName_Product,@EndName_Product,
- @StartUnit_Product,@EndUnit_Product);
- </ClickRefresh>
- </Events>
- </IKExtendGrid>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- Empty();
- @StartNo_Product =DBNull();
- @EndNo_Product =DBNull();
- @StartName_Product =DBNull();
- @EndName_Product =DBNull();
- @StartUnit_Product =DBNull();
- @EndUnit_Product =DBNull();
-
- if(!Equals(txtProductNo1.CValue,""))
- @StartNo_Product= txtProductNo1.CValue;
- if(!Equals(txtProductNo2.CValue,""))
- @EndNo_Product= txtProductNo2.CValue;
- if(!Equals(txtProductName1.CValue,""))
- @StartName_Product= txtProductName1.CValue;
- if(!Equals(txtProductName2.CValue,""))
- @EndName_Product= txtProductName2.CValue;
- if(!Equals(cbUnit1.Text,""))
- @StartUnit_Product= cbUnit1.Text;
- if(!Equals(cbUnit2.Text,""))
- @EndUnit_Product= cbUnit2.Text;
- Search("SearchCost",@StartNo_Product,@EndNo_Product,@StartName_Product,@EndName_Product,
- @StartUnit_Product,@EndUnit_Product);
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnClear">
- <Events>
- <Click>
- Empty();
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="SearchProductWithNo" MappingName="基本资料">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="Product" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- Select Top 0 No_Product,Name_Product,InvoiceName_Product,Unit_Product,Cost_Product,Price_Product,a.StockQty_ProductStocks,a.StockQty_ProductStocks*Cost_Product As TotalCost
- From Product
- Left Join
- (
- Select ID_Product,Sum(StockQty_ProductStocks) As StockQty_ProductStocks
- From ProductStocks
- Join Location On Location.ID_Location=ProductStocks.ID_Location
- Where Level_Location=1
- Group By ID_Product
- )a On a.ID_Product=Product.ID_Product
- "/>
-
- </Table>
- </Tables>
- <Search>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchCost CmdType="Text" CmdText="
- Select No_Product,Name_Product,InvoiceName_Product,Unit_Product,Cost_Product,Price_Product,a.StockQty_ProductStocks,a.StockQty_ProductStocks*Cost_Product As TotalCost
- From Product
- Left Join
- (
- Select ID_Product,Sum(StockQty_ProductStocks) As StockQty_ProductStocks
- From ProductStocks
- Join Location On Location.ID_Location=ProductStocks.ID_Location
- Where Level_Location=1
- Group By ID_Product
- )a On a.ID_Product=Product.ID_Product
- WHERE No_Product BETWEEN ISNULL(@StartNo_Product,'') AND ISNULL(@EndNo_Product,(SELECT MAX(No_Product) FROM Product))
- AND Name_Product BETWEEN ISNULL(@StartName_Product,'') AND ISNULL(@EndName_Product,(Select MAX(Name_Product) FROM Product))
- AND Unit_Product BETWEEN ISNULL(@StartUnit_Product,'') AND ISNULL(@EndUnit_Product,(Select MAX(Unit_Product) FROM Product))
-
- ">
- <Params>
- <Param name="@StartNo_Product" type="Product.No_Product" Index="0" />
- <Param name="@EndNo_Product" type="Product.No_Product" Index="1" />
- <Param name="@StartName_Product" type="Product.Name_Product" Index="2" />
- <Param name="@EndName_Product" type="Product.Name_Product" Index="3" />
- <Param name="@StartUnit_Product" type="Product.Unit_Product" Index="4" />
- <Param name="@EndUnit_Product" type="Product.Unit_Product" Index="5" />
- </Params>
- <Tables>
- <Table name="Product"/>
- </Tables>
- </SearchCost>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=7 Order By Name_TypeDef ">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- </Search>
- </Server>
- <Lables>
- <Search>
- SuspendLayout();
- for(@i=0;@i<RowCount("#Type");@i++)
- {
- SetPosition("#Type",@i);
- cbUnit1.Items.Add(#Type.Name_TypeDef);
- cbUnit2.Items.Add(#Type.Name_TypeDef);
- }
- ResumeLayout();
- </Search>
- </Lables>
- </Form>
- </Forms>
-
|