FrmPrePay.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Forms>
  3. <Form Name="FrmPrePay">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="预付帐款";
  9. GetSchema();
  10. Search("SearchSystemSetting");
  11. @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
  12. ChangeMode("Search");
  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. <New>
  27. <Lable name="New" />
  28. </New>
  29. <View>
  30. <Lable name="View" />
  31. </View>
  32. <Modify>
  33. <Lable name="Modify" />
  34. </Modify>
  35. </Mode>
  36. <Controls>
  37. <IKTextButton name="tbNo" DataSource="PrePay.No_PrePay">
  38. <Events>
  39. <Enter>
  40. if(tbNo.ReadOnly == false)
  41. {
  42. if(tbNo.CValue != StringEmpty())
  43. {
  44. UpdateForm(false, "");
  45. if(Search("SearchPrePayWithNo", tbNo.CValue))
  46. {
  47. ChangeMode("View");
  48. }
  49. else
  50. {
  51. MessageBox("该预付帐款不存在!",@Title);
  52. }
  53. }
  54. else
  55. {
  56. MessageBox("请输入付款编号!", @Title);
  57. }
  58. }
  59. </Enter>
  60. <Click>
  61. ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
  62. </Click>
  63. </Events>
  64. </IKTextButton>
  65. <IKDataTimePicker name="dtDate" DataSource="PrePay.Date_PrePay" />
  66. <IKTextBox name="txtMaker" DataSource="PrePay.Creator" />
  67. <IKTextButton name="tbSupplierNo" DataSource="PrePay.No_Supplier" >
  68. <Events>
  69. <Enter>
  70. UpdateForm(false,"");
  71. if(tbSupplierNo.CValue!=StringEmpty())
  72. {
  73. if(!Search("SearchSupplier",tbSupplierNo.CValue))
  74. {
  75. MessageBox("该供应商不存在!",@Title);
  76. @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
  77. if(@temp != "")
  78. {
  79. tbSupplierNo.CValue = @temp;
  80. ActiveControlEvent("tbSupplierNo", "Enter");
  81. }
  82. }
  83. else
  84. {
  85. if(!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
  86. {
  87. MessageBox("该供应商已停用!",@Title);
  88. }
  89. #PrePay.ID_Supplier=#Supplier.ID_Supplier;
  90. #PrePay.ShortName_Supplier=#Supplier.ShortName_Supplier;
  91. #PrePay.Balance_PrePay=#Supplier.PreGetBalance_Supplier;
  92. }
  93. }
  94. else
  95. {
  96. MessageBox("请输入供应商编号!",@Title);
  97. #PrePay.ID_Supplier=GuidEmpty();
  98. #PrePay.ShortName_Supplier="";
  99. #PrePay.Balance_PrePay=0;
  100. tbSupplierNo.Focus();
  101. }
  102. UpdateForm(true,"");
  103. </Enter>
  104. <Click>
  105. if (tbSupplierNo.ReadOnly == false)
  106. {
  107. @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
  108. if(@temp == "")
  109. {
  110. return;
  111. }
  112. else
  113. {
  114. tbSupplierNo.CValue = @temp;
  115. ActiveControlEvent("tbSupplierNo", "Enter");
  116. }
  117. }
  118. </Click>
  119. </Events>
  120. </IKTextButton>
  121. <IKTextBox name="txtSupplierName" DataSource="PrePay.ShortName_Supplier"/>
  122. <IKComboBoxEx name="cbGetCurrency" DisplaySource="PrePay.PayCurrency_PrePay"/>
  123. <IKComboBoxEx name="cbBillCurrency" DisplaySource="PrePay.Currency_PrePay"/>
  124. <IKNumericTextBox name="txtRate" DataSource="PrePay.Rate_PrePay"/>
  125. <IKComboBoxEx name="cbPayType" DisplaySource="PrePay.Method_PrePay" DataSource="Method" DisplayMember="Name_TypeDef">
  126. <Events>
  127. <Reload>
  128. UpdateForm(false, "cbPayType");
  129. Search("SearchMethod");
  130. UpdateForm(true, "cbPayType");
  131. </Reload>
  132. </Events>
  133. </IKComboBoxEx>
  134. <IKNumericTextBox name="ntbMoney" DataSource="PrePay.Amount_PrePay"/>
  135. <IKTextBox name="txtVoucherDate" DataSource="PrePay.VoucherDate_PrePay" />
  136. <IKTextBox name="txtVoucherNo" DataSource="PrePay.VoucherNo_PrePay"/>
  137. <IKTextBox name="txtComment" DataSource="PrePay.Comment_PrePay"/>
  138. <IKComboBoxEx name="cbTransactor" ValueSource="PrePay.ID_Payer" DisplaySource="PrePay.Name_Employee" NoSource="PrePay.No_Payer" DataSource="Employee" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
  139. <Events>
  140. <Reload>
  141. UpdateForm(false, "cbTransactor");
  142. Search("SearchPayer");
  143. UpdateForm(true, "cbTransactor");
  144. </Reload>
  145. </Events>
  146. </IKComboBoxEx>
  147. <IKNumericTextBox name="ntbBalance" DataSource="PrePay.Balance_PrePay"/>
  148. <IKTextBox name="txtAssessor" DataSource="PrePay.Assessor" />
  149. <IKDateTimeText name="dtAssessDate" DataSource="PrePay.AssessDate_PrePay" />
  150. <IKTextBox name="txtLastModUser" DataSource="PrePay.LastModUser"/>
  151. <IKDateTimeText name="dtLastModDate" DataSource="PrePay.LastModDate_PrePay"/>
  152. <IKFormToolBar name="toolBar">
  153. <Events>
  154. <ClickFirst>
  155. if(Search("SearchPrePayFirst"))
  156. {
  157. ChangeMode("View");
  158. }
  159. </ClickFirst>
  160. <ClickPrev>
  161. if(Search("SearchPrePayPrevious", tbNo.CValue))
  162. {
  163. ChangeMode("View");
  164. }
  165. </ClickPrev>
  166. <ClickNext>
  167. if(Search("SearchPrePayNext",tbNo.CValue))
  168. {
  169. ChangeMode("View");
  170. }
  171. </ClickNext>
  172. <ClickLast>
  173. if(Search("SearchPrePayLast"))
  174. {
  175. ChangeMode("View");
  176. }
  177. </ClickLast>
  178. <ClickNew>
  179. <![CDATA[
  180. @NextNo = GetNextAutoNumber(true);
  181. if (!Equals(@NextNo, ""))
  182. {
  183. ChangeMode("New");
  184. #PrePay.No_PrePay= @NextNo;
  185. UpdateForm(true, "tbNo");
  186. }
  187. ]]>
  188. </ClickNew>
  189. <ClickEmpty>
  190. ChangeMode("Search");
  191. </ClickEmpty>
  192. <ClickSubmit>
  193. <Lable name="SubmitButtonClick" />
  194. </ClickSubmit>
  195. <ClickModify>
  196. ChangeMode("Modify");
  197. </ClickModify>
  198. <ClickDelete>
  199. Delete(); ChangeMode("Search");
  200. </ClickDelete>
  201. <ClickPrint>
  202. PrintReport();
  203. </ClickPrint>
  204. <ClickAudit>
  205. BeginAudit();
  206. #PrePay.ID_Assessor=GetLoginUserID();
  207. #PrePay.Assessor=GetCurrentUser();
  208. #PrePay.AssessDate_PrePay=DateTimeNow();
  209. Audit();
  210. ChangeMode("View");
  211. EndAudit();
  212. </ClickAudit>
  213. <ClickUnAudit>
  214. BeginUnAudit();
  215. #PrePay.ID_Assessor=DBNull();
  216. #PrePay.Assessor=DBNull();
  217. #PrePay.AssessDate_PrePay=DataTimeNow();
  218. UnAudit();
  219. ChangeMode("View");
  220. EndUnAudit();
  221. </ClickUnAudit>
  222. <ClickImport>
  223. ;
  224. </ClickImport>
  225. <ClickExport>
  226. ;
  227. </ClickExport>
  228. <ClickClose>
  229. ;
  230. </ClickClose>
  231. <ClickExpand>
  232. ;
  233. </ClickExpand>
  234. </Events>
  235. </IKFormToolBar>
  236. </Controls>
  237. <LockInfomation LockID="ID_PrePay" LockNO="No_PrePay" LockSearchFunction="SearchPrePayWithNo" LockAudit="ID_Assessor"/>
  238. <LogInfomation LogNO="#PrePay.No_PrePay" RecordFormField="付款方式:#PrePay.Method_PrePay,供应商编号:#PrePay.No_Supplier,付款金额:#PrePay.Amount_PrePay" RecordDataGridField=""/>
  239. <ChildForms>
  240. <ChildForm name="BillSearch" DataSource="PrePay" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPrePayWithNo">
  241. <DataColumn Index="0" MappingName="#PrePay.No_PrePay" HeaderText="预付帐款号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  242. <DataColumn Index="1" MappingName="#PrePay.CreateDate_PrePay" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  243. <DataColumn Index="2" MappingName="#PrePay.ShortName_Supplier" HeaderText="供应商简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  244. </ChildForm>
  245. <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
  246. <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  247. <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  248. </ChildForm>
  249. </ChildForms>
  250. </Client>
  251. <Server>
  252. <Tables>
  253. <Table name="PrePay" Type="Parent">
  254. <GetSchema CmdType="Text" CmdText="
  255. SELECT TOP 0 PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer,Name_Employee
  256. FROM PrePay
  257. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  258. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  259. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  260. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  261. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  262. ">
  263. </GetSchema>
  264. <New CmdType="Text" CmdText="
  265. INSERT INTO PrePay(ID_PrePay,No_PrePay,Date_PrePay,ID_Supplier,PayCurrency_PrePay,Currency_PrePay,Rate_PrePay,Method_PrePay,Amount_PrePay,VoucherNo_PrePay,VoucherDate_PrePay,ID_Payer,Balance_PrePay,
  266. ID_Creator,CreateDate_PrePay,LastModUser_PrePay,LastModDate_PrePay,ID_Assessor,AssessDate_PrePay,Comment_PrePay) VALUES(@ID_PrePay,@No_PrePay,@Date_PrePay,@ID_Supplier,@PayCurrency_PrePay,@Currency_PrePay,@Rate_PrePay,@Method_PrePay,@Amount_PrePay,@VoucherNo_PrePay,@VoucherDate_PrePay,@ID_Payer,@Balance_PrePay,
  267. @ID_Creator,@CreateDate_PrePay,@LastModUser_PrePay,@LastModDate_PrePay,@ID_Assessor,@AssessDate_PrePay,@Comment_PrePay)
  268. ">
  269. <Params>
  270. <Param name="@ID_PrePay" type="PrePay.ID_PrePay" sourceColumn="ID_PrePay" />
  271. <Param name="@No_PrePay" type="PrePay.No_PrePay" sourceColumn="No_PrePay" />
  272. <Param name="@Date_PrePay" type="PrePay.Date_PrePay" sourceColumn="Date_PrePay" />
  273. <Param name="@ID_Supplier" type="PrePay.ID_Supplier" sourceColumn="ID_Supplier" />
  274. <Param name="@PayCurrency_PrePay" type="PrePay.PayCurrency_PrePay" sourceColumn="PayCurrency_PrePay" />
  275. <Param name="@Currency_PrePay" type="PrePay.Currency_PrePay" sourceColumn="Currency_PrePay" />
  276. <Param name="@Rate_PrePay" type="PrePay.Rate_PrePay" sourceColumn="Rate_PrePay" />
  277. <Param name="@Method_PrePay" type="PrePay.Method_PrePay" sourceColumn="Method_PrePay" />
  278. <Param name="@Amount_PrePay" type="PrePay.Amount_PrePay" sourceColumn="Amount_PrePay" />
  279. <Param name="@VoucherNo_PrePay" type="PrePay.VoucherNo_PrePay" sourceColumn="VoucherNo_PrePay" />
  280. <Param name="@VoucherDate_PrePay" type="PrePay.VoucherDate_PrePay" sourceColumn="VoucherDate_PrePay" />
  281. <Param name="@ID_Payer" type="PrePay.ID_Payer" sourceColumn="ID_Payer" />
  282. <Param name="@Balance_PrePay" type="PrePay.Balance_PrePay" sourceColumn="Balance_PrePay" />
  283. <Param name="@ID_Creator" type="PrePay.ID_Creator" sourceColumn="ID_Creator" />
  284. <Param name="@CreateDate_PrePay" type="PrePay.CreateDate_PrePay" sourceColumn="CreateDate_PrePay" />
  285. <Param name="@LastModUser_PrePay" type="PrePay.LastModUser_PrePay" sourceColumn="LastModUser_PrePay" />
  286. <Param name="@LastModDate_PrePay" type="PrePay.LastModDate_PrePay" sourceColumn="LastModDate_PrePay" />
  287. <Param name="@ID_Assessor" type="PrePay.ID_Assessor" sourceColumn="ID_Assessor" />
  288. <Param name="@AssessDate_PrePay" type="PrePay.AssessDate_PrePay" sourceColumn="AssessDate_PrePay" />
  289. <Param name="@Comment_PrePay" type="PrePay.Comment_PrePay" sourceColumn="Comment_PrePay" />
  290. </Params>
  291. </New>
  292. <Update CmdType="Text" CmdText="
  293. UPDATE PrePay
  294. SET No_PrePay=@No_PrePay,Date_PrePay=@Date_PrePay,ID_Supplier=@ID_Supplier,
  295. PayCurrency_PrePay=@PayCurrency_PrePay,Currency_PrePay=@Currency_PrePay,Rate_PrePay=@Rate_PrePay,
  296. Method_PrePay=@Method_PrePay,Amount_PrePay=@Amount_PrePay,VoucherNo_PrePay=@VoucherNo_PrePay,
  297. VoucherDate_PrePay=@VoucherDate_PrePay,ID_Payer=@ID_Payer,Balance_PrePay=@Balance_PrePay,
  298. ID_Creator=@ID_Creator,CreateDate_PrePay=@CreateDate_PrePay,LastModUser_PrePay=@LastModUser_PrePay,
  299. LastModDate_PrePay=@LastModDate_PrePay,ID_Assessor=@ID_Assessor,AssessDate_PrePay=@AssessDate_PrePay,Comment_PrePay=@Comment_PrePay
  300. WHERE ID_PrePay=@ID_PrePay
  301. ">
  302. <Params>
  303. <Param name="@ID_PrePay" type="PrePay.ID_PrePay" sourceColumn="ID_PrePay" />
  304. <Param name="@No_PrePay" type="PrePay.No_PrePay" sourceColumn="No_PrePay" />
  305. <Param name="@Date_PrePay" type="PrePay.Date_PrePay" sourceColumn="Date_PrePay" />
  306. <Param name="@ID_Supplier" type="PrePay.ID_Supplier" sourceColumn="ID_Supplier" />
  307. <Param name="@PayCurrency_PrePay" type="PrePay.PayCurrency_PrePay" sourceColumn="PayCurrency_PrePay" />
  308. <Param name="@Currency_PrePay" type="PrePay.Currency_PrePay" sourceColumn="Currency_PrePay" />
  309. <Param name="@Rate_PrePay" type="PrePay.Rate_PrePay" sourceColumn="Rate_PrePay" />
  310. <Param name="@Method_PrePay" type="PrePay.Method_PrePay" sourceColumn="Method_PrePay" />
  311. <Param name="@Amount_PrePay" type="PrePay.Amount_PrePay" sourceColumn="Amount_PrePay" />
  312. <Param name="@VoucherNo_PrePay" type="PrePay.VoucherNo_PrePay" sourceColumn="VoucherNo_PrePay" />
  313. <Param name="@VoucherDate_PrePay" type="PrePay.VoucherDate_PrePay" sourceColumn="VoucherDate_PrePay" />
  314. <Param name="@ID_Payer" type="PrePay.ID_Payer" sourceColumn="ID_Payer" />
  315. <Param name="@Balance_PrePay" type="PrePay.Balance_PrePay" sourceColumn="Balance_PrePay" />
  316. <Param name="@ID_Creator" type="PrePay.ID_Creator" sourceColumn="ID_Creator" />
  317. <Param name="@CreateDate_PrePay" type="PrePay.CreateDate_PrePay" sourceColumn="CreateDate_PrePay" />
  318. <Param name="@LastModUser_PrePay" type="PrePay.LastModUser_PrePay" sourceColumn="LastModUser_PrePay" />
  319. <Param name="@LastModDate_PrePay" type="PrePay.LastModDate_PrePay" sourceColumn="LastModDate_PrePay" />
  320. <Param name="@ID_Assessor" type="PrePay.ID_Assessor" sourceColumn="ID_Assessor" />
  321. <Param name="@AssessDate_PrePay" type="PrePay.AssessDate_PrePay" sourceColumn="AssessDate_PrePay" />
  322. <Param name="@Comment_PrePay" type="PrePay.Comment_PrePay" sourceColumn="Comment_PrePay" />
  323. </Params>
  324. </Update>
  325. <Delete CmdType="Text" CmdText="
  326. DELETE FROM PrePay WHERE ID_PrePay=@ID_PrePay
  327. ">
  328. <Params>
  329. <Param name="@ID_PrePay" type="PrePay.ID_PrePay" sourceColumn="ID_PrePay" />
  330. </Params>
  331. </Delete>
  332. <Audit CmdType="Text" CmdText="
  333. IF(@ID_Assessor IS NOT NULL)
  334. UPDATE Supplier SET PreGetBalance_Supplier=PreGetBalance_Supplier+@Amount_PrePay WHERE ID_Supplier=@ID_Supplier
  335. ELSE
  336. BEGIN
  337. IF((SELECT PreGetBalance_Supplier FROM Supplier WHERE ID_Supplier=@ID_Supplier) &lt; @Amount_PrePay)
  338. BEGIN
  339. RAISERROR('已有部分帐款用于冲帐,取消审核失败!',16,1)
  340. RETURN
  341. END
  342. UPDATE Supplier SET PreGetBalance_Supplier=PreGetBalance_Supplier-@Amount_PrePay WHERE ID_Supplier=@ID_Supplier
  343. END
  344. UPDATE PrePay SET ID_Assessor=@ID_Assessor,AssessDate_PrePay=@AssessDate_PrePay WHERE ID_PrePay=@ID_PrePay
  345. ">
  346. <Params>
  347. <Param name="@ID_PrePay" type="PrePay.ID_PrePay" sourceColumn="ID_PrePay"/>
  348. <Param name="@ID_Supplier" type="PrePay.ID_Supplier" sourceColumn="ID_Supplier"/>
  349. <Param name="@Amount_PrePay" type="PrePay.Amount_PrePay" sourceColumn="Amount_PrePay"/>
  350. <Param name="@ID_Assessor" type="PrePay.ID_Assessor" sourceColumn="ID_Assessor"/>
  351. <Param name="@AssessDate_PrePay" type="PrePay.AssessDate_PrePay" sourceColumn="AssessDate_PrePay"/>
  352. </Params>
  353. </Audit>
  354. </Table>
  355. </Tables>
  356. <Search>
  357. <SearchAllBill CmdType="Text" CmdText=" SELECT PrePay.*,ShortName_Supplier FROM PrePay LEFT JOIN Supplier ON Supplier.ID_Supplier=PrePay.ID_Supplier">
  358. <Tables>
  359. <Table name="AllBill" />
  360. </Tables>
  361. </SearchAllBill>
  362. <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  363. <Tables>
  364. <Table name="AllSupplier" />
  365. </Tables>
  366. </SearchAllSupplier>
  367. <SearchSupplier CmdType="Text" CmdText="
  368. SELECT ID_Supplier,ShortName_Supplier,PreGetBalance_Supplier,SuspendDate_Supplier
  369. From Supplier
  370. WHERE No_Supplier=@No_Supplier
  371. ">
  372. <Params>
  373. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
  374. </Params>
  375. <Tables>
  376. <Table name="Supplier"/>
  377. </Tables>
  378. </SearchSupplier>
  379. <SearchPayer CmdType="Text" CmdText="
  380. SELECT Name_Employee,ID_Employee, No_Employee From Employee ORDER BY No_Employee
  381. ">
  382. <Tables>
  383. <Table name="Employee"/>
  384. </Tables>
  385. </SearchPayer>
  386. <SearchMethod CmdType="Text" CmdText="
  387. SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef=23
  388. ">
  389. <Tables>
  390. <Table name="Method"/>
  391. </Tables>
  392. </SearchMethod>
  393. <SearchPrePayWithNo CmdType="Text" CmdText="
  394. SELECT PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer,Name_Employee
  395. FROM PrePay
  396. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  397. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  398. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  399. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  400. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  401. WHERE No_PrePay=@No_PrePay
  402. ">
  403. <Params>
  404. <Param name="@No_PrePay" type="PrePay.No_PrePay" Index="0" />
  405. </Params>
  406. <Tables>
  407. <Table name="PrePay"/>
  408. </Tables>
  409. </SearchPrePayWithNo>
  410. <SearchPrePayFirst CmdType="Text" CmdText="
  411. SELECT TOP 1 PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer,Name_Employee
  412. FROM PrePay
  413. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  414. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  415. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  416. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  417. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  418. ORDER BY No_PrePay
  419. ">
  420. <Tables>
  421. <Table name="PrePay"/>
  422. </Tables>
  423. </SearchPrePayFirst>
  424. <SearchPrePayLast CmdType="Text" CmdText="
  425. SELECT TOP 1 PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer, Employee.Name_Employee
  426. FROM PrePay
  427. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  428. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  429. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  430. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  431. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  432. ORDER BY No_PrePay DESC
  433. ">
  434. <Tables>
  435. <Table name="PrePay"/>
  436. </Tables>
  437. </SearchPrePayLast>
  438. <SearchPrePayPrevious CmdType="Text" CmdText="
  439. SELECT TOP 1 PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer, Employee.Name_Employee
  440. FROM PrePay
  441. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  442. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  443. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  444. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  445. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  446. WHERE No_PrePay &lt; @No_PrePay
  447. ORDER BY No_PrePay DESC
  448. ">
  449. <Params>
  450. <Param name="@No_PrePay" type="PrePay.No_PrePay" Index="0" />
  451. </Params>
  452. <Tables>
  453. <Table name="PrePay"/>
  454. </Tables>
  455. </SearchPrePayPrevious>
  456. <SearchPrePayNext CmdType="Text" CmdText="
  457. SELECT TOP 1 PrePay.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,Employee.No_Employee As No_Payer, Employee.Name_Employee
  458. FROM PrePay
  459. LEFT JOIN AppUser a ON PrePay.ID_Creator=a.ID_User
  460. LEFT JOIN AppUser b ON PrePay.ID_Assessor=b.ID_User
  461. LEFT JOIN AppUser c ON PrePay.LastModUser_PrePay=c.ID_User
  462. Left JOIN Supplier On Supplier.ID_Supplier=PrePay.ID_Supplier
  463. LEFT JOIN Employee ON Employee.ID_Employee=PrePay.ID_Payer
  464. WHERE No_PrePay &gt; @No_PrePay
  465. ORDER BY No_PrePay
  466. ">
  467. <Params>
  468. <Param name="@No_PrePay" type="PrePay.No_PrePay" Index="0" />
  469. </Params>
  470. <Tables>
  471. <Table name="PrePay"/>
  472. </Tables>
  473. </SearchPrePayNext>
  474. <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
  475. <Tables>
  476. <Table name="SystemSetting"/>
  477. </Tables>
  478. </SearchSystemSetting>
  479. </Search>
  480. </Server>
  481. <Lables>
  482. <Search>
  483. Empty();
  484. NewInstance();
  485. tbNo.ReadOnly=false;
  486. dtDate.Enabled=false;
  487. tbSupplierNo.ReadOnly=true;
  488. txtVoucherDate.Enabled=false;
  489. txtVoucherNo.ReadOnly=true;
  490. cbTransactor.Enabled=false;
  491. ntbMoney.ReadOnly=true;
  492. txtComment.ReadOnly=true;
  493. cbPayType.Enabled=false;
  494. #PrePay.Creator=DBNull();
  495. #PrePay.ID_Creator=DBNull();
  496. #PrePay.Assessor=DBNull();
  497. #PrePay.ID_Assessor=DBNull();
  498. #PrePay.AssessDate_PrePay=DBNull();
  499. #PrePay.LastModUser_PrePay=DBNull();
  500. #PrePay.LastModUser=DBNull();
  501. #PrePay.LastModDate_PrePay=DBNull();
  502. toolBar.EnableSubmit=false;
  503. toolBar.EnableModify=false;
  504. toolBar.EnableDelete=false;
  505. toolBar.EnableAudit=false;
  506. toolBar.EnableUnAudit=false;
  507. toolBar.EnableNew=GetRight(@Title,"新增");
  508. toolBar.EnablePrint=false;
  509. UpdateForm(true,"");
  510. tbNo.Focus();
  511. @Status=0;
  512. </Search>
  513. <New>
  514. Empty();
  515. NewInstance();
  516. tbNo.ReadOnly=true;
  517. dtDate.Enabled=true;
  518. tbSupplierNo.ReadOnly=false;
  519. txtVoucherDate.Enabled=true;
  520. txtVoucherNo.ReadOnly=false;
  521. cbTransactor.Enabled=true;
  522. ntbMoney.ReadOnly=false;
  523. txtComment.ReadOnly=false;
  524. cbPayType.Enabled=true;
  525. #PrePay.ID_PrePay=NewGuid();
  526. #PrePay.PayCurrency_PrePay=@SysCurrency;
  527. #PrePay.Currency_PrePay=@SysCurrency;
  528. #PrePay.Rate_PrePay=1.00;
  529. #PrePay.Creator=GetCurrentUser();
  530. #PrePay.ID_Creator=GetLoginUserID();
  531. #PrePay.Assessor=DBNull();
  532. #PrePay.ID_Assessor=DBNull();
  533. #PrePay.AssessDate_PrePay=DBNull();
  534. #PrePay.LastModUser_PrePay=DBNull();
  535. #PrePay.LastModUser=DBNull();
  536. #PrePay.LastModDate_PrePay=DBNull();
  537. #PrePay.Date_PrePay=GetCurrentTime();
  538. toolBar.EnableSubmit=GetRight(@Title,"新增");
  539. toolBar.EnableModify=false;
  540. toolBar.EnableDelete=false;
  541. toolBar.EnableAudit=false;
  542. toolBar.EnableUnAudit=false;
  543. toolBar.EnableNew=false;
  544. toolBar.EnablePrint=false;
  545. UpdateForm(true,"");
  546. @Status=1;
  547. </New>
  548. <View>
  549. tbNo.ReadOnly=false;
  550. dtDate.Enabled=false;
  551. tbSupplierNo.ReadOnly=true;
  552. txtVoucherDate.Enabled=false;
  553. txtVoucherNo.ReadOnly=true;
  554. cbTransactor.Enabled=false;
  555. ntbMoney.ReadOnly=true;
  556. txtComment.ReadOnly=true;
  557. cbPayType.Enabled=false;
  558. toolBar.EnableSubmit=false;
  559. toolBar.EnableNew=GetRight(@Title,"新增");
  560. if(Equals(#PrePay.ID_Assessor, DBNull()))
  561. {
  562. toolBar.EnableAudit=GetRight(@Title,"审核");
  563. toolBar.EnableUnAudit=false;
  564. toolBar.EnableModify=GetRight(@Title,"修改");
  565. toolBar.EnableDelete=GetRight(@Title,"删除");
  566. }
  567. else
  568. {
  569. toolBar.EnableAudit=false;
  570. toolBar.EnableUnAudit=GetRight(@Title,"取消审核");
  571. toolBar.EnableModify=false;
  572. toolBar.EnableDelete=false;
  573. }
  574. toolBar.EnablePrint=GetRight(@Title,"打印");
  575. UpdateForm(true, "");
  576. @Status=2;
  577. </View>
  578. <Modify>
  579. tbNo.ReadOnly=true;
  580. dtDate.Enabled=false;
  581. tbSupplierNo.ReadOnly=false;
  582. txtVoucherDate.Enabled=true;
  583. txtVoucherNo.ReadOnly=false;
  584. cbTransactor.Enabled=true;
  585. ntbMoney.ReadOnly=false;
  586. txtComment.ReadOnly=false;
  587. cbPayType.Enabled=true;
  588. #PrePay.LastModUser=GetCurrentUser();
  589. #PrePay.LastModUser_PrePay=GetLoginUserID();
  590. #PrePay.LastModDate_PrePay=GetCurrentTime();
  591. toolBar.EnableSubmit=GetRight(@Title,"修改");
  592. toolBar.EnableModify=false;
  593. toolBar.EnableDelete=false;
  594. toolBar.EnableAudit=false;
  595. toolBar.EnableUnAudit=false;
  596. toolBar.EnableNew=false;
  597. toolBar.EnablePrint=false;
  598. UpdateForm(true, "");
  599. @Status=3;
  600. </Modify>
  601. <SubmitButtonClick>
  602. <![CDATA[
  603. if(!Search("SearchSupplier",tbSupplierNo.CValue)||!Equals(#PrePay.ID_Supplier,#Supplier.ID_Supplier))
  604. {
  605. MessageBox("请输入有效的供应商,回车以示确认!",@Title);
  606. tbSupplierNo.Focus();
  607. return;
  608. }
  609. if(ntbMoney.CValue <= 0)
  610. {
  611. MessageBox("收款金额必须大于0 !",@Title);
  612. ntbMoney.Focus();
  613. return;
  614. }
  615. if(!cbTransactor.CheckSelectedItem())
  616. {
  617. MessageBox("请输入有效的经办人!",@Title);
  618. cbTransactor.Focus();
  619. return;
  620. }
  621. UpdateForm(false,"");
  622. if(@Status==1)
  623. { #PrePay.CreateDate_PrePay=GetCurrentTime();
  624. #PrePay.No_PrePay = New("PrePay.No_PrePay", dtDate.CValue);
  625. }
  626. else if(@Status==3)
  627. {
  628. #PrePay.LastModUser=GetCurrentUser();
  629. #PrePay.LastModUser_PrePay=GetLoginUserID();
  630. #PrePay.LastModDate_PrePay=GetCurrentTime();
  631. Update();
  632. }
  633. ChangeMode("View");
  634. ]]>
  635. </SubmitButtonClick>
  636. </Lables>
  637. </Form>
  638. </Forms>