FrmPreGet.xml 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Forms>
  3. <Form Name="FrmPreGet">
  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="PreGet.No_PreGet">
  38. <Events>
  39. <Enter>
  40. if(tbNo.ReadOnly == false)
  41. {
  42. if(tbNo.CValue != StringEmpty())
  43. {
  44. UpdateForm(false, "");
  45. if(Search("SearchPreGetWithNo", 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. <IKCheckBox name="ikCkNoPreGetStrikeBalance" DataSource="PreGet.UnPreGetStrikeBalance_PreGet"/>
  66. <IKDataTimePicker name="dtDate" DataSource="PreGet.Date_PreGet" />
  67. <IKTextBox name="txtMaker" DataSource="PreGet.Creator" />
  68. <IKTextButton name="tbCustomerNo" DataSource="PreGet.No_Customer" >
  69. <Events>
  70. <Enter>
  71. UpdateForm(false,"");
  72. if(tbCustomerNo.CValue!=StringEmpty())
  73. {
  74. if(!Search("SearchCustomer",tbCustomerNo.CValue))
  75. {
  76. MessageBox("该客户不存在!",@Title);
  77. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
  78. if(@temp != "")
  79. {
  80. tbCustomerNo.CValue = @temp;
  81. ActiveControlEvent("tbCustomerNo", "Enter");
  82. }
  83. }
  84. else
  85. {
  86. if (Search("SearchCustomersCustomer",tbCustomerNo.CValue))
  87. {
  88. MessageBox("该客户为 "+ #CustomersCustomer.No_Customer +" 的客户,不能填单!");
  89. tbCustomerNo.Text = "";
  90. return;
  91. }
  92. if(!Equals(#Customer.SuspendDate_Customer,DBNull()))
  93. {
  94. MessageBox("该客户已停用!",@Title);
  95. }
  96. #PreGet.ID_Customer=#Customer.ID_Customer;
  97. #PreGet.ShortName_Customer=#Customer.ShortName_Customer;
  98. #PreGet.Balance_PreGet=0;
  99. }
  100. }
  101. else
  102. {
  103. MessageBox("请输入客户编号!",@Title);
  104. #PreGet.ID_Customer=GuidEmpty();
  105. #PreGet.ShortName_Customer="";
  106. #PreGet.Balance_PreGet=0;
  107. tbCustomerNo.Focus();
  108. }
  109. UpdateForm(true,"txtCustomerName");
  110. <!--UpdateForm(true,"ntbBalance");-->
  111. </Enter>
  112. <Click>
  113. if (tbCustomerNo.ReadOnly == false)
  114. {
  115. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
  116. if( @temp == "" )
  117. return;
  118. tbCustomerNo.CValue = @temp;
  119. ActiveControlEvent("tbCustomerNo", "Enter");
  120. }
  121. </Click>
  122. </Events>
  123. </IKTextButton>
  124. <IKTextBox name="txtCustomerName" DataSource="PreGet.ShortName_Customer"/>
  125. <IKComboBoxEx name="cbGetCurrency" DisplaySource="PreGet.GetCurrency_PreGet"/>
  126. <IKComboBoxEx name="cbBillCurrency" DisplaySource="PreGet.Currency_PreGet"/>
  127. <IKNumericTextBox name="txtRate" DataSource="PreGet.Rate_PreGet"/>
  128. <IKComboBoxEx name="cbType" DisplaySource="PreGet.Method_PreGet" DataSource="Method" DisplayMember="Name_TypeDef">
  129. <Events>
  130. <Reload>
  131. UpdateForm(false, "cbType");
  132. Search("SearchMethod");
  133. UpdateForm(true, "cbType");
  134. </Reload>
  135. </Events>
  136. </IKComboBoxEx>
  137. <IKComboBoxEx name="AmountType" DataSource="GetType" DisplayMember="Name_TypeDef">
  138. <Events>
  139. <Reload>
  140. UpdateForm(false,"AmountType");
  141. Search("SearchType");
  142. UpdateForm(true,"AmountType");
  143. </Reload>
  144. </Events>
  145. </IKComboBoxEx>
  146. <IKNumericTextBox name="ntbMoney" DataSource="PreGet.Amount_PreGet"/>
  147. <IKTextBox name="txtVoucherDate" DataSource="PreGet.VoucherDate_PreGet" />
  148. <IKTextBox name="txtVoucherNo" DataSource="PreGet.VoucherNo_PreGet"/>
  149. <IKComboBoxEx name="cbReceiver" ValueSource="PreGet.ID_Receiver" DisplaySource="PreGet.Name_Employee" NoSource="PreGet.No_Receiver" DataSource="Employee" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
  150. <Events>
  151. <Reload>
  152. UpdateForm(false, "cbReceiver");
  153. Search("SearchReceiver");
  154. UpdateForm(true, "cbReceiver");
  155. </Reload>
  156. </Events>
  157. </IKComboBoxEx>
  158. <!--<IKNumericTextBox name="ntbBalance" DataSource="PreGet.Balance_PreGet"/>-->
  159. <IKTextBox name="txtAssessor" DataSource="PreGet.Assessor" />
  160. <IKDateTimeText name="dtAssessDate" DataSource="PreGet.AssessDate_PreGet" />
  161. <IKTextBox name="txtLastModUser" DataSource="PreGet.LastModUser"/>
  162. <IKDateTimeText name="dtLastModDate" DataSource="PreGet.LastModDate_PreGet"/>
  163. <IKComboBoxEx name="cbComment" DisplaySource="PreGet.Comment_PreGet" DataSource="Comment" DisplayMember="Name_TypeDef">
  164. <Events>
  165. <Reload>
  166. UpdateForm(false, "cbComment");
  167. Search("SearchComment");
  168. UpdateForm(true, "cbComment");
  169. </Reload>
  170. </Events>
  171. </IKComboBoxEx>
  172. <IKFormToolBar name="toolBar">
  173. <Events>
  174. <ClickFirst>
  175. AmountType.SelectedName="";
  176. if(Search("SearchPreGetFirst"))
  177. {
  178. ChangeMode("View");
  179. }
  180. </ClickFirst>
  181. <ClickPrev>
  182. AmountType.SelectedName="";
  183. if(Search("SearchPreGetPrevious", tbNo.CValue))
  184. {
  185. ChangeMode("View");
  186. }
  187. </ClickPrev>
  188. <ClickNext>
  189. AmountType.SelectedName="";
  190. if(Search("SearchPreGetNext",tbNo.CValue))
  191. {
  192. ChangeMode("View");
  193. }
  194. </ClickNext>
  195. <ClickLast>
  196. AmountType.SelectedName="";
  197. if(Search("SearchPreGetLast"))
  198. {
  199. ChangeMode("View");
  200. }
  201. </ClickLast>
  202. <ClickNew>
  203. <![CDATA[
  204. @NextNo = GetNextAutoNumber(true);
  205. if (!Equals(@NextNo, ""))
  206. {
  207. ChangeMode("New");
  208. #PreGet.No_PreGet= @NextNo;
  209. UpdateForm(true, "tbNo");
  210. }
  211. ]]>
  212. </ClickNew>
  213. <ClickEmpty>
  214. ChangeMode("Search");
  215. </ClickEmpty>
  216. <ClickSubmit>
  217. <Lable name="SubmitButtonClick" />
  218. </ClickSubmit>
  219. <ClickModify>
  220. ChangeMode("Modify");
  221. </ClickModify>
  222. <ClickDelete>
  223. Delete();
  224. ChangeMode("Search");
  225. </ClickDelete>
  226. <ClickPrint>
  227. PrintReport();
  228. </ClickPrint>
  229. <ClickAudit>
  230. BeginAudit();
  231. #PreGet.ID_Assessor=GetLoginUserID();
  232. #PreGet.Assessor=GetCurrentUser();
  233. #PreGet.AssessDate_PreGet=DateTimeNow();
  234. Audit();
  235. ChangeMode("View");
  236. EndAudit();
  237. </ClickAudit>
  238. <ClickUnAudit>
  239. BeginUnAudit();
  240. #PreGet.ID_Assessor=DBNull();
  241. #PreGet.Assessor=DBNull();
  242. #PreGet.AssessDate_PreGet=DataTimeNow();
  243. UnAudit();
  244. ChangeMode("View");
  245. EndUnAudit();
  246. </ClickUnAudit>
  247. <ClickImport>
  248. ;
  249. </ClickImport>
  250. <ClickExport>
  251. ;
  252. </ClickExport>
  253. <ClickClose>
  254. ;
  255. </ClickClose>
  256. <ClickExpand>
  257. ;
  258. </ClickExpand>
  259. </Events>
  260. </IKFormToolBar>
  261. </Controls>
  262. <LockInfomation LockID="ID_PreGet" LockNO="No_PreGet" LockSearchFunction="SearchPreGetWithNo" LockAudit="ID_Assessor"/>
  263. <LogInfomation LogNO="#PreGet.No_PreGet" RecordFormField="收款方式:#PreGet.Method_PreGet,客户编号:#PreGet.No_Customer,收款金额:#PreGet.Amount_PreGet" RecordDataGridField=""/>
  264. <ChildForms>
  265. <ChildForm name="BillSearch" DataSource="PreGet" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPreGetWithNo">
  266. <DataColumn Index="0" MappingName="#PreGet.No_PreGet" HeaderText="收款单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  267. <DataColumn Index="1" MappingName="#PreGet.CreateDate_PreGet" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  268. <DataColumn Index="2" MappingName="#PreGet.No_Customer" HeaderText="客户编号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  269. <DataColumn Index="3" MappingName="#PreGet.ShortName_Customer" HeaderText="客户简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  270. <DataColumn Index="4" MappingName="#PreGet.Method_PreGet" HeaderText="收款方式" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  271. <DataColumn Index="5" MappingName="#PreGet.Amount_PreGet" HeaderText="金额" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  272. <DataColumn Index="6" MappingName="#PreGet.ID_Assessor" HeaderText="状态" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  273. </ChildForm>
  274. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionByNo="" MappingName="客户">
  275. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  276. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  277. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  278. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  279. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
  280. </ChildForm>
  281. </ChildForms>
  282. </Client>
  283. <Server>
  284. <Tables>
  285. <Table name="PreGet" Type="Parent">
  286. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PreGet.*,a.Name_User As Creator
  287. ,b.Name_User As Assessor,c.Name_User As LastModUser
  288. ,Customer.No_Customer,Customer.ShortName_Customer
  289. ,Employee.No_Employee As No_Receiver,Employee.Name_Employee
  290. FROM PreGet
  291. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  292. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  293. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  294. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  295. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  296. ">
  297. </GetSchema>
  298. <New CmdType="Text" CmdText=" INSERT INTO PreGet(ID_PreGet
  299. ,No_PreGet
  300. ,UnPreGetStrikeBalance_PreGet
  301. ,Date_PreGet
  302. ,ID_Customer
  303. ,GetCurrency_PreGet
  304. ,Currency_PreGet
  305. ,Rate_PreGet
  306. ,Method_PreGet
  307. ,Amount_PreGet
  308. ,VoucherNo_PreGet
  309. ,VoucherDate_PreGet
  310. ,ID_Receiver
  311. ,Balance_PreGet
  312. ,ID_Creator
  313. ,CreateDate_PreGet
  314. ,LastModUser_PreGet
  315. ,LastModDate_PreGet
  316. ,ID_Assessor
  317. ,AssessDate_PreGet
  318. ,Comment_PreGet)
  319. VALUES(@ID_PreGet
  320. ,@No_PreGet
  321. ,@UnPreGetStrikeBalance_PreGet
  322. ,@Date_PreGet
  323. ,@ID_Customer
  324. ,@GetCurrency_PreGet
  325. ,@Currency_PreGet
  326. ,@Rate_PreGet
  327. ,@Method_PreGet
  328. ,@Amount_PreGet
  329. ,@VoucherNo_PreGet
  330. ,@VoucherDate_PreGet
  331. ,@ID_Receiver
  332. ,@Balance_PreGet
  333. ,@ID_Creator
  334. ,@CreateDate_PreGet
  335. ,@LastModUser_PreGet
  336. ,@LastModDate_PreGet
  337. ,@ID_Assessor
  338. ,@AssessDate_PreGet
  339. ,@Comment_PreGet)
  340. declare @amount decimal(16,4)
  341. select @amount=SUM(Amount_PreGet)
  342. from PreGet
  343. where ID_Customer=@ID_Customer
  344. Update Customer
  345. Set PerValue_Customer = @amount
  346. Where ID_Customer = @ID_Customer
  347. ">
  348. <Params>
  349. <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
  350. <Param name="@No_PreGet" type="PreGet.No_PreGet" sourceColumn="No_PreGet" />
  351. <Param name="@UnPreGetStrikeBalance_PreGet" type="PreGet.UnPreGetStrikeBalance_PreGet" sourceColumn="UnPreGetStrikeBalance_PreGet" />
  352. <Param name="@Date_PreGet" type="PreGet.Date_PreGet" sourceColumn="Date_PreGet" />
  353. <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
  354. <Param name="@GetCurrency_PreGet" type="PreGet.GetCurrency_PreGet" sourceColumn="GetCurrency_PreGet" />
  355. <Param name="@Currency_PreGet" type="PreGet.Currency_PreGet" sourceColumn="Currency_PreGet" />
  356. <Param name="@Rate_PreGet" type="PreGet.Rate_PreGet" sourceColumn="Rate_PreGet" />
  357. <Param name="@Method_PreGet" type="PreGet.Method_PreGet" sourceColumn="Method_PreGet" />
  358. <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
  359. <Param name="@VoucherNo_PreGet" type="PreGet.VoucherNo_PreGet" sourceColumn="VoucherNo_PreGet" />
  360. <Param name="@VoucherDate_PreGet" type="PreGet.VoucherDate_PreGet" sourceColumn="VoucherDate_PreGet" />
  361. <Param name="@ID_Receiver" type="PreGet.ID_Receiver" sourceColumn="ID_Receiver" />
  362. <Param name="@Balance_PreGet" type="PreGet.Balance_PreGet" sourceColumn="Balance_PreGet" />
  363. <Param name="@ID_Creator" type="PreGet.ID_Creator" sourceColumn="ID_Creator" />
  364. <Param name="@CreateDate_PreGet" type="PreGet.CreateDate_PreGet" sourceColumn="CreateDate_PreGet" />
  365. <Param name="@LastModUser_PreGet" type="PreGet.LastModUser_PreGet" sourceColumn="LastModUser_PreGet" />
  366. <Param name="@LastModDate_PreGet" type="PreGet.LastModDate_PreGet" sourceColumn="LastModDate_PreGet" />
  367. <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor" />
  368. <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet" />
  369. <Param name="@Comment_PreGet" type="PreGet.Comment_PreGet" sourceColumn="Comment_PreGet" />
  370. </Params>
  371. </New>
  372. <Update CmdType="Text" CmdText=" UPDATE PreGet
  373. SET No_PreGet=@No_PreGet
  374. ,UnPreGetStrikeBalance_PreGet = @UnPreGetStrikeBalance_PreGet
  375. ,Date_PreGet=@Date_PreGet
  376. ,ID_Customer=@ID_Customer
  377. ,GetCurrency_PreGet=@GetCurrency_PreGet
  378. ,Currency_PreGet=@Currency_PreGet
  379. ,Rate_PreGet=@Rate_PreGet
  380. ,Method_PreGet=@Method_PreGet
  381. ,Amount_PreGet=@Amount_PreGet
  382. ,VoucherNo_PreGet=@VoucherNo_PreGet
  383. ,VoucherDate_PreGet=@VoucherDate_PreGet
  384. ,ID_Receiver=@ID_Receiver
  385. ,Balance_PreGet=@Balance_PreGet
  386. ,ID_Creator=@ID_Creator
  387. ,CreateDate_PreGet=@CreateDate_PreGet
  388. ,LastModUser_PreGet=@LastModUser_PreGet
  389. ,LastModDate_PreGet=@LastModDate_PreGet
  390. ,ID_Assessor=@ID_Assessor
  391. ,AssessDate_PreGet=@AssessDate_PreGet
  392. ,Comment_PreGet=@Comment_PreGet
  393. WHERE ID_PreGet=@ID_PreGet
  394. declare @amount decimal(16,4)
  395. select @amount=SUM(Amount_PreGet)
  396. from PreGet
  397. where ID_Customer=@ID_Customer
  398. Update Customer
  399. Set PerValue_Customer = @amount
  400. Where ID_Customer = @ID_Customer
  401. ">
  402. <Params>
  403. <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
  404. <Param name="@No_PreGet" type="PreGet.No_PreGet" sourceColumn="No_PreGet" />
  405. <Param name="@UnPreGetStrikeBalance_PreGet" type="PreGet.UnPreGetStrikeBalance_PreGet" sourceColumn="UnPreGetStrikeBalance_PreGet" />
  406. <Param name="@Date_PreGet" type="PreGet.Date_PreGet" sourceColumn="Date_PreGet" />
  407. <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
  408. <Param name="@GetCurrency_PreGet" type="PreGet.GetCurrency_PreGet" sourceColumn="GetCurrency_PreGet" />
  409. <Param name="@Currency_PreGet" type="PreGet.Currency_PreGet" sourceColumn="Currency_PreGet" />
  410. <Param name="@Rate_PreGet" type="PreGet.Rate_PreGet" sourceColumn="Rate_PreGet" />
  411. <Param name="@Method_PreGet" type="PreGet.Method_PreGet" sourceColumn="Method_PreGet" />
  412. <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
  413. <Param name="@VoucherNo_PreGet" type="PreGet.VoucherNo_PreGet" sourceColumn="VoucherNo_PreGet" />
  414. <Param name="@VoucherDate_PreGet" type="PreGet.VoucherDate_PreGet" sourceColumn="VoucherDate_PreGet" />
  415. <Param name="@ID_Receiver" type="PreGet.ID_Receiver" sourceColumn="ID_Receiver" />
  416. <Param name="@Balance_PreGet" type="PreGet.Balance_PreGet" sourceColumn="Balance_PreGet" />
  417. <Param name="@ID_Creator" type="PreGet.ID_Creator" sourceColumn="ID_Creator" />
  418. <Param name="@CreateDate_PreGet" type="PreGet.CreateDate_PreGet" sourceColumn="CreateDate_PreGet" />
  419. <Param name="@LastModUser_PreGet" type="PreGet.LastModUser_PreGet" sourceColumn="LastModUser_PreGet" />
  420. <Param name="@LastModDate_PreGet" type="PreGet.LastModDate_PreGet" sourceColumn="LastModDate_PreGet" />
  421. <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor" />
  422. <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet" />
  423. <Param name="@Comment_PreGet" type="PreGet.Comment_PreGet" sourceColumn="Comment_PreGet" />
  424. </Params>
  425. </Update>
  426. <Delete CmdType="Text" CmdText=" declare @amount decimal(16,4)
  427. declare @ID_Customer uniqueidentifier
  428. ,@PerValue_Customer decimal(16,4)
  429. Select @ID_Customer=ID_Customer
  430. from PreGet
  431. where ID_PreGet=@ID_PreGet
  432. select @amount=Amount_PreGet
  433. from PreGet
  434. where ID_PreGet=@ID_PreGet
  435. Select @PerValue_Customer=isnull(Sum(PerValue_Customer),0) from Customer
  436. where ID_Customer=@ID_Customer
  437. Update Customer
  438. Set PerValue_Customer = @PerValue_Customer - @amount
  439. Where ID_Customer = @ID_Customer
  440. DELETE PreGet WHERE ID_PreGet=@ID_PreGet
  441. ">
  442. <Params>
  443. <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
  444. </Params>
  445. </Delete>
  446. <Audit CmdType="Text" CmdText=" IF(@ID_Assessor IS NOT NULL)
  447. UPDATE Customer SET PrePayBalance_Customer=PrePayBalance_Customer+@Amount_PreGet WHERE ID_Customer=@ID_Customer
  448. ELSE
  449. UPDATE Customer SET PrePayBalance_Customer=PrePayBalance_Customer-@Amount_PreGet WHERE ID_Customer=@ID_Customer
  450. UPDATE PreGet SET ID_Assessor=@ID_Assessor,AssessDate_PreGet=@AssessDate_PreGet WHERE ID_PreGet=@ID_PreGet
  451. ">
  452. <Params>
  453. <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet"/>
  454. <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
  455. <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
  456. <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor"/>
  457. <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet"/>
  458. </Params>
  459. </Audit>
  460. </Table>
  461. </Tables>
  462. <Search>
  463. <SearchAllBill CmdType="Text" CmdText="
  464. select
  465. [ID_PreGet]
  466. ,[No_PreGet]
  467. ,[UnPreGetStrikeBalance_PreGet]
  468. ,[Date_PreGet]
  469. ,PreGet.[ID_Customer]
  470. ,[GetCurrency_PreGet]
  471. ,[Currency_PreGet]
  472. ,[Rate_PreGet]
  473. ,[Method_PreGet]
  474. ,[Amount_PreGet]
  475. ,[VoucherNo_PreGet]
  476. ,[VoucherDate_PreGet]
  477. ,[ID_Receiver]
  478. ,[Balance_PreGet]
  479. ,PreGet.[ID_Creator]
  480. ,case isnull(ID_Assessor,'00000000-0000-0000-0000-000000000000')
  481. when '00000000-0000-0000-0000-000000000000' then '未审核'
  482. else '已审核'
  483. end as ID_Assessor
  484. ,[AssessDate_PreGet]
  485. ,[Comment_PreGet]
  486. ,[CreateDate_PreGet]
  487. ,[LastModUser_PreGet]
  488. ,[LastModDate_PreGet]
  489. ,ShortName_Customer,No_Customer
  490. FROM PreGet
  491. LEFT JOIN Customer ON Customer.ID_Customer=PreGet.ID_Customer
  492. ">
  493. <Tables>
  494. <Table name="AllBill" />
  495. </Tables>
  496. </SearchAllBill>
  497. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer
  498. ,Customer.Type_Customer,Customer.Level_Customer
  499. ,Customer.IsGeneric_Customer
  500. FROM Customer ">
  501. <Tables>
  502. <Table name="AllCustomer" />
  503. </Tables>
  504. </SearchAllCustomer>
  505. <SearchCustomer CmdType="Text" CmdText=" SELECT ID_Customer,ShortName_Customer,PrePayBalance_Customer
  506. ,Customer.SuspendDate_Customer
  507. From Customer
  508. WHERE No_Customer=@No_Customer
  509. ">
  510. <Params>
  511. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  512. </Params>
  513. <Tables>
  514. <Table name="Customer"/>
  515. </Tables>
  516. </SearchCustomer>
  517. <SearchReceiver CmdType="Text" CmdText=" SELECT Name_Employee,ID_Employee,No_Employee
  518. From Employee
  519. ORDER BY No_Employee">
  520. <Tables>
  521. <Table name="Employee"/>
  522. </Tables>
  523. </SearchReceiver>
  524. <SearchMethod CmdType="Text" CmdText=" SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef=23 ">
  525. <Tables>
  526. <Table name="Method"/>
  527. </Tables>
  528. </SearchMethod>
  529. <SearchType CmdType="Text" CmdText=" CREATE TABLE #TypeDef( Type nvarchar(64)) DECLARE @i int SET @i = 0
  530. WHILE @i &lt; 2
  531. BEGIN
  532. IF(@i=0)
  533. BEGIN
  534. INSERT INTO #TypeDef (Type)VALUES('收款')
  535. END
  536. IF(@i=1)
  537. BEGIN
  538. INSERT INTO #TypeDef (Type)VALUES('退款')
  539. END
  540. SET @i = @i + 1
  541. END
  542. SELECT Type AS Name_TypeDef FROM #TypeDef
  543. DROP TABLE #TypeDef
  544. ">
  545. <Tables>
  546. <Table name="GetType" />
  547. </Tables>
  548. </SearchType>
  549. <SearchComment CmdType="Text" CmdText="Select Name_TypeDef From TypeDef Where Type_TypeDef = 29 ">
  550. <Tables>
  551. <Table name="Comment" />
  552. </Tables>
  553. </SearchComment>
  554. <SearchPreGetWithNo CmdType="Text" CmdText=" Select PreGet.ID_PreGet
  555. ,PreGet.No_PreGet
  556. ,PreGet.UnPreGetStrikeBalance_PreGet
  557. ,PreGet.Date_PreGet
  558. ,PreGet.ID_Customer
  559. ,PreGet.GetCurrency_PreGet
  560. ,PreGet.Currency_PreGet
  561. ,PreGet.Rate_PreGet
  562. ,PreGet.Method_PreGet
  563. ,PreGet.Amount_PreGet
  564. ,PreGet.VoucherNo_PreGet
  565. ,PreGet.VoucherDate_PreGet
  566. ,PreGet.ID_Receiver
  567. ,PreGet.Balance_PreGet
  568. ,PreGet.ID_Creator
  569. ,PreGet.ID_Assessor
  570. ,PreGet.AssessDate_PreGet
  571. ,PreGet.Comment_PreGet
  572. ,PreGet.CreateDate_PreGet
  573. ,PreGet.LastModUser_PreGet
  574. ,PreGet.LastModDate_PreGet
  575. ,a.Name_User As Creator ,b.Name_User As Assessor
  576. ,c.Name_User As LastModUser,Customer.No_Customer
  577. ,Customer.ShortName_Customer,Employee.No_Employee AS No_Receiver
  578. ,Employee.Name_Employee
  579. FROM PreGet
  580. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  581. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  582. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  583. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  584. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  585. WHERE No_PreGet=@No_PreGet">
  586. <Params>
  587. <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
  588. </Params>
  589. <Tables>
  590. <Table name="PreGet"/>
  591. </Tables>
  592. </SearchPreGetWithNo>
  593. <SearchPreGetFirst CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
  594. ,PreGet.No_PreGet
  595. ,PreGet.UnPreGetStrikeBalance_PreGet
  596. ,PreGet.Date_PreGet
  597. ,PreGet.ID_Customer
  598. ,PreGet.GetCurrency_PreGet
  599. ,PreGet.Currency_PreGet
  600. ,PreGet.Rate_PreGet
  601. ,PreGet.Method_PreGet
  602. ,PreGet.Amount_PreGet
  603. ,PreGet.VoucherNo_PreGet
  604. ,PreGet.VoucherDate_PreGet
  605. ,PreGet.ID_Receiver
  606. ,PreGet.Balance_PreGet
  607. ,PreGet.ID_Creator
  608. ,PreGet.ID_Assessor
  609. ,PreGet.AssessDate_PreGet
  610. ,PreGet.Comment_PreGet
  611. ,PreGet.CreateDate_PreGet
  612. ,PreGet.LastModUser_PreGet
  613. ,PreGet.LastModDate_PreGet
  614. ,a.Name_User As Creator
  615. ,b.Name_User As Assessor
  616. ,c.Name_User As LastModUser
  617. ,Customer.No_Customer
  618. ,Customer.ShortName_Customer
  619. ,Employee.No_Employee AS No_Receiver
  620. ,Employee.Name_Employee
  621. FROM PreGet
  622. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  623. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  624. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  625. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  626. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  627. ORDER BY No_PreGet">
  628. <Tables>
  629. <Table name="PreGet"/>
  630. </Tables>
  631. </SearchPreGetFirst>
  632. <SearchPreGetLast CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
  633. ,PreGet.No_PreGet
  634. ,PreGet.UnPreGetStrikeBalance_PreGet
  635. ,PreGet.Date_PreGet
  636. ,PreGet.ID_Customer
  637. ,PreGet.GetCurrency_PreGet
  638. ,PreGet.Currency_PreGet
  639. ,PreGet.Rate_PreGet
  640. ,PreGet.Method_PreGet
  641. ,PreGet.Amount_PreGet
  642. ,PreGet.VoucherNo_PreGet
  643. ,PreGet.VoucherDate_PreGet
  644. ,PreGet.ID_Receiver
  645. ,PreGet.Balance_PreGet
  646. ,PreGet.ID_Creator
  647. ,PreGet.ID_Assessor
  648. ,PreGet.AssessDate_PreGet
  649. ,PreGet.Comment_PreGet
  650. ,PreGet.CreateDate_PreGet
  651. ,PreGet.LastModUser_PreGet
  652. ,PreGet.LastModDate_PreGet
  653. ,a.Name_User As Creator
  654. ,b.Name_User As Assessor,c.Name_User As LastModUser
  655. ,Customer.No_Customer,Customer.ShortName_Customer
  656. ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
  657. FROM PreGet
  658. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  659. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  660. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  661. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  662. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  663. ORDER BY No_PreGet DESC">
  664. <Tables>
  665. <Table name="PreGet"/>
  666. </Tables>
  667. </SearchPreGetLast>
  668. <SearchPreGetPrevious CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
  669. ,PreGet.No_PreGet
  670. ,PreGet.UnPreGetStrikeBalance_PreGet
  671. ,PreGet.Date_PreGet
  672. ,PreGet.ID_Customer
  673. ,PreGet.GetCurrency_PreGet
  674. ,PreGet.Currency_PreGet
  675. ,PreGet.Rate_PreGet
  676. ,PreGet.Method_PreGet
  677. ,PreGet.Amount_PreGet
  678. ,PreGet.VoucherNo_PreGet
  679. ,PreGet.VoucherDate_PreGet
  680. ,PreGet.ID_Receiver
  681. ,PreGet.Balance_PreGet
  682. ,PreGet.ID_Creator
  683. ,PreGet.ID_Assessor
  684. ,PreGet.AssessDate_PreGet
  685. ,PreGet.Comment_PreGet
  686. ,PreGet.CreateDate_PreGet
  687. ,PreGet.LastModUser_PreGet
  688. ,PreGet.LastModDate_PreGet
  689. ,a.Name_User As Creator
  690. ,b.Name_User As Assessor,c.Name_User As LastModUser
  691. ,Customer.No_Customer,Customer.ShortName_Customer
  692. ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
  693. FROM PreGet
  694. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  695. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  696. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  697. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  698. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  699. WHERE No_PreGet &lt; @No_PreGet
  700. ORDER BY No_PreGet DESC">
  701. <Params>
  702. <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
  703. </Params>
  704. <Tables>
  705. <Table name="PreGet"/>
  706. </Tables>
  707. </SearchPreGetPrevious>
  708. <SearchPreGetNext CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
  709. ,PreGet.No_PreGet
  710. ,PreGet.UnPreGetStrikeBalance_PreGet
  711. ,PreGet.Date_PreGet
  712. ,PreGet.ID_Customer
  713. ,PreGet.GetCurrency_PreGet
  714. ,PreGet.Currency_PreGet
  715. ,PreGet.Rate_PreGet
  716. ,PreGet.Method_PreGet
  717. ,PreGet.Amount_PreGet
  718. ,PreGet.VoucherNo_PreGet
  719. ,PreGet.VoucherDate_PreGet
  720. ,PreGet.ID_Receiver
  721. ,PreGet.Balance_PreGet
  722. ,PreGet.ID_Creator
  723. ,PreGet.ID_Assessor
  724. ,PreGet.AssessDate_PreGet
  725. ,PreGet.Comment_PreGet
  726. ,PreGet.CreateDate_PreGet
  727. ,PreGet.LastModUser_PreGet
  728. ,PreGet.LastModDate_PreGet
  729. ,a.Name_User As Creator
  730. ,b.Name_User As Assessor,c.Name_User As LastModUser
  731. ,Customer.No_Customer,Customer.ShortName_Customer
  732. ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
  733. FROM PreGet
  734. LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
  735. LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
  736. LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
  737. Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
  738. LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
  739. WHERE No_PreGet &gt; @No_PreGet
  740. ORDER BY No_PreGet">
  741. <Params>
  742. <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
  743. </Params>
  744. <Tables>
  745. <Table name="PreGet"/>
  746. </Tables>
  747. </SearchPreGetNext>
  748. <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
  749. <Tables>
  750. <Table name="SystemSetting"/>
  751. </Tables>
  752. </SearchSystemSetting>
  753. <SearchCustomersCustomer CmdType="Text" CmdText="Select *
  754. From Customer
  755. Where ID_Customer = (Select CustomerID_Customer
  756. From Customer
  757. Where No_Customer = @No_Customer
  758. And IsCustomersCustomer_Customer = 1)">
  759. <Params>
  760. <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
  761. </Params>
  762. <Tables>
  763. <Table name="CustomersCustomer"/>
  764. </Tables>
  765. </SearchCustomersCustomer>
  766. </Search>
  767. </Server>
  768. <Lables>
  769. <Search>
  770. Empty();
  771. NewInstance();
  772. tbNo.ReadOnly=false;
  773. ikCkNoPreGetStrikeBalance.Enabled=false;
  774. dtDate.Enabled=false;
  775. tbCustomerNo.ReadOnly=true;
  776. cbType.Enabled=false;
  777. AmountType.Enabled=false;
  778. txtVoucherDate.Enabled=false;
  779. txtVoucherNo.ReadOnly=true;
  780. cbReceiver.Enabled=false;
  781. ntbMoney.ReadOnly=true;
  782. cbComment.Enabled=false;
  783. #PreGet.Creator="";
  784. #PreGet.ID_Creator=DBNull();
  785. #PreGet.Assessor="";
  786. #PreGet.ID_Assessor=DBNull();
  787. #PreGet.AssessDate_PreGet=DBNull();
  788. #PreGet.LastModUser_PreGet=DBNull();
  789. #PreGet.LastModUser="";
  790. #PreGet.LastModDate_PreGet=DBNull();
  791. toolBar.EnableSubmit=false;
  792. toolBar.EnableModify=false;
  793. toolBar.EnableDelete=false;
  794. toolBar.EnableAudit=false;
  795. toolBar.EnableUnAudit=false;
  796. toolBar.EnableNew=GetRight(@Title,"新增");
  797. toolBar.EnablePrint=false;
  798. UpdateForm(true,"");
  799. tbNo.Focus();
  800. @Status=0;
  801. </Search>
  802. <New>
  803. @sql = 0;
  804. Empty();
  805. NewInstance();
  806. tbNo.ReadOnly=true;
  807. ikCkNoPreGetStrikeBalance.Enabled=true;
  808. dtDate.Enabled=true;
  809. tbCustomerNo.ReadOnly=false;
  810. cbType.Enabled=true;
  811. AmountType.Enabled = true;
  812. txtVoucherDate.Enabled=true;
  813. txtVoucherNo.ReadOnly=false;
  814. cbReceiver.Enabled=true;
  815. ntbMoney.ReadOnly=false;
  816. cbComment.Enabled=true;
  817. #PreGet.ID_PreGet=NewGuid();
  818. #PreGet.GetCurrency_PreGet=@SysCurrency;
  819. #PreGet.Currency_PreGet=@SysCurrency;
  820. #PreGet.Rate_PreGet=1.00;
  821. #PreGet.Creator=GetCurrentUser();
  822. #PreGet.ID_Creator=GetLoginUserID();
  823. #PreGet.Assessor=DBNull();
  824. #PreGet.ID_Assessor=DBNull();
  825. #PreGet.AssessDate_PreGet=DBNull();
  826. #PreGet.LastModUser_PreGet=DBNull();
  827. #PreGet.LastModUser=DBNull();
  828. #PreGet.LastModDate_PreGet=DBNull();
  829. #PreGet.UnPreGetStrikeBalance_PreGet=false;
  830. #PreGet.Date_PreGet=GetCurrentTime();
  831. AmountType.SelectedName = "收款";
  832. toolBar.EnableSubmit=GetRight(@Title,"新增");
  833. toolBar.EnableModify=false;
  834. toolBar.EnableDelete=false;
  835. toolBar.EnableAudit=false;
  836. toolBar.EnableUnAudit=false;
  837. toolBar.EnableNew=false;
  838. toolBar.EnablePrint=false;
  839. UpdateForm(true,"");
  840. @Status=1;
  841. </New>
  842. <View>
  843. tbNo.ReadOnly=false;
  844. ikCkNoPreGetStrikeBalance.Enabled=false;
  845. dtDate.Enabled=false;
  846. tbCustomerNo.ReadOnly=true;
  847. txtVoucherDate.Enabled=false;
  848. txtVoucherNo.ReadOnly=true;
  849. cbReceiver.Enabled=false;
  850. cbType.Enabled=false;
  851. AmountType.Enabled = false;
  852. ntbMoney.ReadOnly=true;
  853. cbComment.Enabled=false;
  854. toolBar.EnableSubmit=false;
  855. toolBar.EnableNew=GetRight(@Title,"新增");
  856. if(Equals(#PreGet.ID_Assessor, DBNull()))
  857. {
  858. toolBar.EnableAudit=GetRight(@Title,"审核");
  859. toolBar.EnableUnAudit=false;
  860. toolBar.EnableModify=GetRight(@Title,"修改");
  861. toolBar.EnableDelete=GetRight(@Title,"删除");
  862. }
  863. else
  864. {
  865. toolBar.EnableAudit=false;
  866. toolBar.EnableUnAudit=GetRight(@Title,"取消审核");
  867. toolBar.EnableModify=false;
  868. toolBar.EnableDelete=false;
  869. }
  870. if(#PreGet.Amount_PreGet>0)
  871. {
  872. AmountType.SelectedName ="收款";
  873. }
  874. else
  875. {
  876. AmountType.SelectedName ="退款";
  877. }
  878. toolBar.EnablePrint=GetRight(@Title,"打印");
  879. UpdateForm(true, "");
  880. @Status=2;
  881. </View>
  882. <Modify>
  883. @sql = ntbMoney.CValue;
  884. tbNo.ReadOnly=true;
  885. ikCkNoPreGetStrikeBalance.Enabled=true;
  886. dtDate.Enabled=false;
  887. tbCustomerNo.ReadOnly=true;
  888. txtVoucherDate.Enabled=true;
  889. txtVoucherNo.ReadOnly=false;
  890. cbReceiver.Enabled=true;
  891. cbType.Enabled=true;
  892. AmountType.Enabled = true;
  893. ntbMoney.ReadOnly=false;
  894. cbComment.Enabled=true;
  895. #PreGet.LastModUser=GetCurrentUser();
  896. #PreGet.LastModUser_PreGet=GetLoginUserID();
  897. #PreGet.LastModDate_PreGet=GetCurrentTime();
  898. toolBar.EnableSubmit=GetRight(@Title,"修改");
  899. toolBar.EnableModify=false;
  900. toolBar.EnableDelete=false;
  901. toolBar.EnableAudit=false;
  902. toolBar.EnableUnAudit=false;
  903. toolBar.EnableNew=false;
  904. toolBar.EnablePrint=false;
  905. UpdateForm(true, "");
  906. @Status=3;
  907. </Modify>
  908. <SubmitButtonClick>
  909. <![CDATA[
  910. if(!Search("SearchCustomer",tbCustomerNo.CValue) ||!Equals(#PreGet.ID_Customer,#Customer.ID_Customer))
  911. {
  912. MessageBox("请输入有效的客户,回车以示确认!",@Title);
  913. tbCustomerNo.Focus();
  914. return;
  915. }
  916. if(!cbReceiver.CheckSelectedItem())
  917. {
  918. MessageBox("请输入有效的收款人!",@Title);
  919. cbReceiver.Focus();
  920. return;
  921. }
  922. if(!AmountType.CheckSelectedItem())
  923. {
  924. MessageBox("请输入有效的金额方式!",@Title);
  925. AmountType.Focus();
  926. return;
  927. }
  928. UpdateForm(false,"");
  929. if(@Status==1)
  930. { #PreGet.CreateDate_PreGet=GetCurrentTime();
  931. if(AmountType.SelectedName=="收款")
  932. {
  933. #PreGet.Amount_PreGet = ntbMoney.CValue;
  934. }
  935. if(AmountType.SelectedName=="退款")
  936. {
  937. #PreGet.Amount_PreGet = -ntbMoney.CValue;
  938. }
  939. #PreGet.No_PreGet = New("#PreGet.No_PreGet", dtDate.CValue);
  940. }
  941. else if(@Status==3)
  942. {
  943. #PreGet.LastModUser=GetCurrentUser();
  944. #PreGet.LastModUser_PreGet=GetLoginUserID();
  945. #PreGet.LastModDate_PreGet=GetCurrentTime();
  946. if(AmountType.SelectedName=="退款")
  947. {
  948. if(ntbMoney.CValue!=@sql)
  949. {
  950. if(ntbMoney.CValue!=-@sql)
  951. {
  952. if (ntbMoney.CValue >=0)
  953. #PreGet.Amount_PreGet=-ntbMoney.CValue;
  954. else
  955. #PreGet.Amount_PreGet=ntbMoney.CValue;
  956. }
  957. }
  958. else
  959. {
  960. if(@sql>=0)
  961. #PreGet.Amount_PreGet=-@sql;
  962. else
  963. #PreGet.Amount_PreGet=@sql;
  964. }
  965. }
  966. else
  967. {
  968. if(ntbMoney.CValue!=@sql)
  969. {
  970. if(ntbMoney.CValue!=-@sql)
  971. {
  972. if (ntbMoney.CValue >=0)
  973. #PreGet.Amount_PreGet=ntbMoney.CValue;
  974. else
  975. #PreGet.Amount_PreGet=-ntbMoney.CValue;
  976. }
  977. }
  978. else
  979. {
  980. if(@sql>=0)
  981. #PreGet.Amount_PreGet=@sql;
  982. else
  983. #PreGet.Amount_PreGet=-@sql;
  984. }
  985. }
  986. Update();
  987. }
  988. ChangeMode("View");
  989. ]]>
  990. </SubmitButtonClick>
  991. </Lables>
  992. </Form>
  993. </Forms>