FrmCostSearch.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmCostSearch">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="库存成本查询";
  9. GetSchema();
  10. Search("SearchType");
  11. ChangeMode("Search");
  12. Empty();
  13. ]]>
  14. </Load>
  15. <Closing>
  16. ;<!--TODO-->
  17. </Closing>
  18. <Closed>
  19. ;<!--TODO-->
  20. </Closed>
  21. </Events>
  22. <Mode>
  23. <Search>
  24. <Lable name="Search" />
  25. </Search>
  26. </Mode>
  27. <Controls>
  28. <IKTextButton name="txtProductNo1">
  29. <Events>
  30. <Click>
  31. @Temp = ShowSearchBox("ProductSearch","INFOMATION");
  32. if(@Temp != StringEmpty())
  33. {
  34. txtProductNo1.CValue = @Temp;
  35. }
  36. </Click>
  37. </Events>
  38. </IKTextButton>
  39. <IKTextButton name="txtProductNo2">
  40. <Events>
  41. <Click>
  42. @Temp = ShowSearchBox("ProductSearch","INFOMATION");
  43. if(@Temp != StringEmpty())
  44. {
  45. txtProductNo2.CValue = @Temp;
  46. }
  47. </Click>
  48. </Events>
  49. </IKTextButton>
  50. <IKComboBox name="cbUnit1" />
  51. <IKComboBox name="cbUnit2" />
  52. <IKExtendGrid name="ikExtendGrid1" DataSource="Product" TableStyleIndex="0">
  53. <DataColumn Index="0" DataSource="Product.No_Product"/>
  54. <DataColumn Index="1" DataSource="Product.Name_Product"/>
  55. <DataColumn Index="2" DataSource="Product.InvoiceName_Product"/>
  56. <DataColumn Index="3" DataSource="Product.Unit_Product"/>
  57. <DataColumn Index="4" DataSource="Product.Cost_Product"/>
  58. <DataColumn Index="5" DataSource="Product.Price_Product"/>
  59. <DataColumn Index="6" DataSource="Product.StockQty_ProductStocks"/>
  60. <DataColumn Index="7" DataSource="Product.TotalCost"/>
  61. <Events>
  62. <ClickPreview>
  63. PrintReport(ikExtendGrid1.CurrentView);
  64. </ClickPreview>
  65. <ClickFilter>
  66. ;
  67. </ClickFilter>
  68. <ClickNOFilter>
  69. ;
  70. </ClickNOFilter>
  71. <ClickRefresh>
  72. Empty();
  73. @StartNo_Product =DBNull();
  74. @EndNo_Product =DBNull();
  75. @StartName_Product =DBNull();
  76. @EndName_Product =DBNull();
  77. @StartUnit_Product =DBNull();
  78. @EndUnit_Product =DBNull();
  79. if(!Equals(txtProductNo1.CValue,""))
  80. @StartNo_Product= txtProductNo1.CValue;
  81. if(!Equals(txtProductNo2.CValue,""))
  82. @EndNo_Product= txtProductNo2.CValue;
  83. if(!Equals(txtProductName1.CValue,""))
  84. @StartName_Product= txtProductName1.CValue;
  85. if(!Equals(txtProductName2.CValue,""))
  86. @EndName_Product= txtProductName2.CValue;
  87. if(!Equals(cbUnit1.Text,""))
  88. @StartUnit_Product= cbUnit1.Text;
  89. if(!Equals(cbUnit2.Text,""))
  90. @EndUnit_Product= cbUnit2.Text;
  91. Search("SearchCost",@StartNo_Product,@EndNo_Product,@StartName_Product,@EndName_Product,
  92. @StartUnit_Product,@EndUnit_Product);
  93. </ClickRefresh>
  94. </Events>
  95. </IKExtendGrid>
  96. <IKButton name="btnSearch">
  97. <Events>
  98. <Click>
  99. Empty();
  100. @StartNo_Product =DBNull();
  101. @EndNo_Product =DBNull();
  102. @StartName_Product =DBNull();
  103. @EndName_Product =DBNull();
  104. @StartUnit_Product =DBNull();
  105. @EndUnit_Product =DBNull();
  106. if(!Equals(txtProductNo1.CValue,""))
  107. @StartNo_Product= txtProductNo1.CValue;
  108. if(!Equals(txtProductNo2.CValue,""))
  109. @EndNo_Product= txtProductNo2.CValue;
  110. if(!Equals(txtProductName1.CValue,""))
  111. @StartName_Product= txtProductName1.CValue;
  112. if(!Equals(txtProductName2.CValue,""))
  113. @EndName_Product= txtProductName2.CValue;
  114. if(!Equals(cbUnit1.Text,""))
  115. @StartUnit_Product= cbUnit1.Text;
  116. if(!Equals(cbUnit2.Text,""))
  117. @EndUnit_Product= cbUnit2.Text;
  118. Search("SearchCost",@StartNo_Product,@EndNo_Product,@StartName_Product,@EndName_Product,
  119. @StartUnit_Product,@EndUnit_Product);
  120. </Click>
  121. </Events>
  122. </IKButton>
  123. <IKButton name="btnClear">
  124. <Events>
  125. <Click>
  126. Empty();
  127. </Click>
  128. </Events>
  129. </IKButton>
  130. </Controls>
  131. <ChildForms>
  132. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="SearchProductWithNo" MappingName="基本资料">
  133. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  134. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  135. </ChildForm>
  136. </ChildForms>
  137. </Client>
  138. <Server>
  139. <Tables>
  140. <Table name="Product" Type="Parent">
  141. <GetSchema CmdType="Text" CmdText="
  142. 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
  143. From Product
  144. Left Join
  145. (
  146. Select ID_Product,Sum(StockQty_ProductStocks) As StockQty_ProductStocks
  147. From ProductStocks
  148. Join Location On Location.ID_Location=ProductStocks.ID_Location
  149. Where Level_Location=1
  150. Group By ID_Product
  151. )a On a.ID_Product=Product.ID_Product
  152. "/>
  153. </Table>
  154. </Tables>
  155. <Search>
  156. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
  157. <Tables>
  158. <Table name="AllProduct" />
  159. </Tables>
  160. </SearchAllProduct>
  161. <SearchCost CmdType="Text" CmdText="
  162. Select No_Product,Name_Product,InvoiceName_Product,Unit_Product,Cost_Product,Price_Product,a.StockQty_ProductStocks,a.StockQty_ProductStocks*Cost_Product As TotalCost
  163. From Product
  164. Left Join
  165. (
  166. Select ID_Product,Sum(StockQty_ProductStocks) As StockQty_ProductStocks
  167. From ProductStocks
  168. Join Location On Location.ID_Location=ProductStocks.ID_Location
  169. Where Level_Location=1
  170. Group By ID_Product
  171. )a On a.ID_Product=Product.ID_Product
  172. WHERE No_Product BETWEEN ISNULL(@StartNo_Product,'') AND ISNULL(@EndNo_Product,(SELECT MAX(No_Product) FROM Product))
  173. AND Name_Product BETWEEN ISNULL(@StartName_Product,'') AND ISNULL(@EndName_Product,(Select MAX(Name_Product) FROM Product))
  174. AND Unit_Product BETWEEN ISNULL(@StartUnit_Product,'') AND ISNULL(@EndUnit_Product,(Select MAX(Unit_Product) FROM Product))
  175. ">
  176. <Params>
  177. <Param name="@StartNo_Product" type="Product.No_Product" Index="0" />
  178. <Param name="@EndNo_Product" type="Product.No_Product" Index="1" />
  179. <Param name="@StartName_Product" type="Product.Name_Product" Index="2" />
  180. <Param name="@EndName_Product" type="Product.Name_Product" Index="3" />
  181. <Param name="@StartUnit_Product" type="Product.Unit_Product" Index="4" />
  182. <Param name="@EndUnit_Product" type="Product.Unit_Product" Index="5" />
  183. </Params>
  184. <Tables>
  185. <Table name="Product"/>
  186. </Tables>
  187. </SearchCost>
  188. <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef From TypeDef Where Type_TypeDef=7 Order By Name_TypeDef ">
  189. <Tables>
  190. <Table name="Type"/>
  191. </Tables>
  192. </SearchType>
  193. </Search>
  194. </Server>
  195. <Lables>
  196. <Search>
  197. SuspendLayout();
  198. for(@i=0;@i&lt;RowCount("#Type");@i++)
  199. {
  200. SetPosition("#Type",@i);
  201. cbUnit1.Items.Add(#Type.Name_TypeDef);
  202. cbUnit2.Items.Add(#Type.Name_TypeDef);
  203. }
  204. ResumeLayout();
  205. </Search>
  206. </Lables>
  207. </Form>
  208. </Forms>