FrmIndentBillOnNet.xml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  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","#IndentBillProduct.Comment_IndentBillProduct","#IndentBillOnNetProduct.Comment_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 [ID_IndentBillOnNetProduct]
  358. ,[No_IndentBillOnNetProduct]
  359. ,IndentBillOnNetProduct.[ID_IndentBillOnNet]
  360. ,IndentBillOnNetProduct.[ID_Product]
  361. ,[Quantity_IndentBillOnNetProduct]
  362. ,[UnitPrice_IndentBillOnNetProduct]
  363. ,IndentBillOnNet.No_IndentBillOnNet as [Comment_IndentBillOnNetProduct]
  364. ,[Amount_SaleBill]
  365. ,Product.No_Product
  366. ,Product.Name_Product
  367. ,Product.Unit_Product
  368. ,A.AvailableQty_ProductStocks
  369. ,(IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct
  370. ,Price_Product
  371. FROM IndentBillOnNetProduct
  372. LEFT JOIN IndentBillOnNet on IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet
  373. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  374. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  375. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  376. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet
  377. ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)
  378. ">
  379. <Params>
  380. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  381. </Params>
  382. <Tables>
  383. <Table name="IndentBillOnNet" />
  384. <Table name="IndentBillOnNetProduct" />
  385. </Tables>
  386. </SearchIndentBillOnNetWithNo>
  387. <SearchIndentBillOnNetFirst CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  388. DECLARE @IndentBillOnNetNo nvarchar(64)
  389. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  390. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  391. WHERE Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  392. ORDER BY IndentBillOnNet.No_IndentBillOnNet
  393. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  394. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  395. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  396. FROM IndentBillOnNet
  397. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  398. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  399. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  400. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  401. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  402. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  403. SELECT [ID_IndentBillOnNetProduct]
  404. ,[No_IndentBillOnNetProduct]
  405. ,IndentBillOnNetProduct.[ID_IndentBillOnNet]
  406. ,IndentBillOnNetProduct.[ID_Product]
  407. ,[Quantity_IndentBillOnNetProduct]
  408. ,[UnitPrice_IndentBillOnNetProduct]
  409. ,IndentBillOnNet.No_IndentBillOnNet as [Comment_IndentBillOnNetProduct]
  410. ,[Amount_SaleBill],
  411. Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  412. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  413. FROM IndentBillOnNetProduct
  414. LEFT JOIN IndentBillOnNet on IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet
  415. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  416. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  417. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  418. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  419. <Params>
  420. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="0" />
  421. </Params>
  422. <Tables>
  423. <Table name="IndentBillOnNet" />
  424. <Table name="IndentBillOnNetProduct" />
  425. </Tables>
  426. </SearchIndentBillOnNetFirst>
  427. <SearchIndentBillOnNetPrevious CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  428. DECLARE @IndentBillOnNetNo nvarchar(64)
  429. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  430. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  431. WHERE IndentBillOnNet.No_IndentBillOnNet &lt; @No_IndentBillOnNet
  432. And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  433. ORDER BY IndentBillOnNet.No_IndentBillOnNet desc
  434. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  435. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  436. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  437. FROM IndentBillOnNet
  438. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  439. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  440. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  441. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  442. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  443. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  444. SELECT [ID_IndentBillOnNetProduct]
  445. ,[No_IndentBillOnNetProduct]
  446. ,IndentBillOnNetProduct.[ID_IndentBillOnNet]
  447. ,IndentBillOnNetProduct.[ID_Product]
  448. ,[Quantity_IndentBillOnNetProduct]
  449. ,[UnitPrice_IndentBillOnNetProduct]
  450. ,IndentBillOnNet.No_IndentBillOnNet as [Comment_IndentBillOnNetProduct]
  451. ,[Amount_SaleBill]
  452. , Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  453. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  454. FROM IndentBillOnNetProduct
  455. LEFT JOIN IndentBillOnNet on IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet
  456. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  457. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  458. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  459. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  460. <Params>
  461. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  462. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="1" />
  463. </Params>
  464. <Tables>
  465. <Table name="IndentBillOnNet" />
  466. <Table name="IndentBillOnNetProduct" />
  467. </Tables>
  468. </SearchIndentBillOnNetPrevious>
  469. <SearchIndentBillOnNetNext CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  470. DECLARE @IndentBillOnNetNo nvarchar(64)
  471. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  472. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  473. WHERE IndentBillOnNet.No_IndentBillOnNet &gt; @No_IndentBillOnNet
  474. And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  475. ORDER BY IndentBillOnNet.No_IndentBillOnNet
  476. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  477. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator,
  478. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  479. FROM IndentBillOnNet
  480. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  481. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  482. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  483. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  484. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  485. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  486. SELECT [ID_IndentBillOnNetProduct]
  487. ,[No_IndentBillOnNetProduct]
  488. ,IndentBillOnNetProduct.[ID_IndentBillOnNet]
  489. ,IndentBillOnNetProduct.[ID_Product]
  490. ,[Quantity_IndentBillOnNetProduct]
  491. ,[UnitPrice_IndentBillOnNetProduct]
  492. ,IndentBillOnNet.No_IndentBillOnNet as [Comment_IndentBillOnNetProduct]
  493. ,[Amount_SaleBill],
  494. Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  495. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  496. FROM IndentBillOnNetProduct
  497. LEFT JOIN IndentBillOnNet on IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet
  498. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  499. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  500. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  501. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  502. <Params>
  503. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  504. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="1" />
  505. </Params>
  506. <Tables>
  507. <Table name="IndentBillOnNet" />
  508. <Table name="IndentBillOnNetProduct" />
  509. </Tables>
  510. </SearchIndentBillOnNetNext>
  511. <SearchIndentBillOnNetLast CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  512. DECLARE @IndentBillOnNetNo nvarchar(64)
  513. SELECT TOP 1 @IndentBillOnNetNo = IndentBillOnNet.No_IndentBillOnNet FROM IndentBillOnNet
  514. Join Customer On Customer.ID_Customer=IndentBillOnNet.ID_Customer
  515. WHERE Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
  516. ORDER BY IndentBillOnNet.No_IndentBillOnNet DESC
  517. SELECT IndentBillOnNet.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer, Customer.Type_Customer,
  518. Customer.LastDiscount_Customer, Customer.PostalCode_Customer, ISNULL(b.Name_User, '') AS Name_Assessor, Customer.ID_Creator As CustomerCreator ,
  519. c.Name_User AS LastModUserName,d.Name_User AS DeleteUserName
  520. FROM IndentBillOnNet
  521. LEFT JOIN Customer ON Customer.ID_Customer = IndentBillOnNet.ID_Customer
  522. LEFT JOIN AppUser b ON b.ID_User = IndentBillOnNet.ID_Assessor
  523. LEFT JOIN AppUser c ON c.ID_User = IndentBillOnNet.LastModUser_IndentBillOnNet
  524. LEFT JOIN AppUser d ON d.ID_User = IndentBillOnNet.DeleteUser_IndentBillOnNet
  525. WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  526. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet FROM IndentBillOnNet WHERE IndentBillOnNet.No_IndentBillOnNet = @IndentBillOnNetNo
  527. SELECT
  528. [ID_IndentBillOnNetProduct]
  529. ,[No_IndentBillOnNetProduct]
  530. ,IndentBillOnNetProduct.[ID_IndentBillOnNet]
  531. ,IndentBillOnNetProduct.[ID_Product]
  532. ,[Quantity_IndentBillOnNetProduct]
  533. ,[UnitPrice_IndentBillOnNetProduct]
  534. ,IndentBillOnNet.No_IndentBillOnNet as [Comment_IndentBillOnNetProduct]
  535. ,[Amount_SaleBill]
  536. , Product.No_Product, Product.Name_Product, Product.Unit_Product, A.AvailableQty_ProductStocks,
  537. (IndentBillOnNetProduct.Quantity_IndentBillOnNetProduct * IndentBillOnNetProduct.UnitPrice_IndentBillOnNetProduct) AS Amount_IndentBillOnNetProduct ,Price_Product
  538. FROM IndentBillOnNetProduct
  539. LEFT JOIN IndentBillOnNet on IndentBillOnNet.ID_IndentBillOnNet = IndentBillOnNetProduct.ID_IndentBillOnNet
  540. LEFT JOIN Product ON Product.ID_Product = IndentBillOnNetProduct.ID_Product
  541. Left join (Select ID_Product,Sum(AvailableQty_ProductStocks) As AvailableQty_ProductStocks From ProductStocks
  542. Group By ID_Product) A On A.ID_Product = Product.ID_Product
  543. WHERE IndentBillOnNetProduct.ID_IndentBillOnNet = @ID_IndentBillOnNet ORDER BY CAST(IndentBillOnNetProduct.No_IndentBillOnNetProduct AS INT)">
  544. <Params>
  545. <Param name="@Right" type="IndentBillOnNet.ID_Customer" Index="0" />
  546. </Params>
  547. <Tables>
  548. <Table name="IndentBillOnNet" />
  549. <Table name="IndentBillOnNetProduct" />
  550. </Tables>
  551. </SearchIndentBillOnNetLast>
  552. <UpdateDisable CmdType="Text" CmdText=" DECLARE @ID_IndentBillOnNet uniqueidentifier
  553. SELECT @ID_IndentBillOnNet = IndentBillOnNet.ID_IndentBillOnNet
  554. FROM IndentBillOnNet
  555. WHERE IndentBillOnNet.No_IndentBillOnNet = @No_IndentBillOnNet
  556. Update IndentBillOnNet Set Disable_IndentBillOnNet = 1
  557. Where ID_IndentBillOnNet = @ID_IndentBillOnNet
  558. ">
  559. <Params>
  560. <Param name="@No_IndentBillOnNet" type="IndentBillOnNet.No_IndentBillOnNet" Index="0" />
  561. </Params>
  562. <Tables>
  563. <Table name="tempTable" />
  564. </Tables>
  565. </UpdateDisable>
  566. </Search>
  567. </Server>
  568. <Lables>
  569. <Search>
  570. Empty();
  571. NewInstance();
  572. btnDelete.Enabled=false;
  573. toolBar.EnableAudit = false;
  574. toolBar.EnableExport =false;
  575. toolBar.EnableSubmit = false;
  576. toolBar.EnableModify = false;
  577. txtComment.ReadOnly =true;
  578. tbCustomerNo.ReadOnly =true;
  579. #IndentBillOnNet.LastModDate_IndentBillOnNet = DBNull();
  580. #IndentBillOnNet.DeleteDate_IndentBillOnNet = DBNull();
  581. UpdateForm(true,"");
  582. </Search>
  583. <View>
  584. dgProduct.ReadOnly = true;
  585. if(Equals(#IndentBillOnNet.ID_Assessor, DBNull()))
  586. {
  587. if(#IndentBillOnNet.Disable_IndentBillOnNet==false)
  588. {
  589. toolBar.EnableAudit = GetRight(@Title,"审核");
  590. toolBar.EnableModify = GetRight(@Title,"修改");
  591. }
  592. else
  593. {
  594. toolBar.EnableAudit = false;
  595. toolBar.EnableModify = false;
  596. }
  597. btnDelete.Enabled = false;
  598. <!-- txtComment.ReadOnly =true;-->
  599. }
  600. else
  601. {
  602. toolBar.EnableAudit = false;
  603. btnDelete.Enabled = GetRight(@Title,"删除");
  604. <!-- txtComment.ReadOnly =false;-->
  605. toolBar.EnableModify = false;
  606. }
  607. toolBar.EnablePrint = GetRight(@Title,"打印");
  608. toolBar.EnableExport =true;
  609. toolBar.EnableSubmit = false;
  610. txtComment.ReadOnly =true;
  611. UpdateForm(true, "");
  612. tbNo.Focus();
  613. </View>
  614. <Modify>
  615. txtBillComment.ReadOnly = false;
  616. dgProduct.ReadOnly = false;
  617. toolBar.EnableSubmit = GetRight(@Title,"修改");
  618. toolBar.EnableModify = false;
  619. toolBar.EnableDelete = false;
  620. toolBar.EnableAudit = false;
  621. toolBar.EnableExport = false;
  622. #IndentBillOnNet.LastModUser_IndentBillOnNet = GetLoginUserID();
  623. #IndentBillOnNet.LastModUserName = GetCurrentUser();
  624. #IndentBillOnNet.LastModDate_IndentBillOnNet = DateTimeNow();
  625. UpdateForm(true, "");
  626. </Modify>
  627. <SubmitButtonClick>
  628. dgProduct.ReadOnly = true;
  629. #IndentBillOnNet.LastModDate_IndentBillOnNet = DateTimeNow();
  630. txtBillComment.ReadOnly = true;
  631. #IndentBillOnNet.FeedbackComment_IndentBillOnNet = txtBillComment.CValue;
  632. Update();
  633. ChangeMode("View");
  634. </SubmitButtonClick>
  635. <AuditLable>
  636. BeginAudit();
  637. #IndentBillOnNet.ID_Assessor = GetLoginUserID();
  638. #IndentBillOnNet.Name_Assessor = GetCurrentUser();
  639. #IndentBillOnNet.AssessDate_IndentBillOnNet = DateTimeNow();
  640. Audit();
  641. ChangeMode("View");
  642. EndAudit();
  643. </AuditLable>
  644. </Lables>
  645. </Form>
  646. </Forms>