FrmExpressReceivingAnnal.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmExpressReceivingAnnal">
  4. <Client>
  5. <Events>
  6. <Load><![CDATA[
  7. @Title="快递收件";
  8. GetSchema();
  9. Search("SearchBillType");
  10. Search("SearchSystemSetting");
  11. @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
  12. ChangeMode("Search");
  13. ]]></Load>
  14. <Closing>
  15. ;
  16. </Closing>
  17. <Closed>
  18. ;
  19. </Closed>
  20. </Events>
  21. <Mode>
  22. <Search>
  23. <Lable name="Search"/>
  24. </Search>
  25. <New>
  26. <Lable name="New"/>
  27. </New>
  28. <View>
  29. <Lable name="View"/>
  30. </View>
  31. <Modify>
  32. <Lable name="Modify"/>
  33. </Modify>
  34. </Mode>
  35. <Controls>
  36. <IKDateTimePicker name="dtDate" DataSource="ExpressIncept.Date_ExpressIncept"/>
  37. <IKTextButton name="tbNo" DataSource="ExpressIncept.No_ExpressIncept">
  38. <Events>
  39. <Enter><![CDATA[
  40. if(tbNo.ReadOnly == false)
  41. {
  42. if(tbNo.CValue != StringEmpty())
  43. {
  44. UpdateForm(false, "");
  45. if(@Status==0)
  46. {
  47. if(Search("SearchExpressInceptWithNo", tbNo.CValue))
  48. {
  49. ChangeMode("View");
  50. }
  51. else
  52. {
  53. @No=tbNo.CValue;
  54. ChangeMode("New");
  55. tbNo.CValue=@No;
  56. cbBillType.Focus();
  57. }
  58. }
  59. else if(@Status==1)
  60. {
  61. if(Search("SearchExpressInceptWithNo", tbNo.CValue))
  62. {
  63. MessageBox("该快递单已存在!",@Title);
  64. }
  65. }
  66. }
  67. else
  68. {
  69. MessageBox("请输入快递单号!",@Title);
  70. }
  71. }
  72. ]]>
  73. </Enter>
  74. <Click>
  75. ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
  76. </Click>
  77. </Events>
  78. </IKTextButton>
  79. <IKComboBoxEx name="cbBillType" DisplaySource="ExpressIncept.Name_FromBill" DataSource="FromBillType" DisplayMember="Name_Bill">
  80. </IKComboBoxEx>
  81. <IKTextButton name="tbFromBill" DataSource="ExpressIncept.No_FromBill">
  82. <Events>
  83. <Click>
  84. if( tbFromBill.ReadOnly == false)
  85. {
  86. if( cbBillType.SelectedName == "库存异动作业" )
  87. {
  88. ShowSearchBox("ModifyDepotBillSearch","HAVEDEPOT", "tbFromBill",tbFromBill.CValue, false);
  89. }
  90. else if(cbBillType.SelectedName == "采购入库单" )
  91. {
  92. ShowSearchBox("PurchaseInDepotBillSearch","HAVEDEPOT", "tbFromBill",tbFromBill.CValue, false);
  93. }
  94. }
  95. </Click>
  96. </Events>
  97. </IKTextButton>
  98. <IKComboBoxEx name="cbDept" DisplaySource="ExpressIncept.ShortName_Transporter" ValueSource="ExpressIncept.ID_Transporter" NoSource="ExpressIncept.No_Transporter" DataSource="Transporter" DisplayMember="ShortName_Transporter" ValueMember="ID_Transporter" NoMember="No_Transporter">
  99. <Events>
  100. <Reload>
  101. UpdateForm(false, "cbDept");
  102. Search("SearchTransporter");
  103. UpdateForm(true, "cbDept");
  104. </Reload>
  105. </Events>
  106. </IKComboBoxEx>
  107. <IKComboBox name="cbCarriage" DisplaySource="ExpressIncept.Currency_ExpressIncept" DataSource="ExpressIncept" DisplayMember="Currency_ExpressIncept">
  108. </IKComboBox>
  109. <IKNumericTextBox name="ntbMoney" DataSource="ExpressIncept.Carriage_ExpressIncept" />
  110. <IKCheckBox name="ckHavePay" DataSource="ExpressIncept.HavePay_ExpressIncept"/>
  111. <IKTextBox name="txtName" DataSource="ExpressIncept.Sender_ExpressIncept"/>
  112. <IKTextBox name="txtAddr" DataSource="ExpressIncept.Address_ExpressIncept"/>
  113. <IKTextBox name="txtMaker" DataSource="ExpressIncept.Name_Creator"/>
  114. <IKDateTimeText name="dttMakerDate" DataSource="ExpressIncept.CreateDate_ExpressIncept"/>
  115. <IKTextBox name="txtlastmoduser" DataSource="ExpressIncept.LastModUserName_ExpressIncept"/>
  116. <IKDateTimeText name="dttlastmoddate" DataSource="ExpressIncept.LastModDate_ExpressIncept"/>
  117. <IKTextBox name="txtComment" DataSource="ExpressIncept.Comment_ExpressIncept"/>
  118. <IKFormToolBar name="toolBar">
  119. <Events>
  120. <ClickFirst>
  121. if(Search("SearchExpressInceptFirst"))
  122. {
  123. ChangeMode("View");
  124. }
  125. </ClickFirst>
  126. <ClickPrev>
  127. if(Search("SearchExpressInceptPrevious", tbNo.CValue))
  128. {
  129. ChangeMode("View");
  130. }
  131. </ClickPrev>
  132. <ClickNext>
  133. if(Search("SearchExpressInceptNext", tbNo.CValue))
  134. {
  135. ChangeMode("View");
  136. }
  137. </ClickNext>
  138. <ClickLast>
  139. if(Search("SearchExpressInceptLast"))
  140. {
  141. ChangeMode("View");
  142. }
  143. </ClickLast>
  144. <ClickEmpty>
  145. ChangeMode("Search");
  146. </ClickEmpty>
  147. <ClickSubmit>
  148. <Lable name="SubmitButtonClick"/>
  149. </ClickSubmit>
  150. <ClickNew>
  151. ChangeMode("New");
  152. </ClickNew>
  153. <ClickPrint>
  154. PrintReport();
  155. </ClickPrint>
  156. <ClickModify>
  157. ChangeMode("Modify");
  158. </ClickModify>
  159. <ClickDelete>
  160. Delete(); ChangeMode("Search");
  161. </ClickDelete>
  162. </Events>
  163. </IKFormToolBar>
  164. </Controls>
  165. <LockInfomation LockID="ID_ExpressIncept" LockNO="No_ExpressIncept" LockSearchFunction="SearchExpressInceptWithNo"/>
  166. <LogInfomation LogNO="#ExpressIncept.No_ExpressIncept" RecordFormField="本次运费:#ExpressIncept.Carriage_ExpressIncept" RecordDataGridField=""/>
  167. <ChildForms>
  168. <ChildForm name="BillSearch" DataSource="ExpressIncept" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchExpressInceptWithNo">
  169. <DataColumn Index="0" MappingName="#ExpressIncept.No_ExpressIncept" HeaderText="快递单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  170. <DataColumn Index="1" MappingName="#ExpressIncept.Date_ExpressIncept" HeaderText="收件日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  171. <DataColumn Index="2" MappingName="#ExpressIncept.ShortName_Transporter" HeaderText="快递公司" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  172. <DataColumn Index="3" MappingName="#ExpressIncept.Sender_ExpressIncept" HeaderText="寄件人姓名" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  173. <DataColumn Index="4" MappingName="#ExpressIncept.Name_FromBill" HeaderText="出库参考单据" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  174. <DataColumn Index="5" MappingName="#ExpressIncept.No_FromBill" HeaderText="参考单据单号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  175. <DataColumn Index="6" MappingName="#ExpressIncept.Address_ExpressIncept" HeaderText="寄件人地址" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  176. <DataColumn Index="7" MappingName="#ExpressIncept.Comment_ExpressIncept" HeaderText="备注" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  177. </ChildForm>
  178. <ChildForm name="ModifyDepotBillSearch" DataSource="M" SearchFunction="SearchAllModifyDepotBill" SearchFunctionByNo="">
  179. <DataColumn Index="0" MappingName="#M.No_ModifyDepotBill" HeaderText="库存异动作业单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  180. <DataColumn Index="1" MappingName="#M.Date_ModifyDepotBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  181. </ChildForm>
  182. <ChildForm name="PurchaseInDepotBillSearch" DataSource="PurchaseInDepotBill" SearchFunction="SearchPurchaseInDepotBillBill" SearchFunctionByNo="">
  183. <DataColumn Index="0" MappingName="#PurchaseInDepotBill.No_PurchaseInDepotBill" HeaderText="采购入库单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  184. <DataColumn Index="1" MappingName="#PurchaseInDepotBill.Date_PurchaseInDepotBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  185. </ChildForm>
  186. </ChildForms>
  187. </Client>
  188. <Server>
  189. <Tables>
  190. <Table name="ExpressIncept" Type="Parent">
  191. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 ExpressIncept.*,
  192. Name_BillType AS Name_FromBill,
  193. Transporter.No_Transporter,
  194. Transporter.ShortName_Transporter,
  195. AppUser.LoginName_User AS Name_Creator,
  196. A1.LoginName_User AS LastModUserName_ExpressIncept
  197. FROM ExpressIncept
  198. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  199. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  200. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  201. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept"/>
  202. <New CmdType="Text" CmdText="INSERT INTO ExpressIncept (ID_ExpressIncept, No_ExpressIncept, Date_ExpressIncept, Type_FromBill, No_FromBill, ID_Transporter, Currency_ExpressIncept, Carriage_ExpressIncept, HavePay_ExpressIncept, Sender_ExpressIncept, Address_ExpressIncept, Creator_ExpressIncept, CreateDate_ExpressIncept, Comment_ExpressIncept, LastModDate_ExpressIncept, LastModUser_ExpressIncept)
  203. values(@ID_ExpressIncept, @No_ExpressIncept, @Date_ExpressIncept, @Type_FromBill, @No_FromBill, @ID_Transporter, @Currency_ExpressIncept, @Carriage_ExpressIncept, @HavePay_ExpressIncept, @Sender_ExpressIncept, @Address_ExpressIncept, @Creator_ExpressIncept, @CreateDate_ExpressIncept, @Comment_ExpressIncept, @LastModDate_ExpressIncept, @LastModUser_ExpressIncept)">
  204. <Params>
  205. <Param name="@ID_ExpressIncept" type="ExpressIncept.ID_ExpressIncept" sourceColumn="ID_ExpressIncept"/>
  206. <Param name="@No_ExpressIncept" type="ExpressIncept.No_ExpressIncept" sourceColumn="No_ExpressIncept"/>
  207. <Param name="@Date_ExpressIncept" type="ExpressIncept.Date_ExpressIncept" sourceColumn="Date_ExpressIncept"/>
  208. <Param name="@Type_FromBill" type="ExpressIncept.Type_FromBill" sourceColumn="Type_FromBill"/>
  209. <Param name="@No_FromBill" type="ExpressIncept.No_FromBill" sourceColumn="No_FromBill"/>
  210. <Param name="@ID_Transporter" type="ExpressIncept.ID_Transporter" sourceColumn="ID_Transporter"/>
  211. <Param name="@Currency_ExpressIncept" type="ExpressIncept.Currency_ExpressIncept" sourceColumn="Currency_ExpressIncept"/>
  212. <Param name="@Carriage_ExpressIncept" type="ExpressIncept.Carriage_ExpressIncept" sourceColumn="Carriage_ExpressIncept"/>
  213. <Param name="@HavePay_ExpressIncept" type="ExpressIncept.HavePay_ExpressIncept" sourceColumn="HavePay_ExpressIncept"/>
  214. <Param name="@Sender_ExpressIncept" type="ExpressIncept.Sender_ExpressIncept" sourceColumn="Sender_ExpressIncept"/>
  215. <Param name="@Address_ExpressIncept" type="ExpressIncept.Address_ExpressIncept" sourceColumn="Address_ExpressIncept"/>
  216. <Param name="@Creator_ExpressIncept" type="ExpressIncept.Creator_ExpressIncept" sourceColumn="Creator_ExpressIncept"/>
  217. <Param name="@CreateDate_ExpressIncept" type="ExpressIncept.CreateDate_ExpressIncept" sourceColumn="CreateDate_ExpressIncept"/>
  218. <Param name="@Comment_ExpressIncept" type="ExpressIncept.Comment_ExpressIncept" sourceColumn="Comment_ExpressIncept"/>
  219. <Param name="@LastModDate_ExpressIncept" type="ExpressIncept.LastModDate_ExpressIncept" sourceColumn="LastModDate_ExpressIncept"/>
  220. <Param name="@LastModUser_ExpressIncept" type="ExpressIncept.LastModUser_ExpressIncept" sourceColumn="LastModUser_ExpressIncept"/>
  221. </Params>
  222. </New>
  223. <Update CmdType="Text" CmdText="UPDATE ExpressIncept SET
  224. No_ExpressIncept=@No_ExpressIncept,
  225. Date_ExpressIncept=@Date_ExpressIncept,
  226. Type_FromBill=@Type_FromBill,
  227. No_FromBill=@No_FromBill,
  228. ID_Transporter=@ID_Transporter,
  229. Currency_ExpressIncept=@Currency_ExpressIncept,
  230. Carriage_ExpressIncept=@Carriage_ExpressIncept,
  231. HavePay_ExpressIncept=@HavePay_ExpressIncept,
  232. Sender_ExpressIncept=@Sender_ExpressIncept,
  233. Address_ExpressIncept=@Address_ExpressIncept,
  234. Creator_ExpressIncept=@Creator_ExpressIncept,
  235. CreateDate_ExpressIncept=@CreateDate_ExpressIncept,
  236. Comment_ExpressIncept=@Comment_ExpressIncept,
  237. LastModDate_ExpressIncept=@LastModDate_ExpressIncept,
  238. LastModUser_ExpressIncept=@LastModUser_ExpressIncept
  239. WHERE ID_ExpressIncept=@ID_ExpressIncept">
  240. <Params>
  241. <Param name="@ID_ExpressIncept" type="ExpressIncept.ID_ExpressIncept" sourceColumn="ID_ExpressIncept"/>
  242. <Param name="@No_ExpressIncept" type="ExpressIncept.No_ExpressIncept" sourceColumn="No_ExpressIncept"/>
  243. <Param name="@Date_ExpressIncept" type="ExpressIncept.Date_ExpressIncept" sourceColumn="Date_ExpressIncept"/>
  244. <Param name="@Type_FromBill" type="ExpressIncept.Type_FromBill" sourceColumn="Type_FromBill"/>
  245. <Param name="@No_FromBill" type="ExpressIncept.No_FromBill" sourceColumn="No_FromBill"/>
  246. <Param name="@ID_Transporter" type="ExpressIncept.ID_Transporter" sourceColumn="ID_Transporter"/>
  247. <Param name="@Currency_ExpressIncept" type="ExpressIncept.Currency_ExpressIncept" sourceColumn="Currency_ExpressIncept"/>
  248. <Param name="@Carriage_ExpressIncept" type="ExpressIncept.Carriage_ExpressIncept" sourceColumn="Carriage_ExpressIncept"/>
  249. <Param name="@HavePay_ExpressIncept" type="ExpressIncept.HavePay_ExpressIncept" sourceColumn="HavePay_ExpressIncept"/>
  250. <Param name="@Sender_ExpressIncept" type="ExpressIncept.Sender_ExpressIncept" sourceColumn="Sender_ExpressIncept"/>
  251. <Param name="@Address_ExpressIncept" type="ExpressIncept.Address_ExpressIncept" sourceColumn="Address_ExpressIncept"/>
  252. <Param name="@Creator_ExpressIncept" type="ExpressIncept.Creator_ExpressIncept" sourceColumn="Creator_ExpressIncept"/>
  253. <Param name="@CreateDate_ExpressIncept" type="ExpressIncept.CreateDate_ExpressIncept" sourceColumn="CreateDate_ExpressIncept"/>
  254. <Param name="@Comment_ExpressIncept" type="ExpressIncept.Comment_ExpressIncept" sourceColumn="Comment_ExpressIncept"/>
  255. <Param name="@LastModDate_ExpressIncept" type="ExpressIncept.LastModDate_ExpressIncept" sourceColumn="LastModDate_ExpressIncept"/>
  256. <Param name="@LastModUser_ExpressIncept" type="ExpressIncept.LastModUser_ExpressIncept" sourceColumn="LastModUser_ExpressIncept"/>
  257. </Params>
  258. </Update>
  259. <Delete CmdType="Text" CmdText="DELETE ExpressIncept WHERE ExpressIncept.ID_ExpressIncept = @ID_ExpressIncept">
  260. <Params>
  261. <Param name="@ID_ExpressIncept" type="ExpressIncept.ID_ExpressIncept" sourceColumn="ID_ExpressIncept"/>
  262. </Params>
  263. </Delete>
  264. <FKErrorReport ErrorMessage="本记录被其他单据使用过,不能删除!"/>
  265. <UNIQUEErrorReport ErrorMessage="快递收件单单号已经存在!"/>
  266. </Table>
  267. </Tables>
  268. <Search>
  269. <SearchAllModifyDepotBill CmdType="Text" CmdText=" SELECT M.*,
  270. L.Name_Location AS ChangedDepot_ModifyDepotBill,
  271. L.No_Location AS ChangedDepotNo_ModifyDepotBill,
  272. MD.ModName_ModifyTypeSettings AS ModifyDepotBill_ModifyDepotBill,
  273. E.Name_Employee AS Proposer_ModifyDepotBill,
  274. E.No_Employee AS ProposerNo_ModifyDepotBill,
  275. A.Name_User AS Maker_ModifyDepotBill,
  276. A1.Name_User AS Assessor_ModifyDepotBill,
  277. A2.Name_User AS lastModflyuser_ModifyDepotBill,
  278. convert(decimal(18,2),0.00) AS Sum_ModifyDepotBill,
  279. convert(decimal(18,2),0.00) AS Amount_ModifyDepotBill
  280. FROM ModifyDepotBill M
  281. INNER JOIN LOCATION L ON M.ID_Location = L.ID_Location
  282. LEFT JOIN ModifyTypeSettings MD ON MD.ID_ModifyTypeSettings = M.Style_ModifyDepotBill
  283. INNER JOIN Employee E ON E.ID_Employee = M.ID_Proposer
  284. INNER JOIN AppUser A ON A.ID_User = M.ID_Creator
  285. LEFT JOIN AppUser A1 ON A1.ID_User = M.ID_Assessor
  286. LEFT JOIN AppUser A2 ON A2.ID_User = M.LastModUser_ModifyDepotBill">
  287. <Tables>
  288. <Table name="AllModifyDepotBill" />
  289. </Tables>
  290. </SearchAllModifyDepotBill>
  291. <SearchPurchaseInDepotBillBill CmdType="Text" CmdText=" SELECT PurchaseInDepotBill.* FROM PurchaseInDepotBill">
  292. <Tables>
  293. <Table name="AllPurchaseInDepotBill" />
  294. </Tables>
  295. </SearchPurchaseInDepotBillBill>
  296. <SearchAllBill CmdType="Text" CmdText=" SELECT ExpressIncept.*,
  297. Name_BillType AS Name_FromBill,
  298. Transporter.No_Transporter,
  299. Transporter.ShortName_Transporter,
  300. AppUser.LoginName_User AS Name_Creator,
  301. A1.LoginName_User AS LastModUserName_ExpressIncept
  302. FROM ExpressIncept
  303. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  304. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  305. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  306. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept">
  307. <Tables>
  308. <Table name="AllBill" />
  309. </Tables>
  310. </SearchAllBill>
  311. <SearchExpressInceptWithNo CmdType="Text" CmdText=" SELECT ExpressIncept.*,
  312. Name_BillType AS Name_FromBill,
  313. Transporter.No_Transporter,
  314. Transporter.ShortName_Transporter,
  315. AppUser.LoginName_User AS Name_Creator,
  316. A1.LoginName_User AS LastModUserName_ExpressIncept
  317. FROM ExpressIncept
  318. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  319. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  320. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  321. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept
  322. WHERE No_ExpressIncept=@No_ExpressIncept">
  323. <Params>
  324. <Param name="@No_ExpressIncept" type="ExpressIncept.No_ExpressIncept" sourceColumn="No_ExpressIncept"/>
  325. </Params>
  326. <Tables>
  327. <Table name="ExpressIncept"/>
  328. </Tables>
  329. </SearchExpressInceptWithNo>
  330. <SearchExpressInceptFirst CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64) DECLARE @ID_ExpressIncept uniqueidentifier
  331. SELECT TOP 1 @NextNo = ExpressIncept.No_ExpressIncept FROM ExpressIncept
  332. ORDER BY ExpressIncept.No_ExpressIncept
  333. SELECT @ID_ExpressIncept = ExpressIncept.ID_ExpressIncept FROM ExpressIncept WHERE ExpressIncept.No_ExpressIncept = @NextNo
  334. SELECT ExpressIncept.*,
  335. Name_BillType AS Name_FromBill,
  336. Transporter.No_Transporter,
  337. Transporter.ShortName_Transporter,
  338. AppUser.LoginName_User AS Name_Creator,
  339. A1.LoginName_User AS LastModUserName_ExpressIncept
  340. FROM ExpressIncept
  341. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  342. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  343. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  344. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept
  345. WHERE ID_ExpressIncept=@ID_ExpressIncept">
  346. <Tables>
  347. <Table name="ExpressIncept"/>
  348. </Tables>
  349. </SearchExpressInceptFirst>
  350. <SearchExpressInceptLast CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64) DECLARE @ID_ExpressIncept uniqueidentifier
  351. SELECT TOP 1 @NextNo = ExpressIncept.No_ExpressIncept FROM ExpressIncept
  352. ORDER BY ExpressIncept.No_ExpressIncept DESC
  353. SELECT @ID_ExpressIncept = ExpressIncept.ID_ExpressIncept FROM ExpressIncept WHERE ExpressIncept.No_ExpressIncept = @NextNo
  354. SELECT ExpressIncept.*,
  355. Name_BillType AS Name_FromBill,
  356. Transporter.No_Transporter,
  357. Transporter.ShortName_Transporter,
  358. AppUser.LoginName_User AS Name_Creator,
  359. A1.LoginName_User AS LastModUserName_ExpressIncept
  360. FROM ExpressIncept
  361. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  362. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  363. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  364. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept
  365. WHERE ID_ExpressIncept=@ID_ExpressIncept">
  366. <Tables>
  367. <Table name="ExpressIncept"/>
  368. </Tables>
  369. </SearchExpressInceptLast>
  370. <SearchExpressInceptPrevious CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64) DECLARE @ID_ExpressIncept uniqueidentifier
  371. SET @NextNo = @No_ExpressIncept
  372. SELECT TOP 1 @NextNo = ExpressIncept.No_ExpressIncept FROM ExpressIncept
  373. WHERE ExpressIncept.No_ExpressIncept &lt; @No_ExpressIncept ORDER BY ExpressIncept.No_ExpressIncept DESC
  374. SELECT @ID_ExpressIncept = ExpressIncept.ID_ExpressIncept FROM ExpressIncept WHERE ExpressIncept.No_ExpressIncept = @NextNo
  375. SELECT ExpressIncept.*,
  376. Name_BillType AS Name_FromBill,
  377. Transporter.No_Transporter,
  378. Transporter.ShortName_Transporter,
  379. AppUser.LoginName_User AS Name_Creator,
  380. A1.LoginName_User AS LastModUserName_ExpressIncept
  381. FROM ExpressIncept
  382. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  383. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  384. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  385. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept
  386. WHERE ID_ExpressIncept=@ID_ExpressIncept">
  387. <Params>
  388. <Param name="@No_ExpressIncept" type="ExpressIncept.No_ExpressIncept" sourceColumn="No_ExpressIncept"/>
  389. </Params>
  390. <Tables>
  391. <Table name="ExpressIncept"/>
  392. </Tables>
  393. </SearchExpressInceptPrevious>
  394. <SearchExpressInceptNext CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64) DECLARE @ID_ExpressIncept uniqueidentifier
  395. SET @NextNo = @No_ExpressIncept
  396. SELECT TOP 1 @NextNo = ExpressIncept.No_ExpressIncept FROM ExpressIncept
  397. WHERE ExpressIncept.No_ExpressIncept &gt; @No_ExpressIncept ORDER BY ExpressIncept.No_ExpressIncept
  398. SELECT @ID_ExpressIncept = ExpressIncept.ID_ExpressIncept FROM ExpressIncept WHERE ExpressIncept.No_ExpressIncept = @NextNo
  399. SELECT ExpressIncept.*,
  400. Name_BillType AS Name_FromBill,
  401. Transporter.No_Transporter,
  402. Transporter.ShortName_Transporter,
  403. AppUser.LoginName_User AS Name_Creator,
  404. A1.LoginName_User AS LastModUserName_ExpressIncept
  405. FROM ExpressIncept
  406. JOIN BillType ON ExpressIncept.Type_FromBill=BillType.Value_BillType
  407. JOIN Transporter ON ExpressIncept.ID_Transporter=Transporter.ID_Transporter
  408. JOIN AppUser ON AppUser.ID_User = ExpressIncept.Creator_ExpressIncept
  409. LEFT JOIN AppUser A1 ON A1.ID_User = ExpressIncept.LastModUser_ExpressIncept
  410. WHERE ID_ExpressIncept=@ID_ExpressIncept">
  411. <Params>
  412. <Param name="@No_ExpressIncept" type="ExpressIncept.No_ExpressIncept" sourceColumn="No_ExpressIncept"/>
  413. </Params>
  414. <Tables>
  415. <Table name="ExpressIncept"/>
  416. </Tables>
  417. </SearchExpressInceptNext>
  418. <SearchBillType CmdType="Text" CmdText=" Create Table FromBillType
  419. (
  420. Name_Bill nvarchar(64)
  421. )
  422. insert into FromBillType values ('库存异动作业')
  423. insert into FromBillType values ('采购入库单')
  424. select * from FromBillType
  425. drop table FromBillType">
  426. <Tables>
  427. <Table name="FromBillType"/>
  428. </Tables>
  429. </SearchBillType>
  430. <SearchModifyDepotBillWithNo CmdType="Text" CmdText=" SELECT ID_ModifyDepotBill FROM ModifyDepotBill
  431. WHERE No_ModifyDepotBill=@No_ModifyDepotBill">
  432. <Params>
  433. <Param name="@No_ModifyDepotBill" type="ModifyDepotBill.No_ModifyDepotBill" sourceColumn="No_ModifyDepotBill"/>
  434. </Params>
  435. <Tables>
  436. <Table name="ModifyDepotBill"/>
  437. </Tables>
  438. </SearchModifyDepotBillWithNo>
  439. <SearchPurchaseInDepotBillWithNo CmdType="Text" CmdText=" SELECT ID_PurchaseInDepotBill FROM PurchaseInDepotBill
  440. WHERE No_PurchaseInDepotBill=@No_PurchaseInDepotBill">
  441. <Params>
  442. <Param name="@No_PurchaseInDepotBill" type="PurchaseInDepotBill.No_PurchaseInDepotBill" sourceColumn="No_PurchaseInDepotBill"/>
  443. </Params>
  444. <Tables>
  445. <Table name="PurchaseInDepotBill"/>
  446. </Tables>
  447. </SearchPurchaseInDepotBillWithNo>
  448. <SearchTransporter CmdType="Text" CmdText="SELECT ID_Transporter, No_Transporter, ShortName_Transporter FROM Transporter">
  449. <Tables>
  450. <Table name="Transporter"/>
  451. </Tables>
  452. </SearchTransporter>
  453. <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
  454. <Tables>
  455. <Table name="SystemSetting"/>
  456. </Tables>
  457. </SearchSystemSetting>
  458. </Search>
  459. </Server>
  460. <Lables>
  461. <Search>
  462. Empty();
  463. NewInstance();
  464. dtDate.Enabled=false;
  465. tbNo.ReadOnly=false;
  466. cbBillType.Enabled=false;
  467. tbFromBill.ReadOnly=true;
  468. cbDept.Enabled=false;
  469. cbCarriage.Enabled=false;
  470. ntbMoney.Enabled=false;
  471. ckHavePay.Enabled=false;
  472. txtName.ReadOnly=true;
  473. txtAddr.ReadOnly=true;
  474. txtComment.ReadOnly=true;
  475. toolBar.EnableSubmit=false;
  476. toolBar.EnableModify=false;
  477. toolBar.EnableDelete=false;
  478. toolBar.EnableNew=GetRight(@Title,"新增");
  479. toolBar.EnablePrint=false;
  480. #ExpressIncept.Creator_ExpressIncept=DBNull();
  481. #ExpressIncept.CreateDate_ExpressIncept=DBNull();
  482. #ExpressIncept.LastModUser_ExpressIncept=DBNull();
  483. #ExpressIncept.LastModDate_ExpressIncept=DBNull();
  484. UpdateForm(true, "");
  485. tbNo.Focus();
  486. @Status=0;
  487. </Search>
  488. <New>
  489. Empty();
  490. NewInstance();
  491. dtDate.Enabled=true;
  492. tbNo.ReadOnly=false;
  493. cbBillType.Enabled=true;
  494. tbFromBill.ReadOnly=false;
  495. cbDept.Enabled=true;
  496. cbCarriage.Enabled=false;
  497. ntbMoney.Enabled=true;
  498. ckHavePay.Enabled=true;
  499. txtName.ReadOnly=false;
  500. txtAddr.ReadOnly=false;
  501. txtComment.ReadOnly=false;
  502. toolBar.EnableSubmit=GetRight(@Title,"新增");
  503. toolBar.EnableModify=false;
  504. toolBar.EnableDelete=false;
  505. toolBar.EnableNew=false;
  506. toolBar.EnablePrint=false;
  507. #ExpressIncept.ID_ExpressIncept=NewGuid();
  508. #ExpressIncept.Carriage_ExpressIncept=0;
  509. #ExpressIncept.Sender_ExpressIncept=DBNull();
  510. #ExpressIncept.Address_ExpressIncept=DBNull();
  511. #ExpressIncept.ID_Transporter=DBNull();
  512. #ExpressIncept.Creator_ExpressIncept=GetLoginUserID();
  513. #ExpressIncept.Name_Creator=GetCurrentUser();
  514. #ExpressIncept.CreateDate_ExpressIncept=GetCurrentTime();
  515. #ExpressIncept.LastModUser_ExpressIncept=DBNull();
  516. #ExpressIncept.LastModDate_ExpressIncept=DBNull();
  517. #ExpressIncept.Currency_ExpressIncept=@SysCurrency;
  518. #ExpressIncept.Name_FromBill="库存异动作业";
  519. UpdateForm(true, "");
  520. @Status=1;
  521. </New>
  522. <View>
  523. dtDate.Enabled=false;
  524. tbNo.ReadOnly=false;
  525. cbBillType.Enabled=false;
  526. tbFromBill.ReadOnly=true;
  527. cbDept.Enabled=false;
  528. cbCarriage.Enabled=false;
  529. ntbMoney.Enabled=false;
  530. ckHavePay.Enabled=false;
  531. txtName.ReadOnly=true;
  532. txtAddr.ReadOnly=true;
  533. txtComment.ReadOnly=true;
  534. toolBar.EnableSubmit=false;
  535. toolBar.EnableNew=GetRight(@Title,"新增");
  536. toolBar.EnableModify=GetRight(@Title,"修改");
  537. toolBar.EnableDelete=GetRight(@Title,"删除");
  538. toolBar.EnablePrint=GetRight(@Title,"打印");
  539. UpdateForm(true, "");
  540. @Status=2;
  541. </View>
  542. <Modify>
  543. dtDate.Enabled=false;
  544. tbNo.ReadOnly=true;
  545. cbBillType.Enabled=false;
  546. tbFromBill.ReadOnly=true;
  547. cbDept.Enabled=true;
  548. cbCarriage.Enabled=false;
  549. ntbMoney.Enabled=true;
  550. ckHavePay.Enabled=true;
  551. txtName.ReadOnly=false;
  552. txtAddr.ReadOnly=false;
  553. txtComment.ReadOnly=false;
  554. toolBar.EnableSubmit=GetRight(@Title,"修改");
  555. toolBar.EnableModify=false;
  556. toolBar.EnableDelete=GetRight(@Title,"删除");
  557. toolBar.EnableNew=GetRight(@Title,"新增");
  558. toolBar.EnablePrint=false;
  559. #ExpressIncept.LastModUser_ExpressIncept=GetLoginUserID();
  560. #ExpressIncept.LastModUserName_ExpressIncept=GetCurrentUser();
  561. #ExpressIncept.LastModDate_ExpressIncept=DateTimeNow();
  562. UpdateForm(true, "");
  563. @Status=3;
  564. </Modify>
  565. <SubmitButtonClick><![CDATA[
  566. if(tbNo.ReadOnly == false)
  567. {
  568. if(tbNo.CValue != StringEmpty())
  569. {
  570. if(Search("SearchExpressInceptWithNo", tbNo.CValue))
  571. {
  572. MessageBox("该快递单已存在!",@Title);
  573. tbNo.Focus();
  574. return;
  575. }
  576. }
  577. else
  578. {
  579. MessageBox("请输入快递单号!",@Title);
  580. tbNo.Focus();
  581. return;
  582. }
  583. }
  584. if(tbFromBill.ReadOnly == false)
  585. {
  586. if(tbFromBill.CValue != StringEmpty())
  587. {
  588. if(cbBillType.SelectedName == "库存异动作业" && Search("SearchModifyDepotBillWithNo", tbFromBill.CValue))
  589. {
  590. #ExpressIncept.Type_FromBill=3;
  591. }
  592. else if(cbBillType.SelectedName == "采购入库单" && Search("SearchPurchaseInDepotBillWithNo", tbFromBill.CValue))
  593. {
  594. #ExpressIncept.Type_FromBill=1;
  595. }
  596. else
  597. {
  598. MessageBox("该入库单不存在!",@Title);
  599. tbFromBill.Focus();
  600. return;
  601. }
  602. }
  603. else
  604. {
  605. MessageBox("请输入入库单号!",@Title);
  606. tbFromBill.Focus();
  607. return;
  608. }
  609. }
  610. if(!cbDept.CheckSelectedItem())
  611. {
  612. MessageBox("请选择有效的快递公司!",@Title);
  613. cbDept.Focus();
  614. return;
  615. }
  616. UpdateForm(false, "");
  617. if(@Status==1)
  618. {
  619. dttMakerDate.CValue=#ExpressIncept.CreateDate_ExpressIncept=DateTimeNow();
  620. New();
  621. }
  622. else if(@Status==3)
  623. {
  624. dttlastmoddate.CValue=#ExpressIncept.LastModDate_ExpressIncept=DateTimeNow();
  625. Update();
  626. }
  627. ChangeMode("View");
  628. ]]></SubmitButtonClick>
  629. </Lables>
  630. </Form>
  631. </Forms>