FrmSaleContract.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Forms>
  3. <Form Name="FrmSaleContract">
  4. <Client>
  5. <Events>
  6. <Load><![CDATA[
  7. @Title="销货合同";
  8. GetSchema();
  9. ChangeMode("Search");
  10. ]]></Load>
  11. <Closing>
  12. ;
  13. </Closing>
  14. <Closed>
  15. ;
  16. </Closed>
  17. </Events>
  18. <Mode>
  19. <Search>
  20. <Lable name="Search"/>
  21. </Search>
  22. <View>
  23. <Lable name="View" />
  24. </View>
  25. </Mode>
  26. <Controls>
  27. <IKTextButton name="tbCustomerNo" DataSource="SaleBill.No_Customer">
  28. <Events>
  29. <Click>
  30. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
  31. if( @temp == "" )
  32. return;
  33. tbCustomerNo.CValue = @temp;
  34. </Click>
  35. <TextBoxButtonTextChanged>
  36. tbCustomerNoEnd.CValue = tbCustomerNo.CValue;
  37. </TextBoxButtonTextChanged>
  38. </Events>
  39. </IKTextButton>
  40. <IKTextButton name="tbCustomerNoEnd" DataSource="SaleBill.No_Customer">
  41. <Events>
  42. <Click>
  43. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNoEnd.CValue);
  44. if( @temp == "" )
  45. return;
  46. tbCustomerNoEnd.CValue = @temp;
  47. </Click>
  48. </Events>
  49. </IKTextButton>
  50. <IKTextBox name="txtShortName" DataSource="SaleBill.ShortName_Customer">
  51. </IKTextBox>
  52. <IKTextBox name="txtShortNameEnd" DataSource="SaleBill.ShortName_Customer">
  53. </IKTextBox>
  54. <IKDateTimePicker name="dtStart" DataSource="SaleBill.StartTime"/>
  55. <IKDateTimePicker name="dtEnd" DataSource="SaleBill.EndTime"/>
  56. <IKDataGridEx name="dgSaleBillResult" DataSource="SaleBill" TableStyleIndex="0">
  57. <DataColumn Index="0" DataSource="SaleBill.No_SaleBill"/>
  58. <DataColumn Index="1" DataSource="SaleBill.Date_SaleBill"/>
  59. <DataColumn Index="2" DataSource="SaleBill.No_Customer1"/>
  60. <DataColumn Index="3" DataSource="SaleBill.ShortName_Customer"/>
  61. <DataColumn Index="4" DataSource="SaleBill.TransBack_SaleBill"/>
  62. <DataColumn Index="5" DataSource="SaleBill.TransBackDate_SaleBill"/>
  63. <DataColumn Index="6" DataSource="SaleBill.Assess_SaleBill"/>
  64. <DataColumn Index="7" DataSource="SaleBill.Status"/>
  65. <DataColumn Index="2" DataSource="SaleBill.No_Customer2"/>
  66. </IKDataGridEx>
  67. <IKButton name="btnSearch">
  68. <Events>
  69. <Click><![CDATA[
  70. if(ckDTStart.Checked)
  71. @StartTime = dtStart.CValue;
  72. else
  73. @StartTime = DBNull();
  74. if(ckDTEnd.Checked)
  75. @EndTime = dtEnd.CValue;
  76. else
  77. @EndTime = DBNull();
  78. if(!Search("SearchSaleBillList", tbCustomerNo.CValue, txtShortName.CValue, @StartTime, @EndTime,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),tbCustomerNoEnd.CValue, txtShortNameEnd.CValue))
  79. Empty("#SaleBill");
  80. else
  81. ChangeMode("View");
  82. ]]></Click>
  83. </Events>
  84. </IKButton>
  85. <IKButton name="btnOK">
  86. <Events>
  87. <Click>
  88. ShowPrintBox("ReportTitle",dgSaleBillResult.GetSelectedData(),"销售合同","对账单");
  89. </Click>
  90. </Events>
  91. </IKButton>
  92. <IKButton name="btnEmpty">
  93. <Events>
  94. <Click>
  95. ChangeMode("Search");
  96. </Click>
  97. </Events>
  98. </IKButton>
  99. <IKCheckBox name = "ckDTStart">
  100. <Events>
  101. <Click>
  102. if(ckDTStart.Checked)
  103. {
  104. dtStart.Enabled = true;
  105. }
  106. else
  107. {
  108. dtStart.Enabled = false;
  109. }
  110. </Click>
  111. </Events>
  112. </IKCheckBox>
  113. <IKCheckBox name = "ckDTEnd">
  114. <Events>
  115. <Click>
  116. if(ckDTEnd.Checked)
  117. {
  118. dtEnd.Enabled = true;
  119. }
  120. else
  121. {
  122. dtEnd.Enabled = false;
  123. }
  124. </Click>
  125. </Events>
  126. </IKCheckBox>
  127. </Controls>
  128. <ChildForms>
  129. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
  130. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  131. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  132. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  133. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  134. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
  135. </ChildForm>
  136. </ChildForms>
  137. </Client>
  138. <Server>
  139. <Tables>
  140. <Table name="SaleBill" Type="Parent">
  141. <GetSchema CmdType="Text" CmdText="
  142. declare @Status nvarchar(64)
  143. set @Status = '未审核'
  144. SELECT TOP 0 SaleBill.ID_SaleBill, SaleBill.No_SaleBill, SaleBill.Date_SaleBill, customer1.No_Customer As No_Customer1,
  145. customer1.ShortName_Customer, '否' as TransBack_SaleBill,
  146. SaleBill.TransBackDate_SaleBill,'是' as Assess_SaleBill,
  147. @Status as Status,Getdate() as StartTime, Getdate() as EndTime,customer2.No_Customer as No_Customer2
  148. FROM SaleBill, Customer as customer1
  149. LEFT JOIN Customer customer2 ON customer1.CustomerID_Customer=customer2.ID_Customer
  150. Where customer1.ID_Customer = SaleBill.ID_Customer
  151. "/>
  152. </Table>
  153. </Tables>
  154. <Search>
  155. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer FROM Customer ">
  156. <Tables>
  157. <Table name="AllCustomer" />
  158. </Tables>
  159. </SearchAllCustomer>
  160. <SearchSaleBillList CmdType="Text" CmdText=" declare @cmd nvarchar(4000)
  161. declare @string nvarchar(1000)
  162. set @cmd =
  163. N' SELECT SaleBill.ID_SaleBill,SaleBill.No_SaleBill, SaleBill.Date_SaleBill, customer1.No_Customer as No_Customer1,'
  164. +N' customer1.ShortName_Customer, case SaleBill.TransBack_SaleBill when 0 then '+nchar(39)+N'否'+nchar(39)+N' else '+nchar(39)+N'是'+nchar(39)+N' end as TransBack_SaleBill,'
  165. +N' SaleBill.TransBackDate_SaleBill,'
  166. +N' case SaleBill.Assess_SaleBill when 0 then '+nchar(39)+N'否'+nchar(39)+N' else '+nchar(39)+N'是'+nchar(39)+N' end as Assess_SaleBill, '
  167. +N' case isnull(DATALENGTH(ID_Assessor),0) when 0 then case Disable_SaleBill when 1 then '+nchar(39)+N'作废'+nchar(39)+N' else '+nchar(39)+N'未审核'+nchar(39)+N' end else '+nchar(39)+N'已审核'+nchar(39)+N' end as Status, '
  168. +N' customer2.No_Customer as No_Customer2'
  169. +N' FROM SaleBill,Customer as customer1 '
  170. +N' LEFT JOIN Customer customer2 ON customer1.CustomerID_Customer=customer2.ID_Customer'
  171. +N' Where customer1.ID_Customer = SaleBill.ID_Customer and SaleBill.Disable_SaleBill = 0 And 1=1'
  172. if(@StartTime is not null)
  173. begin
  174. set @cmd = @cmd + N' AND DATEDIFF(day,SaleBill.Date_SaleBill,'+nchar(39)+convert(nvarchar,@StartTime) +nchar(39)+N')&lt;= 0 '
  175. end
  176. if(@EndTime is not null)
  177. begin
  178. set @cmd = @cmd +N' AND DATEDIFF(day,SaleBill.Date_SaleBill,'+nchar(39)+convert(nvarchar,@EndTime) +nchar(39)+N')&gt;= 0 '
  179. end
  180. if(@No_Customer != '')
  181. begin
  182. set @cmd = @cmd+N' AND customer1.No_Customer &gt;= ' + nchar(39) +@No_Customer+nchar(39)
  183. end
  184. if (@ShortName_Customer != '')
  185. begin
  186. set @cmd = @cmd+N' AND customer1.ShortName_Customer &gt;= ' + nchar(39) +@ShortName_Customer+nchar(39)
  187. end
  188. if(@EndNo_Customer != '')
  189. begin
  190. set @cmd = @cmd+N' AND customer1.No_Customer &lt;= ' + nchar(39) +@EndNo_Customer+nchar(39)
  191. end
  192. if (@EndShortName_Customer != '')
  193. begin
  194. set @cmd = @cmd+N' AND customer1.ShortName_Customer &lt;= ' + nchar(39) +@EndShortName_Customer+nchar(39)
  195. end
  196. if(@Right is not null)
  197. begin
  198. set @cmd = @cmd +N' AND customer.ID_Creator= '+nchar(39)+Convert(nvarchar(64),@Right)+nchar(39)
  199. end
  200. set @cmd = @cmd +N' Order by SaleBill.No_SaleBill'
  201. EXECUTE sp_executesql @cmd
  202. Return
  203. ">
  204. <Params>
  205. <Param name="@No_Customer" type="SaleBill.No_Customer" Index="0"/>
  206. <Param name="@ShortName_Customer" type="SaleBill.ShortName_Customer" Index="1"/>
  207. <Param name="@StartTime" type="SaleBill.Date_SaleBill" Index="2"/>
  208. <Param name="@EndTime" type="SaleBill.Date_SaleBill" Index="3"/>
  209. <Param name="@Right" type="SaleBill.ID_Customer" Index="4" />
  210. <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5"/>
  211. <Param name="@EndShortName_Customer" type="SaleBill.ShortName_Customer" Index="6"/>
  212. </Params>
  213. <Tables>
  214. <Table name="SaleBill"/>
  215. </Tables>
  216. </SearchSaleBillList>
  217. </Search>
  218. </Server>
  219. <Lables>
  220. <Search>
  221. Empty();
  222. ckDTStart.Checked = false;
  223. ckDTEnd.Checked = false;
  224. tbCustomerNo.CValue = StringEmpty();
  225. txtShortName.CValue = StringEmpty();
  226. tbCustomerNoEnd.CValue = StringEmpty();
  227. txtShortNameEnd.CValue = StringEmpty();
  228. dtStart.CValue = DateTimeNow();
  229. dtEnd.CValue = DateTimeNow();
  230. dtStart.Enabled = false;
  231. dtEnd.Enabled = false;
  232. dgSaleBillResult.ReadOnly = true;
  233. dgSaleBillResult.AllowNew(false);
  234. </Search>
  235. <View>
  236. dgSaleBillResult.ReadOnly = false;
  237. dgSaleBillResult.AllowNew(false);
  238. dgSaleBillResult.AllowDelete(false);
  239. </View>
  240. </Lables>
  241. </Form>
  242. </Forms>