FrmIndentBillOnNet.xml1 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmIndentBillOnNet">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="网上订单";
  9. GetSchema();
  10. ChangeMode("Search");
  11. ]]>
  12. </Load>
  13. <Closing>
  14. ;
  15. </Closing>
  16. <Closed>
  17. ;
  18. </Closed>
  19. </Events>
  20. <Mode>
  21. <Search>
  22. <Lable name="Search" />
  23. </Search>
  24. <View>
  25. <Lable name="View" />
  26. </View>
  27. <Modify>
  28. <Lable name="Modify" />
  29. </Modify>
  30. </Mode>
  31. <Controls>
  32. <IKDateTimePicker name="dtpDate" DataSource="IndentBillOnNet.Date_IndentBillOnNet"></IKDateTimePicker>
  33. <IKTextButton name="tbNo" DataSource="IndentBillOnNet.No_IndentBillOnNet">
  34. <Events>
  35. <Enter>
  36. <![CDATA[
  37. if(tbNo.ReadOnly == false)
  38. {
  39. if(tbNo.CValue != StringEmpty())
  40. {
  41. if(Search("SearchIndentBillOnNetWithNo", tbNo.CValue))
  42. {
  43. if(GetRight("客户基本资料","全权查看")||Equals(GetLoginUserID(),#IndentBillOnNet.CustomerCreator))
  44. ChangeMode("View");
  45. else
  46. {
  47. @EnterNo=tbNo.CValue;
  48. ChangeMode("Search");
  49. tbNo.CValue=@EnterNo;
  50. MessageBox("你没有查看该单据资料的权限!",@Title);
  51. return;
  52. }
  53. }
  54. else
  55. {
  56. MessageBox("该网上订单不存在!",@Title);
  57. }
  58. }
  59. else
  60. {
  61. MessageBox("请输入网上订单号!",@Title);
  62. }
  63. }
  64. ]]>
  65. </Enter>
  66. <Click>
  67. ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
  68. </Click>
  69. </Events>
  70. </IKTextButton>
  71. <IKButton name="btnDelete">
  72. <Events>
  73. <Click>
  74. BeginUnAudit();
  75. #IndentBillOnNet.ID_Assessor = DBNull();
  76. #IndentBillOnNet.Name_Assessor = "";
  77. #IndentBillOnNet.Disable_IndentBillOnNet = true;
  78. #IndentBillOnNet.DeleteUser_IndentBillOnNet = GetLoginUserID();
  79. #IndentBillOnNet.DeleteUserName = GetCurrentUser();
  80. #IndentBillOnNet.DeleteDate_IndentBillOnNet = DateTimeNow();
  81. UnAudit();
  82. ChangeMode("View");
  83. EndUnAudit();
  84. </Click>
  85. </Events>
  86. </IKButton>
  87. <IKTextButton name="tbCustomerNo" DataSource="IndentBillOnNet.No_Customer"></IKTextButton>
  88. <IKTextBox name="txtCustomerShortName" DataSource="IndentBillOnNet.ShortName_Customer"></IKTextBox>
  89. <IKTextBox name="txtComment" DataSource="IndentBillOnNet.Comment_IndentBillOnNet"></IKTextBox>
  90. <IKTextBox name="txtAudi" DataSource="IndentBillOnNet.Name_Assessor"></IKTextBox>
  91. <IKDateTimeText name="dtAssessDate" DataSource="IndentBillOnNet.AssessDate_IndentBillOnNet"></IKDateTimeText>
  92. <IKTextBox name="cbLinkman" DataSource="IndentBillOnNet.Name_Linkman" ></IKTextBox>
  93. <IKTextBox name="cbTele" DataSource="IndentBillOnNet.Tel_IndentBillOnNet" ></IKTextBox>
  94. <IKTextBox name="cbFax" DataSource="IndentBillOnNet.Fax_IndentBillOnNet" ></IKTextBox>
  95. <IKTextBox name="txtPostalcode" DataSource="IndentBillOnNet.Postcode_IndentBillOnNet"></IKTextBox>
  96. <IKTextBox name="txtSendAddr" DataSource="IndentBillOnNet.SendAddr_IndentBillOnNet"></IKTextBox>
  97. <IKTextBox name="cbInvoiceTitle" DataSource="IndentBillOnNet.InvoiceTitle_Company"></IKTextBox>
  98. <IKTextBox name="txtAdress" DataSource="IndentBillOnNet.InvoiceAddress_Company"></IKTextBox>
  99. <IKNumericTextBox name="ntbTaxSum" DataSource="IndentBillOnNet.TaxAmount_IndentBillOnNet"></IKNumericTextBox>
  100. <IKNumericTextBox name="ntbMoneySum" DataSource="IndentBillOnNet.GoodsAmount_IndentBillOnNet"></IKNumericTextBox>
  101. <IKNumericTextBox name="ntbSum" DataSource="IndentBillOnNet.Amount_IndentBillOnNet"></IKNumericTextBox>
  102. <!--以下新增-->
  103. <IKTextBox name="cbIndentor" DataSource="IndentBillOnNet.Name_CustomerAccount"></IKTextBox>
  104. <IKTextBox name="txtLastModUser" DataSource="IndentBillOnNet.LastModUserName"></IKTextBox>
  105. <IKDateTimeText name="dtLastModDate" DataSource="IndentBillOnNet.LastModDate_IndentBillOnNet"></IKDateTimeText>
  106. <IKTextBox name="txtDeleteUser" DataSource="IndentBillOnNet.DeleteUserName"></IKTextBox>
  107. <IKDateTimeText name="dtDeleteDate" DataSource="IndentBillOnNet.DeleteDate_IndentBillOnNet"></IKDateTimeText>
  108. <IKTextBox name="txtBillComment" DataSource="IndentBillOnNet.FeedbackComment_IndentBillOnNet"></IKTextBox>
  109. <!--结束-->
  110. <IKDataGridEx name="dgProduct" DataSource="IndentBillOnNetProduct" TableStyleIndex="0">
  111. <DataColumn Index="0" DataSource="IndentBillOnNetProduct.No_IndentBillOnNetProduct" />
  112. <DataColumn Index="1" DataSource="IndentBillOnNetProduct.No_Product" />
  113. <DataColumn Index="2" DataSource="IndentBillOnNetProduct.Name_Product" />
  114. <DataColumn Index="3" DataSource="IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct" />
  115. <DataColumn Index="4" DataSource="IndentBillOnNetProduct.Unit_Product" />
  116. <DataColumn Index="5" DataSource="IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct"/>
  117. <DataColumn Index="6" DataSource="IndentBillOnNetProduct.Amount_IndentBillOnNetProduct" />
  118. <DataColumn Index="7" DataSource="IndentBillOnNetProduct.AvailableQty_ProductStocks" />
  119. <DataColumn Index="8" DataSource="IndentBillOnNetProduct.Comment_IndentBillOnNetProduct" />
  120. </IKDataGridEx>
  121. <IKButton name="btnDelelte">
  122. <Events>
  123. <Click>
  124. BeginUnAudit();
  125. #IndentBillOnNet.Disable_IndentBillOnNet=true;
  126. #IndentBillOnNet.DeleteUser_IndentBillOnNet = GetLoginUserID();
  127. #IndentBillOnNet.DeleteUserName = GetCurrentUser();
  128. #IndentBillOnNet.DeleteDate_IndentBillOnNet = DateTimeNow();
  129. UnAudit();
  130. ChangeMode("View");
  131. EndUnAudit();
  132. </Click>
  133. </Events>
  134. </IKButton>
  135. <IKFormToolBar name="toolBar">
  136. <Events>
  137. <ClickFirst>
  138. if (Search("SearchIndentBillOnNetFirst",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  139. {
  140. ChangeMode("View");
  141. }
  142. </ClickFirst>
  143. <ClickPrev>
  144. if (Search("SearchIndentBillOnNetPrevious", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  145. {
  146. ChangeMode("View");
  147. }
  148. </ClickPrev>
  149. <ClickNext>
  150. if (Search("SearchIndentBillOnNetNext", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  151. {
  152. ChangeMode("View");
  153. }
  154. </ClickNext>
  155. <ClickLast>
  156. if (Search("SearchIndentBillOnNetLast",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
  157. {
  158. ChangeMode("View");
  159. }
  160. </ClickLast>
  161. <ClickEmpty>
  162. ChangeMode("Search");
  163. </ClickEmpty>
  164. <ClickPrint>
  165. ShowPrintBox("BillSearch",#IndentBillOnNet.No_IndentBillOnNet,#IndentBillOnNet.No_IndentBillOnNet);
  166. </ClickPrint>
  167. <ClickAudit>
  168. <Lable name = "AuditLable"/>
  169. </ClickAudit>
  170. <ClickUnAudit>
  171. BeginUnAudit();
  172. UnAudit();
  173. ChangeMode("View");
  174. EndUnAudit();
  175. </ClickUnAudit>
  176. <ClickImport>
  177. ;
  178. </ClickImport>
  179. <ClickExport>
  180. ;
  181. </ClickExport>
  182. <ClickClose>
  183. ;
  184. </ClickClose>
  185. <ClickExpand>
  186. </ClickExpand>
  187. <ClickExportItem>
  188. <![CDATA[
  189. if (toolBar.MenuItemText == "销货单")
  190. {
  191. ExportBillProductStart("#SaleBillProduct.Type_FromBill",25,"#SaleBillProduct.Name_BillType","网上订单","#SaleBillProduct.No_FromBill",#IndentBillOnNet.No_IndentBillOnNet,"#SaleBill.No_Customer",#IndentBillOnNet.No_Customer,"#SaleBill.TaxCurrency_SaleBill",#IndentBillOnNet.TaxCurrency_IndentBillOnNet);
  192. ExportBillProduct("dgProduct","#IndentBillOnNetProduct","#SaleBillProduct.No_FromBillProduct","#IndentBillOnNetProduct.No_IndentBillOnNetProduct","#SaleBillProduct.No_Product","#IndentBillOnNetProduct.No_Product","#SaleBillProduct.Quantity_SaleBillProduct","#IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct");
  193. }
  194. if (toolBar.MenuItemText == "订货单")
  195. {
  196. ExportBillProductStart("#IndentBill.No_Customer",#IndentBillOnNet.No_Customer);
  197. ExportBillProduct("dgProduct","#IndentBillOnNetProduct","#IndentBillProduct.No_Product","#IndentBillOnNetProduct.No_Product","#IndentBillProduct.Quantity_IndentBillProduct","#IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct");
  198. }
  199. ]]>
  200. </ClickExportItem>
  201. <ClickModify>
  202. ChangeMode("Modify");
  203. </ClickModify>
  204. <ClickSubmit>
  205. <Lable name="SubmitButtonClick" />
  206. </ClickSubmit>
  207. </Events>
  208. </IKFormToolBar>
  209. </Controls>
  210. <LockInfomation LockID="ID_IndentBillOnNet" LockNO="No_IndentBillOnNet" LockSearchFunction="SearchIndentBillOnNetWithNo" LockAudit="ID_Assessor"/>
  211. <LogInfomation LogNO="#IndentBillOnNet.No_IndentBillOnNet" RecordFormField="" RecordDataGridField="#IndentBillOnNetProduct.No_Product,#IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct,#IndentBillOnNetProduct.Amount_IndentBillOnNetProduct"/>
  212. <ChildForms>
  213. <ChildForm name="BillSearch" DataSource="IndentBillOnNet" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="SearchIndentBillOnNetWithNo">
  214. <DataColumn Index="0" MappingName="#IndentBillOnNet.No_IndentBillOnNet" HeaderText="网上订单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  215. <DataColumn Index="1" MappingName="#IndentBillOnNet.Date_IndentBillOnNet" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  216. <DataColumn Index="2" MappingName="#IndentBillOnNet.No_Customer" HeaderText="客户编号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  217. <DataColumn Index="3" MappingName="#IndentBillOnNet.ShortName_Customer" HeaderText="客户名称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  218. <DataColumn Index="4" MappingName="#IndentBillOnNet.TaxCurrency_IndentBillOnNet" HeaderText="税别" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  219. <DataColumn Index="5" MappingName="#IndentBillOnNet.Name_Linkman" HeaderText="联系人" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  220. <DataColumn Index="6" MappingName="#IndentBillOnNet.Tel_IndentBillOnNet" HeaderText="电话" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  221. <DataColumn Index="7" MappingName="#IndentBillOnNet.Fax_IndentBillOnNet" HeaderText="传真" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  222. </ChildForm>
  223. </ChildForms>
  224. <FormatString>
  225. <Format name="SearchCustomerCondition">
  226. if(GetRight("客户基本资料","全权查看"))
  227. {
  228. FormatString("");
  229. }
  230. else
  231. {
  232. FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
  233. }
  234. </Format>
  235. <Format name="SearchBillCondition">
  236. if(GetRight("客户基本资料","全权查看"))
  237. {
  238. FormatString("");
  239. }
  240. else
  241. {
  242. FormatString(" Disable_IndentBillOnNet = 0 and Customer.ID_Creator='{0}' ",GetLoginUserID());
  243. }
  244. </Format>
  245. </FormatString>
  246. </Client>
  247. <Server>
  248. <Tables>
  249. <Table name="IndentBillOnNet" Type="Parent">
  250. <GetSchema CmdType="Text" CmdText=" SELECT Top 0 IndentBillOnNet.*
  251. ,Customer.No_Customer
  252. ,Customer.Name_Customer
  253. ,Customer.ShortName_Customer
  254. ,Customer.Type_Customer
  255. ,Customer.LastDiscount_Customer
  256. ,Customer.PostalCode_Customer
  257. ,ISNULL(b.Name_User, '') AS Name_Assessor
  258. ,Customer.ID_Creator As CustomerCreator
  259. ,c.Name_User AS LastModUserName
  260. ,d.Name_User AS DeleteUserName
  261. FROM IndentBillOnNet
  262. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  263. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  264. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  265. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  266. " />
  267. <Update CmdType="Text" CmdText="Update IndentBillOnNet Set FeedbackComment_IndentBillOnNet = @FeedbackComment_IndentBillOnNet
  268. ,LastModUser_IndentBillOnNet = @LastModUser_IndentBillOnNet
  269. ,LastModDate_IndentBillOnNet = @LastModDate_IndentBillOnNet
  270. Where ID_IndentBillOnNet = @ID_IndentBillOnNet
  271. ">
  272. <Params>
  273. <Param name="@ID_IndentBillOnNet" type="IndentBillOnNet.ID_IndentBillOnNet" sourceColumn="ID_IndentBillOnNet" />
  274. <Param name="@FeedbackComment_IndentBillOnNet" type="IndentBillOnNet.FeedbackComment_IndentBillOnNet" sourceColumn="FeedbackComment_IndentBillOnNet" />
  275. <Param name="@LastModUser_IndentBillOnNet" type="IndentBillOnNet.LastModUser_IndentBillOnNet" sourceColumn="LastModUser_IndentBillOnNet" />
  276. <Param name="@LastModDate_IndentBillOnNet" type="IndentBillOnNet.LastModDate_IndentBillOnNet" sourceColumn="LastModDate_IndentBillOnNet" />
  277. </Params>
  278. </Update>
  279. <Audit CmdType="Text" CmdText=" UPDATE IndentBillOnNet SET ID_Assessor = @ID_Assessor
  280. ,AssessDate_IndentBillOnNet = @AssessDate_IndentBillOnNet
  281. ,Disable_IndentBillOnNet=@Disable_IndentBillOnNet
  282. ,DeleteUser_IndentBillOnNet = @DeleteUser_IndentBillOnNet
  283. ,DeleteDate_IndentBillOnNet = @DeleteDate_IndentBillOnNet
  284. WHERE ID_IndentBillOnNet = @ID_IndentBillOnNet
  285. ">
  286. <Params>
  287. <Param name="@ID_IndentBillOnNet" type="IndentBillOnNet.ID_IndentBillOnNet" sourceColumn="ID_IndentBillOnNet" />
  288. <Param name="@ID_Assessor" type="IndentBillOnNet.ID_Assessor" sourceColumn="ID_Assessor" />
  289. <Param name="@AssessDate_IndentBillOnNet" type="IndentBillOnNet.AssessDate_IndentBillOnNet" sourceColumn="AssessDate_IndentBillOnNet" />
  290. <Param name="@Disable_IndentBillOnNet" type="IndentBillOnNet.Disable_IndentBillOnNet" sourceColumn="Disable_IndentBillOnNet" />
  291. <Param name="@DeleteUser_IndentBillOnNet" type="IndentBillOnNet.DeleteUser_IndentBillOnNet" sourceColumn="DeleteUser_IndentBillOnNet" />
  292. <Param name="@DeleteDate_IndentBillOnNet" type="IndentBillOnNet.DeleteDate_IndentBillOnNet" sourceColumn="DeleteDate_IndentBillOnNet" />
  293. </Params>
  294. </Audit>
  295. <FKErrorReport ErrorMessage="该单据已被其他单据引用,删除失败!" />
  296. <UNIQUEErrorReport ErrorMessage="该网上订单号已存在,提交失败!" />
  297. </Table>
  298. <Table name="IndentBillOnNetProduct" Type="Child">
  299. <GetSchema CmdType="Text" CmdText=" SELECT Top 0 IndentBillOnNetProduct.*
  300. ,Product.No_Product
  301. ,Product.Name_Product
  302. ,Product.Unit_Product,AvailableQty_ProductStocks
  303. ,(IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct
  304. ,Price_Product
  305. FROM IndentBillOnNetProduct
  306. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  307. " />
  308. <Update CmdType="Text" CmdText=" Update IndentBillOnNetProduct Set Comment_IndentBillOnNetProduct = @Comment_IndentBillOnNetProduct
  309. Where ID_IndentBillOnNetProduct = @ID_IndentBillOnNetProduct
  310. ">
  311. <Params>
  312. <Param name="@ID_IndentBillOnNetProduct" type="IndentBillOnNetProduct.ID_IndentBillOnNetProduct" sourceColumn="ID_IndentBillOnNetProduct" />
  313. <Param name="@Comment_IndentBillOnNetProduct" type="IndentBillOnNetProduct.Comment_IndentBillOnNetProduct" sourceColumn="Comment_IndentBillOnNetProduct" />
  314. </Params>
  315. </Update>
  316. </Table>
  317. </Tables>
  318. <Search>
  319. <SearchAllBill CmdType="Text" CmdText=" SELECT IndentBillOnNet.*
  320. ,Customer.No_Customer
  321. ,Customer.Name_Customer
  322. ,Customer.ShortName_Customer
  323. ,Customer.Type_Customer
  324. ,Customer.LastDiscount_Customer
  325. ,Customer.PostalCode_Customer
  326. ,ISNULL(b.Name_User, '') AS Name_Assessor
  327. ,Customer.ID_Creator As CustomerCreator
  328. FROM IndentBillOnNet
  329. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  330. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  331. ">
  332. <Tables>
  333. <Table name="AllBill" />
  334. </Tables>
  335. </SearchAllBill>
  336. <SearchIndentBillOnNetWithNo CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  337. SELECT IndentBillOnNet.*
  338. ,Customer.No_Customer
  339. ,Customer.Name_Customer
  340. ,Customer.ShortName_Customer
  341. ,Customer.Type_Customer
  342. ,Customer.LastDiscount_Customer
  343. ,Customer.PostalCode_Customer
  344. ,ISNULL(b.Name_User, '') AS Name_Assessor
  345. ,Customer.ID_Creator As CustomerCreator
  346. ,c.Name_User AS LastModUserName
  347. ,d.Name_User AS DeleteUserName
  348. FROM IndentBillOnNet
  349. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  350. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  351. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  352. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  353. WHERE IndentBillOnNet.No_IndentBillOnNet = @No_IndentBillOnNet
  354. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet
  355. FROM IndentBillOnNet
  356. WHERE IndentBillOnNet.No_IndentBillOnNet = @No_IndentBillOnNet
  357. SELECT IndentBillOnNetProduct.*
  358. ,Product.No_Product
  359. ,Product.Name_Product
  360. ,Product.Unit_Product
  361. ,A.AvailableQty_ProductStocks
  362. ,(IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct
  363. ,Price_Product
  364. FROM IndentBillOnNetProduct
  365. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  366. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  367. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  368. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet
  369. ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)
  370. ">
  371. <Params>
  372. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  373. </Params>
  374. <Tables>
  375. <Table name="IndentBillOnNet" />
  376. <Table name="IndentBillOnNetProduct" />
  377. </Tables>
  378. </SearchIndentBillOnNetWithNo>
  379. <SearchIndentBillOnNetFirst CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  380. DECLARE @IndentBillOnNetNo nvarchar(64)
  381. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  382. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  383. WHERE Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  384. ORDER BY IndentBillOnNet.No_IndentBillOnNet
  385. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  386. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  387. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  388. FROM IndentBillOnNet
  389. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  390. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  391. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  392. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  393. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  394. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  395. SELECT IndentBillOnNetProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  396. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  397. FROM IndentBillOnNetProduct
  398. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  399. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  400. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  401. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  402. <Params>
  403. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="0" />
  404. </Params>
  405. <Tables>
  406. <Table name="IndentBillOnNet" />
  407. <Table name="IndentBillOnNetProduct" />
  408. </Tables>
  409. </SearchIndentBillOnNetFirst>
  410. <SearchIndentBillOnNetPrevious CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  411. DECLARE @IndentBillOnNetNo nvarchar(64)
  412. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  413. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  414. WHERE IndentBillOnNet.No_IndentBillOnNet &lt; @No_IndentBillOnNet
  415. And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  416. ORDER BY IndentBillOnNet.No_IndentBillOnNet desc
  417. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  418. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  419. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  420. FROM IndentBillOnNet
  421. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  422. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  423. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  424. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  425. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  426. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  427. SELECT IndentBillOnNetProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  428. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  429. FROM IndentBillOnNetProduct
  430. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  431. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  432. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  433. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  434. <Params>
  435. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  436. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="1" />
  437. </Params>
  438. <Tables>
  439. <Table name="IndentBillOnNet" />
  440. <Table name="IndentBillOnNetProduct" />
  441. </Tables>
  442. </SearchIndentBillOnNetPrevious>
  443. <SearchIndentBillOnNetNext CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  444. DECLARE @IndentBillOnNetNo nvarchar(64)
  445. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  446. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  447. WHERE IndentBillOnNet.No_IndentBillOnNet &gt; @No_IndentBillOnNet
  448. And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  449. ORDER BY IndentBillOnNet.No_IndentBillOnNet
  450. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  451. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator,
  452. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  453. FROM IndentBillOnNet
  454. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  455. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  456. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  457. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  458. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  459. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  460. SELECT IndentBillOnNetProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  461. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  462. FROM IndentBillOnNetProduct
  463. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  464. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  465. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  466. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  467. <Params>
  468. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  469. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="1" />
  470. </Params>
  471. <Tables>
  472. <Table name="IndentBillOnNet" />
  473. <Table name="IndentBillOnNetProduct" />
  474. </Tables>
  475. </SearchIndentBillOnNetNext>
  476. <SearchIndentBillOnNetLast CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  477. DECLARE @IndentBillOnNetNo nvarchar(64)
  478. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  479. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  480. WHERE Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  481. ORDER BY IndentBillOnNet.No_IndentBillOnNet DESC
  482. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  483. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  484. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  485. FROM IndentBillOnNet
  486. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  487. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  488. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  489. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  490. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  491. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  492. SELECT IndentBillOnNetProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  493. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  494. FROM IndentBillOnNetProduct
  495. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  496. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  497. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  498. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  499. <Params>
  500. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="0" />
  501. </Params>
  502. <Tables>
  503. <Table name="IndentBillOnNet" />
  504. <Table name="IndentBillOnNetProduct" />
  505. </Tables>
  506. </SearchIndentBillOnNetLast>
  507. <UpdateDisable CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  508. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet
  509. FROM IndentBillOnNet
  510. WHERE IndentBillOnNet.No_IndentBillOnNet = @No_IndentBillOnNet
  511. Update IndentBillOnNet Set Disable_IndentBillOnNet = 1
  512. Where ID_IndentBillOnNet = @ID_IndentBillOnNet
  513. ">
  514. <Params>
  515. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  516. </Params>
  517. <Tables>
  518. <Table name="tempTable" />
  519. </Tables>
  520. </UpdateDisable>
  521. </Search>
  522. </Server>
  523. <Lables>
  524. <Search>
  525. Empty();
  526. NewInstance();
  527. btnDelete.Enabled=false;
  528. toolBar.EnableAudit = false;
  529. toolBar.EnableExport =false;
  530. toolBar.EnableSubmit = false;
  531. toolBar.EnableModify = false;
  532. txtComment.ReadOnly =true;
  533. tbCustomerNo.ReadOnly =true;
  534. #IndentBillOnNet.LastModDate_IndentBillOnNet = DBNull();
  535. #IndentBillOnNet.DeleteDate_IndentBillOnNet = DBNull();
  536. UpdateForm(true,"");
  537. </Search>
  538. <View>
  539. dgProduct.ReadOnly = true;
  540. if(Equals(#IndentBillOnNet.ID_Assessor, DBNull()))
  541. {
  542. if(#IndentBillOnNet.Disable_IndentBillOnNet==false)
  543. {
  544. toolBar.EnableAudit = GetRight(@Title,"审核");
  545. toolBar.EnableModify = GetRight(@Title,"修改");
  546. }
  547. else
  548. {
  549. toolBar.EnableAudit = false;
  550. toolBar.EnableModify = false;
  551. }
  552. btnDelete.Enabled = false;
  553. <!-- txtComment.ReadOnly =true;-->
  554. }
  555. else
  556. {
  557. toolBar.EnableAudit = false;
  558. btnDelete.Enabled = GetRight(@Title,"删除");
  559. <!-- txtComment.ReadOnly =false;-->
  560. toolBar.EnableModify = false;
  561. }
  562. toolBar.EnablePrint = GetRight(@Title,"打印");
  563. toolBar.EnableExport =true;
  564. toolBar.EnableSubmit = false;
  565. txtComment.ReadOnly =true;
  566. UpdateForm(true, "");
  567. tbNo.Focus();
  568. </View>
  569. <Modify>
  570. txtBillComment.ReadOnly = false;
  571. dgProduct.ReadOnly = false;
  572. toolBar.EnableSubmit = GetRight(@Title,"修改");
  573. toolBar.EnableModify = false;
  574. toolBar.EnableDelete = false;
  575. toolBar.EnableAudit = false;
  576. toolBar.EnableExport = false;
  577. #IndentBillOnNet.LastModUser_IndentBillOnNet = GetLoginUserID();
  578. #IndentBillOnNet.LastModUserName = GetCurrentUser();
  579. #IndentBillOnNet.LastModDate_IndentBillOnNet = DateTimeNow();
  580. UpdateForm(true, "");
  581. </Modify>
  582. <SubmitButtonClick>
  583. dgProduct.ReadOnly = true;
  584. #IndentBillOnNet.LastModDate_IndentBillOnNet = DateTimeNow();
  585. txtBillComment.ReadOnly = true;
  586. #IndentBillOnNet.FeedbackComment_IndentBillOnNet = txtBillComment.CValue;
  587. Update();
  588. ChangeMode("View");
  589. </SubmitButtonClick>
  590. <AuditLable>
  591. BeginAudit();
  592. #IndentBillOnNet.ID_Assessor = GetLoginUserID();
  593. #IndentBillOnNet.Name_Assessor = GetCurrentUser();
  594. #IndentBillOnNet.AssessDate_IndentBillOnNet = DateTimeNow();
  595. Audit();
  596. ChangeMode("View");
  597. EndAudit();
  598. </AuditLable>
  599. </Lables>
  600. </Form>
  601. </Forms>