FrmSaleProductDiscountSearch.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmSaleProductDiscountSearch">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="销售产品折扣查询";
  9. GetSchema();
  10. ]]>
  11. </Load>
  12. </Events>
  13. <Mode>
  14. <Search>
  15. <Lable name="Search" />
  16. </Search>
  17. </Mode>
  18. <Controls>
  19. <IKTextButton name="tbCustomerNo1" DataSource="UI.StartNo_Customer">
  20. <Events>
  21. <Click>
  22. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue);
  23. if( @temp == "" )
  24. return;
  25. tbCustomerNo1.CValue = @temp;
  26. </Click>
  27. <TextBoxButtonTextChanged>
  28. tbCustomerNo2.CValue = tbCustomerNo1.CValue;
  29. </TextBoxButtonTextChanged>
  30. </Events>
  31. </IKTextButton>
  32. <IKTextButton name="tbCustomerNo2" DataSource="UI.EndNo_Customer">
  33. <Events>
  34. <Click>
  35. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue);
  36. if( @temp == "" )
  37. return;
  38. tbCustomerNo2.CValue = @temp;
  39. </Click>
  40. </Events>
  41. </IKTextButton>
  42. <IKTextBox name="txtCustomerName1" DataSource="UI.StartName_Customer"/>
  43. <IKTextBox name="txtCustomerName2" DataSource="UI.EndName_Customer"/>
  44. <IKDateTimePicker name="dtStart" DataSource="UI.StartDate"/>
  45. <IKDateTimePicker name="dtEnd" DataSource="UI.EndDate"/>
  46. <IKTextButton name="tbProductNo1" DataSource="UI.StartNo_Product">
  47. <Events>
  48. <Click>
  49. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProductNo1.CValue);
  50. if( @temp == "" )
  51. return;
  52. tbProductNo1.CValue = @temp;
  53. </Click>
  54. <TextBoxButtonTextChanged>
  55. tbProductNo2.CValue = tbProductNo1.CValue;
  56. </TextBoxButtonTextChanged>
  57. </Events>
  58. </IKTextButton>
  59. <IKTextButton name="tbProductNo2" DataSource="UI.EndNo_Product">
  60. <Events>
  61. <Click>
  62. @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProductNo2.CValue);
  63. if( @temp == "" )
  64. return;
  65. tbProductNo2.CValue = @temp;
  66. </Click>
  67. </Events>
  68. </IKTextButton>
  69. <IKTextBox name="txtProductName1" DataSource="UI.StartName_Product"/>
  70. <IKTextBox name="txtProductName2" DataSource="UI.EndName_Product"/>
  71. <IKTextBox name="txtDiscount" DataSource="UI.Discount"/>
  72. <IKExtendGrid name="dgProduct" DataSource="Total" TableStyleIndex="0">
  73. <DataColumn Index="0" DataSource="Total.No_Product"/>
  74. <DataColumn Index="1" DataSource="Total.Name_Product"/>
  75. <DataColumn Index="2" DataSource="Total.Quantity_SaleBillProduct"/>
  76. <DataColumn Index="3" DataSource="Total.UnitPrice_SaleBillProduct"/>
  77. <DataColumn Index="4" DataSource="Total.Discount_SaleBillProduct"/>
  78. <DataColumn Index="5" DataSource="Total.No_Customer"/>
  79. <DataColumn Index="6" DataSource="Total.Name_Customer"/>
  80. <DataColumn Index="7" DataSource="Total.LowDiscount_Customer"/>
  81. <DataColumn Index="8" DataSource="Total.No_SaleBill"/>
  82. <DataColumn Index="9" DataSource="Total.Date_SaleBill"/>
  83. <DataColumn Index="10" DataSource="Total.Name_Principal"/>
  84. <Events>
  85. <ClickPreview>
  86. PrintReport(dgProduct.CurrentView);
  87. </ClickPreview>
  88. <ClickRefresh>
  89. Empty();
  90. NewInstance();
  91. @StartCustomerNo =DBNull();
  92. @EndCustomerNo =DBNull();
  93. @StartCustomerName =DBNull();
  94. @EndCustomerName =DBNull();
  95. @StartProductNo =DBNull();
  96. @EndProductNo =DBNull();
  97. @StartProductName =DBNull();
  98. @EndProductName =DBNull();
  99. @StartDate =DBNull();
  100. @EndDate =DBNull();
  101. @Discount =DBNull();
  102. if(!Equals(tbCustomerNo1.CValue,""))
  103. @StartCustomerNo = tbCustomerNo1.CValue;
  104. if(!Equals(tbCustomerNo2.CValue,""))
  105. @EndCustomerNo = tbCustomerNo2.CValue;
  106. if(!Equals(txtCustomerName1.CValue,""))
  107. @StartCustomerName = txtCustomerName1.CValue;
  108. if(!Equals(txtCustomerName2.CValue,""))
  109. @EndCustomerName = txtCustomerName2.CValue;
  110. if(!Equals(tbProductNo1.CValue,""))
  111. @StartProductNo= tbProductNo1.CValue;
  112. if(!Equals(tbProductNo2.CValue,""))
  113. @EndProductNo= tbProductNo2.CValue;
  114. if(!Equals(txtProductName1.CValue,""))
  115. @StartProductName = txtProductName1.CValue;
  116. if(!Equals(txtProductName2.CValue,""))
  117. @EndProductName = txtProductName2.CValue;
  118. if(dtStart.Checked)
  119. @StartDate= dtStart.CValue;
  120. if(dtEnd.Checked)
  121. @EndDate= dtEnd.CValue;
  122. if(!Equals(txtDiscount.CValue,""))
  123. @Discount = txtDiscount.CValue;
  124. Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartCustomerName,@EndCustomerName,@StartProductNo,@EndProductNo,@StartProductName,@EndProductName,@StartDate,@EndDate,@Discount,GetFieldRight("销货单","特价单","查看"));
  125. if(Equals(@StartCustomerNo,DBNull()))
  126. @StartCustomerNo = "";
  127. if(Equals(@EndCustomerNo,DBNull()))
  128. @EndCustomerNo = "";
  129. if(Equals(@StartCustomerName,DBNull()))
  130. @StartCustomerName = "";
  131. if(Equals(@EndCustomerName,DBNull()))
  132. @EndCustomerName = "";
  133. if(Equals(@StartProductNo,DBNull()))
  134. @StartProductNo = "";
  135. if(Equals(@EndProductNo,DBNull()))
  136. @EndProductNo = "";
  137. if(Equals(@StartProductName,DBNull()))
  138. @StartProductName = "";
  139. if(Equals(@EndProductName,DBNull()))
  140. @EndProductName = "";
  141. if(Equals(@StartDate,DBNull()))
  142. @StartDate = "";
  143. if(Equals(@EndDate,DBNull()))
  144. @EndDate = "";
  145. if(Equals(@Discount,DBNull()))
  146. @Discount = "";
  147. #UI.StartNo_Customer = @StartCustomerNo;
  148. #UI.EndNo_Customer = @EndCustomerNo;
  149. #UI.StartName_Customer = @StartCustomerName;
  150. #UI.EndName_Customer = @EndCustomerName;
  151. #UI.StartNo_Product = @StartProductNo;
  152. #UI.EndNo_Product = @EndProductNo;
  153. #UI.StartName_Product = @StartProductName;
  154. #UI.EndName_Product =@EndProductName;
  155. #UI.StartDate = @StartDate;
  156. #UI.EndDate =@EndDate;
  157. #UI.Discount = @Discount;
  158. </ClickRefresh>
  159. <ClickFilter>
  160. ;
  161. </ClickFilter>
  162. <ClickNOFilter>
  163. ;
  164. </ClickNOFilter>
  165. </Events>
  166. </IKExtendGrid>
  167. <IKButton name="btnSearch">
  168. <Events>
  169. <Click>
  170. Empty();
  171. NewInstance();
  172. @StartCustomerNo =DBNull();
  173. @EndCustomerNo =DBNull();
  174. @StartCustomerName =DBNull();
  175. @EndCustomerName =DBNull();
  176. @StartProductNo =DBNull();
  177. @EndProductNo =DBNull();
  178. @StartProductName =DBNull();
  179. @EndProductName =DBNull();
  180. @StartDate =DBNull();
  181. @EndDate =DBNull();
  182. @Discount =DBNull();
  183. if(!Equals(tbCustomerNo1.CValue,""))
  184. @StartCustomerNo = tbCustomerNo1.CValue;
  185. if(!Equals(tbCustomerNo2.CValue,""))
  186. @EndCustomerNo = tbCustomerNo2.CValue;
  187. if(!Equals(txtCustomerName1.CValue,""))
  188. @StartCustomerName = txtCustomerName1.CValue;
  189. if(!Equals(txtCustomerName2.CValue,""))
  190. @EndCustomerName = txtCustomerName2.CValue;
  191. if(!Equals(tbProductNo1.CValue,""))
  192. @StartProductNo= tbProductNo1.CValue;
  193. if(!Equals(tbProductNo2.CValue,""))
  194. @EndProductNo= tbProductNo2.CValue;
  195. if(!Equals(txtProductName1.CValue,""))
  196. @StartProductName = txtProductName1.CValue;
  197. if(!Equals(txtProductName2.CValue,""))
  198. @EndProductName = txtProductName2.CValue;
  199. if(dtStart.Checked)
  200. @StartDate= dtStart.CValue;
  201. if(dtEnd.Checked)
  202. @EndDate= dtEnd.CValue;
  203. if(!Equals(txtDiscount.CValue,""))
  204. @Discount = txtDiscount.CValue;
  205. Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartCustomerName,@EndCustomerName,@StartProductNo,@EndProductNo,@StartProductName,@EndProductName,@StartDate,@EndDate,@Discount,GetFieldRight("销货单","特价单","查看"));
  206. if(Equals(@StartCustomerNo,DBNull()))
  207. @StartCustomerNo = "";
  208. if(Equals(@EndCustomerNo,DBNull()))
  209. @EndCustomerNo = "";
  210. if(Equals(@StartCustomerName,DBNull()))
  211. @StartCustomerName = "";
  212. if(Equals(@EndCustomerName,DBNull()))
  213. @EndCustomerName = "";
  214. if(Equals(@StartProductNo,DBNull()))
  215. @StartProductNo = "";
  216. if(Equals(@EndProductNo,DBNull()))
  217. @EndProductNo = "";
  218. if(Equals(@StartProductName,DBNull()))
  219. @StartProductName = "";
  220. if(Equals(@EndProductName,DBNull()))
  221. @EndProductName = "";
  222. if(Equals(@StartDate,DBNull()))
  223. @StartDate = "";
  224. if(Equals(@EndDate,DBNull()))
  225. @EndDate = "";
  226. if(Equals(@Discount,DBNull()))
  227. @Discount = "";
  228. #UI.StartNo_Customer = @StartCustomerNo;
  229. #UI.EndNo_Customer = @EndCustomerNo;
  230. #UI.StartName_Customer = @StartCustomerName;
  231. #UI.EndName_Customer = @EndCustomerName;
  232. #UI.StartNo_Product = @StartProductNo;
  233. #UI.EndNo_Product = @EndProductNo;
  234. #UI.StartName_Product = @StartProductName;
  235. #UI.EndName_Product =@EndProductName;
  236. #UI.StartDate = @StartDate;
  237. #UI.EndDate =@EndDate;
  238. #UI.Discount = @Discount;
  239. </Click>
  240. </Events>
  241. </IKButton>
  242. <IKButton name="btnEmpty">
  243. <Events>
  244. <Click>
  245. ChangeMode("Search");
  246. </Click>
  247. </Events>
  248. </IKButton>
  249. </Controls>
  250. <ChildForms>
  251. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
  252. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  253. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  254. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  255. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  256. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
  257. </ChildForm>
  258. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
  259. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  260. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  261. </ChildForm>
  262. </ChildForms>
  263. </Client>
  264. <Server>
  265. <Tables>
  266. <Table name="UI" Type="Parent">
  267. <GetSchema CmdType="Text" CmdText=" Select Convert(Nvarchar(64),'') as StartNo_Customer,Convert(Nvarchar(64),'') as EndNo_Customer,
  268. Convert(Nvarchar(64),'') as StartName_Customer,Convert(Nvarchar(64),'') as EndName_Customer,
  269. Convert(Nvarchar(64),'') as StartNo_Product,Convert(Nvarchar(64),'') as EndNo_Product,
  270. Convert(Nvarchar(64),'') as StartName_Product,Convert(Nvarchar(64),'') as EndName_Product,
  271. Convert(DateTime,0) as StartDate,Convert(DateTime,0) as EndDate,
  272. Convert(Nvarchar(64),'') as Discount"/>
  273. </Table>
  274. <Table name="Total" Type="Child">
  275. <GetSchema CmdType="Text" CmdText=" Select Top 0 No_Product,Name_Product,Quantity_SaleBillProduct,UnitPrice_SaleBillProduct,Discount_SaleBillProduct,
  276. No_Customer,Name_Customer,LowDiscount_Customer,No_SaleBill,Date_SaleBill,Name_Employee AS Name_Principal
  277. From SaleBill
  278. Left Join SaleBillProduct On SaleBill.ID_SaleBill = SaleBillProduct.ID_SaleBill
  279. Left Join Employee On Employee.ID_Employee = SaleBill.ID_Principal
  280. Left Join Product On Product.ID_Product = SaleBillProduct.ID_Product
  281. Left Join Customer On Customer.ID_Customer = SaleBill.ID_Customer
  282. "/>
  283. </Table>
  284. </Tables>
  285. <Search>
  286. <SearchReceivales CmdType="Text" CmdText="Select No_Product,Name_Product,Quantity_SaleBillProduct,UnitPrice_SaleBillProduct,Discount_SaleBillProduct,
  287. No_Customer,Name_Customer,LowDiscount_Customer,No_SaleBill,Date_SaleBill,Name_Employee AS Name_Principal
  288. From SaleBill
  289. Left Join SaleBillProduct On SaleBill.ID_SaleBill = SaleBillProduct.ID_SaleBill
  290. Left Join Employee On Employee.ID_Employee = SaleBill.ID_Principal
  291. Left Join Product On Product.ID_Product = SaleBillProduct.ID_Product
  292. Left Join Customer On Customer.ID_Customer = SaleBill.ID_Customer
  293. Where SaleBill.ID_Assessor Is Not Null
  294. And No_Customer Between IsNull(@StartCustomerNo,Customer.No_Customer) AND ISNULL(@EndCustomerNo,Customer.No_Customer)
  295. And Name_Customer Between IsNull(@StartCustomerName,Customer.Name_Customer) And IsNull(@EndCustomerName,Customer.Name_Customer)
  296. And No_Product Between IsNull(@StartProductNo,Product.No_Product) And IsNull(@EndProductNo,Product.No_Product)
  297. And Name_Product Between IsNull(@StartProductName,Product.Name_Product) And IsNull(@EndProductName,Product.Name_Product)
  298. AND Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_SaleBill)
  299. And Discount_SaleBillProduct &lt; IsNull(@Discount,101)
  300. and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End ">
  301. <Params>
  302. <Param name="@StartCustomerNo" type="Customer.No_Customer" Index="0" />
  303. <Param name="@EndCustomerNo" type="Customer.No_Customer" Index="1" />
  304. <Param name="@StartCustomerName" type="Customer.Name_Customer" Index="2" />
  305. <Param name="@EndCustomerName" type="Customer.Name_Customer" Index="3" />
  306. <Param name="@StartProductNo" type="Product.No_Product" Index="4" />
  307. <Param name="@EndProductNo" type="Product.No_Product" Index="5" />
  308. <Param name="@StartProductName" type="Product.Name_Product" Index="6" />
  309. <Param name="@EndProductName" type="Product.Name_Product" Index="7" />
  310. <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="8" />
  311. <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="9" />
  312. <Param name="@Discount" type="SaleBill.No_SaleBill" Index="10" />
  313. <Param name="@Special" type="SaleBill.Special_SaleBill" Index="11" />
  314. </Params>
  315. <Tables>
  316. <Table name="Total" />
  317. </Tables>
  318. </SearchReceivales>
  319. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer FROM Customer ">
  320. <Tables>
  321. <Table name="AllCustomer" />
  322. </Tables>
  323. </SearchAllCustomer>
  324. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
  325. <Tables>
  326. <Table name="AllProduct" />
  327. </Tables>
  328. </SearchAllProduct>
  329. </Search>
  330. </Server>
  331. <Lables>
  332. <Search>
  333. Empty();
  334. tbCustomerNo1.CValue = "";
  335. tbCustomerNo2.CValue = "";
  336. txtCustomerName1.CValue = "";
  337. txtCustomerName2.CValue = "";
  338. tbProductNo1.CValue = "";
  339. tbProductNo2.CValue = "";
  340. txtProductName1.CValue = "";
  341. txtProductName2.CValue = "";
  342. dtStart.CValue = GetCurrentTime();
  343. dtEnd.CValue = GetCurrentTime();
  344. dtStart.Checked = false;
  345. dtEnd.Checked = false;
  346. txtDiscount.CValue = "";
  347. </Search>
  348. </Lables>
  349. </Form>
  350. </Forms>