FrmPurchaseQueryBill.xml 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Forms>
  3. <Form Name="FrmPurchaseQueryBill">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @SetFlag=1;
  9. @Title="询价单";
  10. GetSchema();
  11. Search("SearchCessIn");
  12. Search("SearchFormat");
  13. Search("SearchProduct","p");
  14. @CessIn=#SystemSetting.CessIn_SystemSetting/100;
  15. @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
  16. @AuditMode = #SystemSetting.QAudit_FunctionSetting;
  17. @UnitPriceDecimal = #SystemSettingFormat.UnitPriceDecimal_SystemSetting;
  18. @PriceDecimal = #SystemSettingFormat.PriceDecimal_SystemSetting;
  19. @QuantityDecimal = #SystemSettingFormat.QuantityDecimal_SystemSetting;
  20. ChangeMode("Search");
  21. dgProduct.NoMember="No_PurchaseQueryBillProduct";
  22. if(@AuditMode)
  23. {
  24. toolBar.VisibleAudit = false;
  25. toolBar.EnableAudit = false;
  26. }
  27. ]]>
  28. </Load>
  29. <Closing>
  30. ;<!--TODO-->
  31. </Closing>
  32. <Closed>
  33. ;<!--TODO-->
  34. </Closed>
  35. </Events>
  36. <Mode>
  37. <Search>
  38. <Lable name="Search" />
  39. </Search>
  40. <New>
  41. <Lable name="New" />
  42. </New>
  43. <View>
  44. <Lable name="View" />
  45. </View>
  46. <Modify>
  47. <Lable name="Modify" />
  48. </Modify>
  49. </Mode>
  50. <Controls>
  51. <IKTextButton name="tbNo" DataSource="PurchaseQueryBill.No_PurchaseQueryBill">
  52. <Events>
  53. <Enter>
  54. if(tbNo.ReadOnly == false)
  55. {
  56. if(tbNo.CValue != StringEmpty())
  57. {
  58. UpdateForm(false, "");
  59. if(Search("SearchPurchaseQueryBillWithNo", tbNo.CValue))
  60. {
  61. ChangeMode("View");
  62. <Lable name="CountSum"/>
  63. }
  64. else
  65. {
  66. MessageBox("该采购询价单不存在!",@Title);
  67. }
  68. }
  69. else
  70. {
  71. MessageBox("请输入采购询价单号!", @Title);
  72. }
  73. }
  74. </Enter>
  75. <Click>
  76. ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
  77. </Click>
  78. </Events>
  79. </IKTextButton>
  80. <IKDataTimePicker name="timeMake" DataSource="PurchaseQueryBill.Date_PurchaseQueryBill" />
  81. <IKDataTimePicker name="dtpRespondDate" DataSource="PurchaseQueryBill.ResponseDate_PurchaseQueryBill" />
  82. <IKDataTimePicker name="dtpValidityDate" DataSource="PurchaseQueryBill.ValidDate_PurchaseQueryBill" />
  83. <IKTextButton name="tbNoSupplier" DataSource="PurchaseQueryBill.No_Supplier" >
  84. <Events>
  85. <Enter>
  86. UpdateForm(false,"");
  87. if(tbNoSupplier.CValue!=StringEmpty())
  88. {
  89. if(!Search("SearchSupplier",tbNoSupplier.CValue))
  90. {
  91. MessageBox("该供应商不存在!",@Title);
  92. @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNoSupplier.CValue);
  93. if(@temp != "")
  94. {
  95. tbNoSupplier.CValue = @temp;
  96. ActiveControlEvent("tbNoSupplier", "Enter");
  97. }
  98. }
  99. else
  100. {
  101. if (!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
  102. {
  103. MessageBox("该供应商已停用!",@Title);
  104. }
  105. #PurchaseQueryBill.ID_Supplier=#Supplier.ID_Supplier;
  106. #PurchaseQueryBill.Name_Supplier=#Supplier.Name_Supplier;
  107. #PurchaseQueryBill.ShortName_Supplier=#Supplier.ShortName_Supplier;
  108. #PurchaseQueryBill.PostalCode_Supplier=#Supplier.PostalCode_Supplier;
  109. #PurchaseQueryBill.RegistedAddress_Supplier=#Supplier.RegistedAddress_Supplier;
  110. #PurchaseQueryBill.Name_Linkman="";
  111. #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill=#Supplier.LastTax_Supplier;
  112. Empty("#ReportComment");
  113. Search("SearchTypeComment",#PurchaseQueryBill.ID_Supplier);
  114. MergeTable("#TypeComment","#ReportComment");
  115. if(Search("SearchFocusLinkman",#Supplier.ID_Supplier))
  116. {
  117. #PurchaseQueryBill.Name_Linkman=#Linkman.Name_Linkman;
  118. }else{
  119. #PurchaseQueryBill.Name_Linkman="";
  120. }
  121. if(Search("SearchFocusTelephone",#Supplier.ID_Supplier))
  122. {
  123. #PurchaseQueryBill.Name_Telephone=#FocusTelephone.No_Telephone;
  124. }else{
  125. #PurchaseQueryBill.Name_Telephone="";
  126. }
  127. if(Search("SearchFocusFax",#Supplier.ID_Supplier))
  128. {
  129. #PurchaseQueryBill.Fax_Telephone=#FocusFax.No_Fax;
  130. }else{
  131. #PurchaseQueryBill.Fax_Telephone="";
  132. }
  133. }
  134. }
  135. else
  136. {
  137. MessageBox("请输入供应商编号!",@Title);
  138. #PurchaseQueryBill.ID_Supplier=GuidEmpty();
  139. #PurchaseQueryBill.ShortName_Supplier="";
  140. #PurchaseQueryBill.Name_Principal="";
  141. #PurchaseQueryBill.Name_Supplier="";
  142. #PurchaseQueryBill.Name_Linkman="";
  143. #PurchaseQueryBill.Name_Telephone="";
  144. #PurchaseQueryBill.Fax_Telephone="";
  145. #PurchaseQueryBill.PostalCode_Supplier="";
  146. #PurchaseQueryBill.RegistedAddress_Supplier="";
  147. tbNoSupplier.Focus();
  148. }
  149. UpdateForm(true,"");
  150. </Enter>
  151. <Click>
  152. <![CDATA[
  153. if (tbNoSupplier.ReadOnly == false)
  154. {
  155. @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNoSupplier.CValue);
  156. if( @temp == "" )
  157. return;
  158. tbNoSupplier.CValue = @temp;
  159. ActiveControlEvent("tbNoSupplier", "Enter");
  160. }
  161. ]]>
  162. </Click>
  163. </Events>
  164. </IKTextButton>
  165. <IKTextBox name="txtSupplierShortName" DataSource="PurchaseQueryBill.ShortName_Supplier"/>
  166. <IKComboBoxEx name="cbTaxCurrency" DisplaySource="PurchaseQueryBill.TaxCurrency_PurchaseQueryBill">
  167. <Events>
  168. <SelectedIndexChanged>
  169. <Lable name="CountSum" />
  170. </SelectedIndexChanged>
  171. </Events>
  172. </IKComboBoxEx>
  173. <IKComboBoxEx name="cbCurrency" DisplaySource="PurchaseQueryBill.Currency_PurchaseQueryBill" DataSource="PurchaseQueryBill"/>
  174. <IKComboBoxEx name="cbPrincipal" ValueSource="PurchaseQueryBill.ID_Principal" DisplaySource="PurchaseQueryBill.Name_Principal" NoSource="PurchaseQueryBill.No_Principal" DataSource="Principal" DisplayMember="Name_Principal" NoMember="No_Principal" ValueMember="ID_Employee">
  175. <Events>
  176. <Reload>
  177. UpdateForm(false, "cbPrincipal");
  178. Search("SearchPrincipal");
  179. UpdateForm(true, "cbPrincipal");
  180. </Reload>
  181. </Events>
  182. </IKComboBoxEx>
  183. <IKTextBox name="txtMaker" DataSource="PurchaseQueryBill.Creator" />
  184. <IKTextBox name="txtAssessor" DataSource="PurchaseQueryBill.Assessor" />
  185. <IKDateTimeText name="dtAssessDate" DataSource="PurchaseQueryBill.AssessDate_PurchaseQueryBill" />
  186. <IKTextBox name="txtLastModUser" DataSource="PurchaseQueryBill.LastModUser"/>
  187. <IKDateTimeText name="dtLastModDate" DataSource="PurchaseQueryBill.LastModDate_PurchaseQueryBill"/>
  188. <IKTextBox name="txtNameSupplier" DataSource="PurchaseQueryBill.Name_Supplier"/>
  189. <IKComboBoxEx name="cbLinkman" DisplaySource="PurchaseQueryBill.Name_Linkman" DataSource="Linkman" DisplayMember="Name_Linkman">
  190. <Events>
  191. <Reload>
  192. UpdateForm(false, "cbLinkman");
  193. Search("SearchLinkman",#PurchaseQueryBill.ID_Supplier);
  194. UpdateForm(true, "cbLinkman");
  195. </Reload>
  196. </Events>
  197. </IKComboBoxEx>
  198. <IKComboBoxEx name="cbTelephone" DisplaySource="PurchaseQueryBill.Name_Telephone" DataSource="Telephone" DisplayMember="No_Telephone">
  199. <Events>
  200. <Reload>
  201. UpdateForm(false, "cbTelephone");
  202. Search("SearchTelephone",#PurchaseQueryBill.ID_Supplier);
  203. UpdateForm(true, "cbTelephone");
  204. </Reload>
  205. </Events>
  206. </IKComboBoxEx>
  207. <IKComboBoxEx name="cbFax" DisplaySource="PurchaseQueryBill.Fax_Telephone" DataSource="Fax" DisplayMember="No_Fax">
  208. <Events>
  209. <Reload>
  210. UpdateForm(false, "cbFax");
  211. Search("SearchFax",#PurchaseQueryBill.ID_Supplier);
  212. UpdateForm(true, "cbFax");
  213. </Reload>
  214. </Events>
  215. </IKComboBoxEx>
  216. <IKTextBox name="txtPostalcode" DataSource="PurchaseQueryBill.PostalCode_Supplier"/>
  217. <IKTextBox name="txtAddress" DataSource="PurchaseQueryBill.RegistedAddress_Supplier"/>
  218. <IKNumericTextBox name="txtMoneySum" DataSource="PurchaseQueryBill.GoodsAmount_PurchaseQueryBill"/>
  219. <IKNumericTextBox name="txtTaxSum" DataSource="PurchaseQueryBill.TaxAmount_PurchaseQueryBill"/>
  220. <IKNumericTextBox name="txtSum" DataSource="PurchaseQueryBill.Amount_PurchaseQueryBill"/>
  221. <IKDataGridEx name="dgProduct" DataSource="PurchaseQueryBillProduct" TableStyleIndex="0">
  222. <DataColumn Index="0" DataSource="PurchaseQueryBillProduct.No_PurchaseQueryBillProduct"/>
  223. <DataColumn Index="1" DataSource="PurchaseQueryBillProduct.No_Product" >
  224. <IKDataGridTextButtonColumn>
  225. <Events>
  226. <Click>
  227. @SetFlag=1;
  228. ShowSearchBox("ProductSearch","INFOMATION",#PurchaseQueryBillProduct.No_Product);
  229. </Click>
  230. <SetFlagBeforeClick>
  231. @SetFlag=0;
  232. </SetFlagBeforeClick>
  233. </Events>
  234. </IKDataGridTextButtonColumn>
  235. </DataColumn>
  236. <DataColumn Index="2" DataSource="PurchaseQueryBillProduct.Name_Product" />
  237. <DataColumn Index="3" DataSource="PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct" />
  238. <DataColumn Index="4" DataSource="PurchaseQueryBillProduct.Unit_Product" />
  239. <DataColumn Index="5" DataSource="PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct" />
  240. <DataColumn Index="6" DataSource="PurchaseQueryBillProduct.Money" />
  241. <DataColumn Index="7" DataSource="PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct" />
  242. </IKDataGridEx>
  243. <IKDataGridEx name="dgRemark" DataSource="BillComment" TableStyleIndex="0">
  244. <DataColumn Index="0" DataSource="BillComment.Comment_BillComment" />
  245. </IKDataGridEx>
  246. <IKDataGridEx name="dgReportComment" DataSource="ReportComment" TableStyleIndex="0">
  247. <DataColumn Index="0" DataSource="ReportComment.Comment_ReportComment" />
  248. </IKDataGridEx>
  249. <IKFormToolBar name="toolBar">
  250. <Events>
  251. <ClickFirst>
  252. if(Search("SearchPurchaseQueryBillFirst"))
  253. {
  254. ChangeMode("View");
  255. <Lable name="CountSum"/>
  256. }
  257. </ClickFirst>
  258. <ClickPrev>
  259. if(Search("SearchPurchaseQueryBillPrev", tbNo.CValue))
  260. {
  261. ChangeMode("View");
  262. <Lable name="CountSum"/>
  263. }
  264. </ClickPrev>
  265. <ClickNext>
  266. if(Search("SearchPurchaseQueryBillNext",tbNo.CValue))
  267. {
  268. ChangeMode("View");
  269. <Lable name="CountSum"/>
  270. }
  271. </ClickNext>
  272. <ClickLast>
  273. if(Search("SearchPurchaseQueryBillLast"))
  274. {
  275. ChangeMode("View");
  276. <Lable name="CountSum"/>
  277. }
  278. </ClickLast>
  279. <ClickNew>
  280. <![CDATA[
  281. @NextNo = GetNextAutoNumber(true);
  282. if (!Equals(@NextNo, ""))
  283. {
  284. ChangeMode("New");
  285. #PurchaseQueryBill.No_PurchaseQueryBill= @NextNo;
  286. UpdateForm(true, "tbNo");
  287. }
  288. ]]>
  289. </ClickNew>
  290. <ClickEmpty>
  291. ChangeMode("Search");
  292. </ClickEmpty>
  293. <ClickSubmit>
  294. <Lable name="SubmitButtonClick" />
  295. if(@AuditMode)
  296. {
  297. <Lable name = "AuditLable"/>
  298. <Lable name="CountSum"/>
  299. }
  300. <Lable name="CountSum"/>
  301. </ClickSubmit>
  302. <ClickModify>
  303. ChangeMode("Modify");
  304. <Lable name="CountSum"/>
  305. </ClickModify>
  306. <ClickDelete>
  307. Delete(); ChangeMode("Search");
  308. </ClickDelete>
  309. <ClickPrint>
  310. ShowPrintBox("BillSearch",#PurchaseQueryBill.No_PurchaseQueryBill,#PurchaseQueryBill.No_PurchaseQueryBill);
  311. </ClickPrint>
  312. <ClickAudit>
  313. if(@AuditMode)
  314. return;
  315. <Lable name = "AuditLable"/>
  316. <Lable name="CountSum"/>
  317. </ClickAudit>
  318. <ClickUnAudit>
  319. BeginUnAudit();
  320. #PurchaseQueryBill.ID_Assessor=DBNull();
  321. #PurchaseQueryBill.Assessor=DBNull();
  322. #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DataTimeNow();
  323. UnAudit();
  324. ChangeMode("View");
  325. EndUnAudit();
  326. <Lable name="CountSum"/>
  327. </ClickUnAudit>
  328. <ClickImport>
  329. ;
  330. </ClickImport>
  331. <ClickExport>
  332. ;
  333. </ClickExport>
  334. <ClickClose>
  335. ;
  336. </ClickClose>
  337. <ClickExpand>
  338. ;
  339. </ClickExpand>
  340. <ClickImportItem>
  341. <![CDATA[
  342. if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="报价单")
  343. {
  344. ShowSearchBox("ImportPriceQueryBillControl","BILLCONVERT");
  345. }
  346. else if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="销货单")
  347. {
  348. ShowSearchBox("ImportSaleBillControl","BILLCONVERT");
  349. }
  350. tbNoSupplier.Focus();
  351. ]]>
  352. <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
  353. </ClickImportItem>
  354. <ClickExportItem>
  355. if(toolBar.MenuItemText=="采购订单")
  356. {
  357. ExportBillProductStart("#PurchaseOrderBillProduct.Type_FromBill",43,"#PurchaseOrderBillProduct.Name_BillType","询价单","#PurchaseOrderBillProduct.No_FromBill",#PurchaseQueryBill.No_PurchaseQueryBill,"#PurchaseOrderBill.No_Supplier",#PurchaseQueryBill.No_Supplier,"#PurchaseOrderBill.TaxCurrency_PurchaseOrderBill",#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill,"#PurchaseOrderBill.No_Principal",#PurchaseQueryBill.No_Principal,"#PurchaseOrderBill.Name_Principal",#PurchaseQueryBill.Name_Principal);
  358. ExportBillProduct("dgProduct","#PurchaseQueryBillProduct","#PurchaseOrderBillProduct.No_Product","#PurchaseQueryBillProduct.No_Product","#PurchaseOrderBillProduct.No_FromBillProduct","#PurchaseQueryBillProduct.No_PurchaseQueryBillProduct");
  359. }
  360. <!--初始化目标数据-->
  361. <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
  362. </ClickExportItem>
  363. </Events>
  364. </IKFormToolBar>
  365. </Controls>
  366. <Tables>
  367. <Table name="PurchaseQueryBillProduct">
  368. <Events>
  369. <ColumnsChanged>
  370. <No_Product>
  371. if(@SetFlag==0)
  372. {
  373. return;
  374. }
  375. if(#PurchaseQueryBillProduct.No_Product==StringEmpty() || !Search("SearchProduct",#PurchaseQueryBillProduct.No_Product))
  376. {
  377. if(#PurchaseQueryBillProduct.No_Product!=StringEmpty())
  378. MessageBox("该产品不存在!",@Title);
  379. #PurchaseQueryBillProduct.ID_Product=GuidEmpty();
  380. #PurchaseQueryBillProduct.Name_Product="";
  381. #PurchaseQueryBillProduct.Unit_Product="";
  382. @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#PurchaseQueryBillProduct.No_Product);
  383. if(@temp != "")
  384. {
  385. ResumeColumnEvent("#PurchaseQueryBillProduct.No_Product");
  386. #PurchaseQueryBillProduct.No_Product = @temp;
  387. ClearColumnEvent();
  388. }
  389. }
  390. else
  391. {
  392. if(!Equals(#Product.SuspendDate_Product,DBNull()))
  393. {
  394. MessageBox("该产品已停用!",@Title);
  395. }
  396. #PurchaseQueryBillProduct.ID_Product=#Product.ID_Product;
  397. #PurchaseQueryBillProduct.Name_Product=#Product.Name_Product;
  398. #PurchaseQueryBillProduct.Unit_Product=#Product.Unit_Product;
  399. }
  400. </No_Product>
  401. <Quantity_PurchaseQueryBillProduct>
  402. #PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct=FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal);
  403. #PurchaseQueryBillProduct.Money=FormatNumber(FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal)*FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal),@PriceDecimal);
  404. <Lable name="CountSum"/>
  405. </Quantity_PurchaseQueryBillProduct>
  406. <UnitPrice_PurchaseQueryBillProduct>
  407. #PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct=FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal);
  408. #PurchaseQueryBillProduct.Money=FormatNumber(FormatNumber(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,@QuantityDecimal)*FormatNumber(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct,@UnitPriceDecimal),@PriceDecimal);
  409. <Lable name="CountSum"/>
  410. </UnitPrice_PurchaseQueryBillProduct>
  411. </ColumnsChanged>
  412. <RowDeleted>
  413. <Lable name="CountSum"/>
  414. </RowDeleted>
  415. </Events>
  416. </Table>
  417. </Tables>
  418. <LockInfomation LockID="ID_PurchaseQueryBill" LockNO="No_PurchaseQueryBill" LockSearchFunction="SearchPurchaseQueryBillWithNo" LockAudit="ID_Assessor"/>
  419. <LogInfomation LogNO="#PurchaseQueryBill.No_PurchaseQueryBill" RecordFormField="" RecordDataGridField="#PurchaseQueryBillProduct.No_Product,#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct,#PurchaseQueryBillProduct.Money"/>
  420. <ChildForms>
  421. <ChildForm name="BillSearch" DataSource="PurchaseQueryBill" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPurchaseQueryBillWithNo">
  422. <DataColumn Index="0" MappingName="#PurchaseQueryBill.No_PurchaseQueryBill" HeaderText="采购询价单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  423. <DataColumn Index="1" MappingName="#PurchaseQueryBill.Date_PurchaseQueryBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  424. <DataColumn Index="2" MappingName="#PurchaseQueryBill.No_Supplier" HeaderText="供应商编号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  425. <DataColumn Index="3" MappingName="#PurchaseQueryBill.ShortName_Supplier" HeaderText="供应商简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  426. <DataColumn Index="4" MappingName="#PurchaseQueryBill.Name_Principal" HeaderText="业务负责" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  427. <DataColumn Index="5" MappingName="#PurchaseQueryBill.Name_Linkman" HeaderText="联系人" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  428. <DataColumn Index="6" MappingName="#PurchaseQueryBill.Name_Telephone" HeaderText="电话" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  429. <DataColumn Index="7" MappingName="#PurchaseQueryBill.Fax_Telephone" HeaderText="传真" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  430. </ChildForm>
  431. <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
  432. <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  433. <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  434. </ChildForm>
  435. <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品" ReturnDataSource="PurchaseQueryBillProduct" ShowCheckBox="true">
  436. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#PurchaseQueryBillProduct.No_Product"/>
  437. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  438. </ChildForm>
  439. <ChildForm name="InputSearchProduct" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
  440. <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  441. <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
  442. </ChildForm>
  443. <ChildForm name="ImportPriceQueryBillControl" >
  444. <DataGridIndex DataSource="PriceQueryBill" SearchFunction="SearchAllPriceQueryBill" SearchFunctionByNo="" MappingName="" ReturnDataSource="PurchaseQueryBillProduct">
  445. <DataColumn Index="0" MappingName="#PriceQueryBill.No_PriceQueryBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  446. <DataColumn Index="1" MappingName="#PriceQueryBill.Date_PriceQueryBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  447. <DataColumn Index="2" MappingName="#PriceQueryBill.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseQueryBill.No_Supplier"/>
  448. <DataColumn Index="3" MappingName="#PriceQueryBill.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  449. <DataColumn Index="4" MappingName="#PriceQueryBill.State_PriceQueryBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  450. <DataColumn Index="5" MappingName="#PriceQueryBill.TaxCurrency_PriceQueryBill" HeaderText="税别" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill" />
  451. </DataGridIndex>
  452. <DataGridIndex DataSource="PriceQueryBillProduct" SearchFunction="SearchAllPriceQueryBillProduct" SearchFunctionByNo="" MappingName="">
  453. <DataColumn Index="0" MappingName="#PriceQueryBillProduct.No_Product" HeaderText="产品编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#PurchaseQueryBillProduct.No_Product"/>
  454. <DataColumn Index="1" MappingName="#PriceQueryBillProduct.No_PriceQueryBillProduct" HeaderText="产品序号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  455. <DataColumn Index="2" MappingName="#PriceQueryBillProduct.Name_Product" HeaderText="产品名称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  456. <DataColumn Index="3" MappingName="#PriceQueryBillProduct.Quantity_PriceQueryBillProduct" HeaderText="数量" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" Format="F2"/>
  457. <DataColumn Index="4" MappingName="#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct" HeaderText="单价" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" Format="F2"/>
  458. </DataGridIndex>
  459. </ChildForm>
  460. <ChildForm name="ImportSaleBillControl" >
  461. <DataGridIndex DataSource="SaleBill" SearchFunction="SearchAllSaleBill" SearchFunctionByNo="" MappingName="" ReturnDataSource="PurchaseQueryBillProduct">
  462. <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  463. <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  464. <DataColumn Index="2" MappingName="#SaleBill.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseQueryBill.No_Supplier"/>
  465. <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  466. <DataColumn Index="4" MappingName="#SaleBill.State_SaleBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  467. <DataColumn Index="5" MappingName="#SaleBill.TaxCurrency_SaleBill" HeaderText="税别" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill" />
  468. </DataGridIndex>
  469. <DataGridIndex DataSource="SaleBillProduct" SearchFunction="SearchAllSaleBillProduct" SearchFunctionByNo="" MappingName="">
  470. <DataColumn Index="0" MappingName="#SaleBillProduct.No_Product" HeaderText="产品编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#PurchaseQueryBillProduct.No_Product"/>
  471. <DataColumn Index="1" MappingName="#SaleBillProduct.No_SaleBillProduct" HeaderText="产品序号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  472. <DataColumn Index="2" MappingName="#SaleBillProduct.Name_Product" HeaderText="产品名称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
  473. <DataColumn Index="3" MappingName="#SaleBillProduct.Quantity_SaleBillProduct" HeaderText="数量" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" Format="F2"/>
  474. <DataColumn Index="4" MappingName="#SaleBillProduct.UnitPrice_SaleBillProduct" HeaderText="单价" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" Format="F2"/>
  475. </DataGridIndex>
  476. </ChildForm>
  477. </ChildForms>
  478. <ImportedInfo>
  479. @TaxCurrency=#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill;
  480. UpdateForm(true, "tbNoSupplier");
  481. tbNoSupplier.Focus();
  482. ActiveControlEvent("tbNoSupplier", "Enter");
  483. #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill=@TaxCurrency;
  484. UpdateForm(true, "cbTaxCurrency");
  485. </ImportedInfo>
  486. </Client>
  487. <Server>
  488. <Tables>
  489. <Table name="PurchaseQueryBill" Type="Parent">
  490. <GetSchema CmdType="Text" CmdText=" SELECT Top 0 PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END, ShortName_Supplier,RegistedAddress_Supplier,PostalCode_Supplier,
  491. EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  492. FROM PurchaseQueryBill
  493. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  494. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  495. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  496. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  497. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  498. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman"/>
  499. <New CmdType="Text" CmdText="
  500. INSERT INTO PurchaseQueryBill(ID_PurchaseQueryBill,
  501. No_PurchaseQueryBill,
  502. Date_PurchaseQueryBill,
  503. ResponseDate_PurchaseQueryBill,
  504. ValidDate_PurchaseQueryBill,
  505. ID_Supplier,
  506. Name_Linkman,
  507. Name_Telephone,
  508. Fax_Telephone,
  509. ID_Principal,
  510. TaxCurrency_PurchaseQueryBill,
  511. Currency_PurchaseQueryBill,
  512. ID_Creator,
  513. ID_Assessor,
  514. AssessDate_PurchaseQueryBill,
  515. CreateDate_PurchaseQueryBill,
  516. LastModDate_PurchaseQueryBill,
  517. LastModUser_PurchaseQueryBill,
  518. GoodsAmount_PurchaseQueryBill,
  519. TaxAmount_PurchaseQueryBill,
  520. Amount_PurchaseQueryBill
  521. )
  522. Values(@ID_PurchaseQueryBill,
  523. @No_PurchaseQueryBill,
  524. @Date_PurchaseQueryBill,
  525. @ResponseDate_PurchaseQueryBill,
  526. @ValidDate_PurchaseQueryBill,
  527. @ID_Supplier,
  528. @Name_Linkman,
  529. @Name_Telephone,
  530. @Fax_Telephone,
  531. @ID_Principal,
  532. @TaxCurrency_PurchaseQueryBill,
  533. @Currency_PurchaseQueryBill,
  534. @ID_Creator,
  535. @ID_Assessor,
  536. @AssessDate_PurchaseQueryBill,
  537. @CreateDate_PurchaseQueryBill,
  538. @LastModDate_PurchaseQueryBill,
  539. @LastModUser_PurchaseQueryBill,
  540. @GoodsAmount_PurchaseQueryBill,
  541. @TaxAmount_PurchaseQueryBill,
  542. @Amount_PurchaseQueryBill
  543. )
  544. ">
  545. <Params>
  546. <Param name="@ID_PurchaseQueryBill" type="PurchaseQueryBill.ID_PurchaseQueryBill" sourceColumn="ID_PurchaseQueryBill" />
  547. <Param name="@No_PurchaseQueryBill" type="PurchaseQueryBill.No_PurchaseQueryBill" sourceColumn="No_PurchaseQueryBill" />
  548. <Param name="@Date_PurchaseQueryBill" type="PurchaseQueryBill.Date_PurchaseQueryBill" sourceColumn="Date_PurchaseQueryBill" />
  549. <Param name="@ResponseDate_PurchaseQueryBill" type="PurchaseQueryBill.ResponseDate_PurchaseQueryBill" sourceColumn="ResponseDate_PurchaseQueryBill" />
  550. <Param name="@ValidDate_PurchaseQueryBill" type="PurchaseQueryBill.ValidDate_PurchaseQueryBill" sourceColumn="ValidDate_PurchaseQueryBill" />
  551. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" sourceColumn="ID_Supplier" />
  552. <Param name="@Name_Linkman" type="PurchaseQueryBill.Name_Linkman" sourceColumn="Name_Linkman" />
  553. <Param name="@Name_Telephone" type="PurchaseQueryBill.Name_Telephone" sourceColumn="Name_Telephone" />
  554. <Param name="@Fax_Telephone" type="PurchaseQueryBill.Fax_Telephone" sourceColumn="Fax_Telephone" />
  555. <Param name="@ID_Principal" type="PurchaseQueryBill.ID_Principal" sourceColumn="ID_Principal" />
  556. <Param name="@TaxCurrency_PurchaseQueryBill" type="PurchaseQueryBill.TaxCurrency_PurchaseQueryBill" sourceColumn="TaxCurrency_PurchaseQueryBill" />
  557. <Param name="@Currency_PurchaseQueryBill" type="PurchaseQueryBill.Currency_PurchaseQueryBill" sourceColumn="Currency_PurchaseQueryBill" />
  558. <Param name="@ID_Creator" type="PurchaseQueryBill.ID_Creator" sourceColumn="ID_Creator" />
  559. <Param name="@ID_Assessor" type="PurchaseQueryBill.ID_Assessor" sourceColumn="ID_Assessor" />
  560. <Param name="@AssessDate_PurchaseQueryBill" type="PurchaseQueryBill.AssessDate_PurchaseQueryBill" sourceColumn="AssessDate_PurchaseQueryBill" />
  561. <Param name="@CreateDate_PurchaseQueryBill" type="PurchaseQueryBill.CreateDate_PurchaseQueryBill" sourceColumn="CreateDate_PurchaseQueryBill" />
  562. <Param name="@LastModDate_PurchaseQueryBill" type="PurchaseQueryBill.LastModDate_PurchaseQueryBill" sourceColumn="LastModDate_PurchaseQueryBill" />
  563. <Param name="@LastModUser_PurchaseQueryBill" type="PurchaseQueryBill.LastModUser_PurchaseQueryBill" sourceColumn="LastModUser_PurchaseQueryBill" />
  564. <Param name="@GoodsAmount_PurchaseQueryBill" type="PurchaseQueryBill.GoodsAmount_PurchaseQueryBill" sourceColumn="GoodsAmount_PurchaseQueryBill" />
  565. <Param name="@TaxAmount_PurchaseQueryBill" type="PurchaseQueryBill.TaxAmount_PurchaseQueryBill" sourceColumn="TaxAmount_PurchaseQueryBill" />
  566. <Param name="@Amount_PurchaseQueryBill" type="PurchaseQueryBill.Amount_PurchaseQueryBill" sourceColumn="Amount_PurchaseQueryBill" />
  567. </Params>
  568. </New>
  569. <Update CmdType="Text" CmdText="
  570. UPDATE PurchaseQueryBill
  571. SET No_PurchaseQueryBill=@No_PurchaseQueryBill,
  572. Date_PurchaseQueryBill=@Date_PurchaseQueryBill,
  573. ResponseDate_PurchaseQueryBill=@ResponseDate_PurchaseQueryBill,
  574. ValidDate_PurchaseQueryBill=@ValidDate_PurchaseQueryBill,
  575. ID_Supplier=@ID_Supplier,
  576. Name_Linkman=@Name_Linkman,
  577. Name_Telephone=@Name_Telephone,
  578. Fax_Telephone=@Fax_Telephone,
  579. ID_Principal=@ID_Principal,
  580. TaxCurrency_PurchaseQueryBill=@TaxCurrency_PurchaseQueryBill,
  581. Currency_PurchaseQueryBill=@Currency_PurchaseQueryBill,
  582. ID_Creator=@ID_Creator,
  583. ID_Assessor=@ID_Assessor,
  584. AssessDate_PurchaseQueryBill=@AssessDate_PurchaseQueryBill,
  585. CreateDate_PurchaseQueryBill=@CreateDate_PurchaseQueryBill,
  586. LastModDate_PurchaseQueryBill=@LastModDate_PurchaseQueryBill,
  587. LastModUser_PurchaseQueryBill=@LastModUser_PurchaseQueryBill,
  588. GoodsAmount_PurchaseQueryBill=@GoodsAmount_PurchaseQueryBill,
  589. TaxAmount_PurchaseQueryBill=@TaxAmount_PurchaseQueryBill,
  590. Amount_PurchaseQueryBill=@Amount_PurchaseQueryBill
  591. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  592. ">
  593. <Params>
  594. <Param name="@ID_PurchaseQueryBill" type="PurchaseQueryBill.ID_PurchaseQueryBill" sourceColumn="ID_PurchaseQueryBill" />
  595. <Param name="@No_PurchaseQueryBill" type="PurchaseQueryBill.No_PurchaseQueryBill" sourceColumn="No_PurchaseQueryBill" />
  596. <Param name="@Date_PurchaseQueryBill" type="PurchaseQueryBill.Date_PurchaseQueryBill" sourceColumn="Date_PurchaseQueryBill" />
  597. <Param name="@ResponseDate_PurchaseQueryBill" type="PurchaseQueryBill.ResponseDate_PurchaseQueryBill" sourceColumn="ResponseDate_PurchaseQueryBill" />
  598. <Param name="@ValidDate_PurchaseQueryBill" type="PurchaseQueryBill.ValidDate_PurchaseQueryBill" sourceColumn="ValidDate_PurchaseQueryBill" />
  599. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" sourceColumn="ID_Supplier" />
  600. <Param name="@Name_Linkman" type="PurchaseQueryBill.Name_Linkman" sourceColumn="Name_Linkman" />
  601. <Param name="@Name_Telephone" type="PurchaseQueryBill.Name_Telephone" sourceColumn="Name_Telephone" />
  602. <Param name="@Fax_Telephone" type="PurchaseQueryBill.Fax_Telephone" sourceColumn="Fax_Telephone" />
  603. <Param name="@ID_Principal" type="PurchaseQueryBill.ID_Principal" sourceColumn="ID_Principal" />
  604. <Param name="@TaxCurrency_PurchaseQueryBill" type="PurchaseQueryBill.TaxCurrency_PurchaseQueryBill" sourceColumn="TaxCurrency_PurchaseQueryBill" />
  605. <Param name="@Currency_PurchaseQueryBill" type="PurchaseQueryBill.Currency_PurchaseQueryBill" sourceColumn="Currency_PurchaseQueryBill" />
  606. <Param name="@ID_Creator" type="PurchaseQueryBill.ID_Creator" sourceColumn="ID_Creator" />
  607. <Param name="@ID_Assessor" type="PurchaseQueryBill.ID_Assessor" sourceColumn="ID_Assessor" />
  608. <Param name="@AssessDate_PurchaseQueryBill" type="PurchaseQueryBill.AssessDate_PurchaseQueryBill" sourceColumn="AssessDate_PurchaseQueryBill" />
  609. <Param name="@CreateDate_PurchaseQueryBill" type="PurchaseQueryBill.CreateDate_PurchaseQueryBill" sourceColumn="CreateDate_PurchaseQueryBill" />
  610. <Param name="@LastModDate_PurchaseQueryBill" type="PurchaseQueryBill.LastModDate_PurchaseQueryBill" sourceColumn="LastModDate_PurchaseQueryBill" />
  611. <Param name="@LastModUser_PurchaseQueryBill" type="PurchaseQueryBill.LastModUser_PurchaseQueryBill" sourceColumn="LastModUser_PurchaseQueryBill" />
  612. <Param name="@GoodsAmount_PurchaseQueryBill" type="PurchaseQueryBill.GoodsAmount_PurchaseQueryBill" sourceColumn="GoodsAmount_PurchaseQueryBill" />
  613. <Param name="@TaxAmount_PurchaseQueryBill" type="PurchaseQueryBill.TaxAmount_PurchaseQueryBill" sourceColumn="TaxAmount_PurchaseQueryBill" />
  614. <Param name="@Amount_PurchaseQueryBill" type="PurchaseQueryBill.Amount_PurchaseQueryBill" sourceColumn="Amount_PurchaseQueryBill" />
  615. </Params>
  616. </Update>
  617. <Delete CmdType="Text" CmdText="
  618. DELETE FROM PurchaseQueryBillProduct WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  619. DELETE FROM BillComment WHERE ID_Bill = @ID_PurchaseQueryBill
  620. DELETE FROM ReportComment WHERE ID_Bill=@ID_PurchaseQueryBill
  621. DELETE FROM PurchaseQueryBill WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  622. ">
  623. <Params>
  624. <Param name="@ID_PurchaseQueryBill" type="PurchaseQueryBill.ID_PurchaseQueryBill" sourceColumn="ID_PurchaseQueryBill" />
  625. </Params>
  626. </Delete>
  627. <Audit CmdType="Text" CmdText="
  628. UPDATE PurchaseQueryBill SET ID_Assessor=@ID_Assessor,AssessDate_PurchaseQueryBill=@AssessDate_PurchaseQueryBill WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  629. ">
  630. <Params>
  631. <Param name="@ID_PurchaseQueryBill" type="PurchaseQueryBill.ID_PurchaseQueryBill" sourceColumn="ID_PurchaseQueryBill"/>
  632. <Param name="@ID_Assessor" type="PurchaseQueryBill.ID_Assessor" sourceColumn="ID_Assessor"/>
  633. <Param name="@AssessDate_PurchaseQueryBill" type="PurchaseQueryBill.AssessDate_PurchaseQueryBill" sourceColumn="AssessDate_PurchaseQueryBill"/>
  634. </Params>
  635. </Audit>
  636. <FKErrorReport ErrorMessage="该单据已被其他单据引用,删除失败!"/>
  637. <UNIQUEErrorReport ErrorMessage="采购询价单号已存在,提交失败!"/>
  638. </Table>
  639. <Table name="PurchaseQueryBillProduct" Type="Child">
  640. <GetSchema CmdType="Text" CmdText="
  641. SELECT Top 0 PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money,convert(nvarchar(64), '') as No_PurchaseQueryBill
  642. FROM PurchaseQueryBillProduct
  643. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  644. "/>
  645. <New CmdType="Text" CmdText="
  646. INSERT INTO PurchaseQueryBillProduct(ID_PurchaseQueryBillProduct,
  647. No_PurchaseQueryBillProduct,
  648. ID_PurchaseQueryBill,
  649. ID_Product,
  650. Quantity_PurchaseQueryBillProduct,
  651. UnitPrice_PurchaseQueryBillProduct,
  652. Comment_PurchaseQueryBillProduct)
  653. Values(@ID_PurchaseQueryBillProduct,
  654. @No_PurchaseQueryBillProduct,
  655. @ID_PurchaseQueryBill,
  656. @ID_Product,
  657. @Quantity_PurchaseQueryBillProduct,
  658. @UnitPrice_PurchaseQueryBillProduct,
  659. @Comment_PurchaseQueryBillProduct)
  660. ">
  661. <Params>
  662. <Param name="@ID_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.ID_PurchaseQueryBillProduct" sourceColumn="ID_PurchaseQueryBillProduct" />
  663. <Param name="@No_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.No_PurchaseQueryBillProduct" sourceColumn="No_PurchaseQueryBillProduct" />
  664. <Param name="@ID_PurchaseQueryBill" type="PurchaseQueryBillProduct.ID_PurchaseQueryBill" sourceColumn="ID_PurchaseQueryBill" />
  665. <Param name="@ID_Product" type="PurchaseQueryBillProduct.ID_Product" sourceColumn="ID_Product" />
  666. <Param name="@Quantity_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct" sourceColumn="Quantity_PurchaseQueryBillProduct" />
  667. <Param name="@UnitPrice_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct" sourceColumn="UnitPrice_PurchaseQueryBillProduct" />
  668. <Param name="@Comment_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct" sourceColumn="Comment_PurchaseQueryBillProduct" />
  669. </Params>
  670. </New>
  671. <Update CmdType="Text" CmdText="
  672. UPDATE PurchaseQueryBillProduct
  673. SET No_PurchaseQueryBillProduct=@No_PurchaseQueryBillProduct,
  674. ID_Product=@ID_Product,
  675. Quantity_PurchaseQueryBillProduct=@Quantity_PurchaseQueryBillProduct,
  676. UnitPrice_PurchaseQueryBillProduct=@UnitPrice_PurchaseQueryBillProduct,
  677. Comment_PurchaseQueryBillProduct=@Comment_PurchaseQueryBillProduct
  678. WHERE ID_PurchaseQueryBillProduct=@ID_PurchaseQueryBillProduct
  679. ">
  680. <Params>
  681. <Param name="@ID_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.ID_PurchaseQueryBillProduct" sourceColumn="ID_PurchaseQueryBillProduct" />
  682. <Param name="@No_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.No_PurchaseQueryBillProduct" sourceColumn="No_PurchaseQueryBillProduct" />
  683. <Param name="@ID_Product" type="PurchaseQueryBillProduct.ID_Product" sourceColumn="ID_Product" />
  684. <Param name="@Quantity_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct" sourceColumn="Quantity_PurchaseQueryBillProduct" />
  685. <Param name="@UnitPrice_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct" sourceColumn="UnitPrice_PurchaseQueryBillProduct" />
  686. <Param name="@Comment_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct" sourceColumn="Comment_PurchaseQueryBillProduct" />
  687. </Params>
  688. </Update>
  689. <Delete CmdType="Text" CmdText="DELETE FROM PurchaseQueryBillProduct WHERE ID_PurchaseQueryBillProduct=@ID_PurchaseQueryBillProduct">
  690. <Params>
  691. <Param name="@ID_PurchaseQueryBillProduct" type="PurchaseQueryBillProduct.ID_PurchaseQueryBillProduct" sourceColumn="ID_PurchaseQueryBillProduct"/>
  692. </Params>
  693. </Delete>
  694. </Table>
  695. <Table name="BillComment" Type="Child">
  696. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 BillComment.* FROM BillComment"/>
  697. <New CmdType="Text" CmdText=" INSERT INTO BillComment (ID_BillComment, ID_Bill, Comment_BillComment)
  698. VALUES (@ID_BillComment, @ID_Bill, @Comment_BillComment)">
  699. <Params>
  700. <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
  701. <Param name="@ID_Bill" type="BillComment.ID_Bill" sourceColumn="ID_Bill" />
  702. <Param name="@Comment_BillComment" type="BillComment.Comment_BillComment" sourceColumn="Comment_BillComment" />
  703. </Params>
  704. </New>
  705. <Update CmdType="Text" CmdText=" UPDATE BillComment SET ID_Bill = @ID_Bill, Comment_BillComment = @Comment_BillComment
  706. WHERE ID_BillComment = @ID_BillComment">
  707. <Params>
  708. <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
  709. <Param name="@ID_Bill" type="BillComment.ID_Bill" sourceColumn="ID_Bill" />
  710. <Param name="@Comment_BillComment" type="BillComment.Comment_BillComment" sourceColumn="Comment_BillComment" />
  711. </Params>
  712. </Update>
  713. <Delete CmdType="Text" CmdText=" DELETE BillComment WHERE ID_BillComment = @ID_BillComment">
  714. <Params>
  715. <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
  716. </Params>
  717. </Delete>
  718. </Table>
  719. <Table name="ReportComment" Type="Child">
  720. <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 ReportComment.*,convert(nvarchar(64), '') as No_PurchaseQueryBill FROM ReportComment"/>
  721. <New CmdType="Text" CmdText=" INSERT INTO ReportComment (ID_ReportComment, ID_Bill, Comment_ReportComment)
  722. VALUES (@ID_ReportComment, @ID_Bill, @Comment_ReportComment)">
  723. <Params>
  724. <Param name="@ID_ReportComment" type="ReportComment.ID_BillComment" sourceColumn="ID_ReportComment" />
  725. <Param name="@ID_Bill" type="ReportComment.ID_Bill" sourceColumn="ID_Bill" />
  726. <Param name="@Comment_ReportComment" type="ReportComment.Comment_ReportComment" sourceColumn="Comment_ReportComment" />
  727. </Params>
  728. </New>
  729. <Update CmdType="Text" CmdText=" UPDATE ReportComment SET ID_Bill = @ID_Bill, Comment_ReportComment = @Comment_ReportComment
  730. WHERE ID_ReportComment = @ID_ReportComment">
  731. <Params>
  732. <Param name="@ID_ReportComment" type="ReportComment.ID_BillComment" sourceColumn="ID_ReportComment" />
  733. <Param name="@ID_Bill" type="ReportComment.ID_Bill" sourceColumn="ID_Bill" />
  734. <Param name="@Comment_ReportComment" type="ReportComment.Comment_ReportComment" sourceColumn="Comment_ReportComment" />
  735. </Params>
  736. </Update>
  737. <Delete CmdType="Text" CmdText=" DELETE ReportComment WHERE ID_ReportComment = @ID_ReportComment">
  738. <Params>
  739. <Param name="@ID_ReportComment" type="ReportComment.ID_ReportComment" sourceColumn="ID_ReportComment" />
  740. </Params>
  741. </Delete>
  742. </Table>
  743. </Tables>
  744. <Search>
  745. <SearchAllBill CmdType="Text" CmdText=" SELECT PurchaseQueryBill.*,Supplier.No_Supplier,Supplier.ShortName_Supplier,Name_Employee As Name_Principal
  746. FROM PurchaseQueryBill
  747. JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  748. Join Employee On Employee.ID_Employee=PurchaseQueryBill.ID_Principal
  749. ">
  750. <Tables>
  751. <Table name="AllBill" />
  752. </Tables>
  753. </SearchAllBill>
  754. <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
  755. <Tables>
  756. <Table name="AllSupplier" />
  757. </Tables>
  758. </SearchAllSupplier>
  759. <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
  760. <Tables>
  761. <Table name="AllProduct" />
  762. </Tables>
  763. </SearchAllProduct>
  764. <SearchAllPriceQueryBill CmdType="Text" CmdText="Select PriceQueryBill.TaxCurrency_PriceQueryBill,PriceQueryBill.ID_PriceQueryBill,PriceQueryBill.No_PriceQueryBill,PriceQueryBill.Date_PriceQueryBill,Customer.No_Customer,Customer.ShortName_Customer,Case When PriceQueryBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_PriceQueryBill From PriceQueryBill
  765. Inner Join Customer On PriceQueryBill.ID_Customer = Customer.ID_Customer" >
  766. <Tables>
  767. <Table name="AllPriceQueryBill" />
  768. </Tables>
  769. </SearchAllPriceQueryBill>
  770. <SearchAllSaleBill CmdType="Text" CmdText="Select SaleBill.TaxCurrency_SaleBill,SaleBill.ID_SaleBill,SaleBill.No_SaleBill,SaleBill.Date_SaleBill,Customer.No_Customer,Customer.ShortName_Customer,Case When SaleBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_SaleBill From SaleBill
  771. Inner Join Customer On SaleBill.ID_Customer = Customer.ID_Customer" >
  772. <Tables>
  773. <Table name="AllSaleBill" />
  774. </Tables>
  775. </SearchAllSaleBill>
  776. <SearchAllPriceQueryBillProduct CmdType="Text" CmdText="Select PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct,Product.No_Product,PriceQueryBillProduct.No_PriceQueryBillProduct,Product.Name_Product,PriceQueryBillProduct.Quantity_PriceQueryBillProduct,PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct From PriceQueryBillProduct
  777. Inner Join Product On Product.ID_Product = PriceQueryBillProduct.ID_Product
  778. Inner Join PriceQueryBill On PriceQueryBill.ID_PriceQueryBill = PriceQueryBillProduct.ID_PriceQueryBill" >
  779. <Tables>
  780. <Table name="AllPriceQueryBillProduct" />
  781. </Tables>
  782. </SearchAllPriceQueryBillProduct>
  783. <SearchAllSaleBillProduct CmdType="Text" CmdText="Select Product.No_Product,SaleBillProduct.No_SaleBillProduct,Product.Name_Product,SaleBillProduct.Quantity_SaleBillProduct,SaleBillProduct.UnitPrice_SaleBillProduct From SaleBillProduct
  784. Inner Join Product On Product.ID_Product = SaleBillProduct.ID_Product
  785. Inner Join SaleBill On SaleBill.ID_SaleBill =SaleBillProduct.ID_SaleBill" >
  786. <Tables>
  787. <Table name="AllSaleBillProduct" />
  788. </Tables>
  789. </SearchAllSaleBillProduct>
  790. <SearchPurchaseQueryBillWithNo CmdType="Text" CmdText="
  791. SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  792. FROM PurchaseQueryBill
  793. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  794. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  795. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  796. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  797. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  798. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
  799. WHERE No_PurchaseQueryBill=@No_PurchaseQueryBill
  800. SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money, @No_PurchaseQueryBill as No_PurchaseQueryBill
  801. From PurchaseQueryBillProduct
  802. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  803. LEFT JOIN PurchaseQueryBill ON PurchaseQueryBillProduct.ID_PurchaseQueryBill=PurchaseQueryBill.ID_PurchaseQueryBill
  804. WHERE No_PurchaseQueryBill=@No_PurchaseQueryBill
  805. Order By CAST(PurchaseQueryBillProduct.No_PurchaseQueryBillProduct AS INT)
  806. SELECT BillComment.*
  807. FROM BillComment
  808. LEFT JOIN PurchaseQueryBill ON PurchaseQueryBill.ID_PurchaseQueryBill=BillComment.ID_Bill
  809. WHERE No_PurchaseQueryBill=@No_PurchaseQueryBill
  810. ORDER BY BillComment.No_BillComment
  811. SELECT ReportComment.*,@No_PurchaseQueryBill as No_PurchaseQueryBill
  812. FROM ReportComment
  813. LEFT JOIN PurchaseQueryBill ON PurchaseQueryBill.ID_PurchaseQueryBill=ReportComment.ID_Bill
  814. WHERE No_PurchaseQueryBill=@No_PurchaseQueryBill
  815. ORDER BY ReportComment.No_ReportComment
  816. ">
  817. <Params>
  818. <Param name="@No_PurchaseQueryBill" type="PurchaseQueryBill.No_PurchaseQueryBill" Index="0"/>
  819. </Params>
  820. <Tables>
  821. <Table name="PurchaseQueryBill"/>
  822. <Table name="PurchaseQueryBillProduct"/>
  823. <Table name="BillComment"/>
  824. <Table name="ReportComment"/>
  825. </Tables>
  826. </SearchPurchaseQueryBillWithNo>
  827. <SearchSupplier CmdType="Text" CmdText="
  828. declare @LastTax_Supplier1 nvarchar(64)
  829. declare @LastTax_Supplier2 nvarchar(64)
  830. declare @LastTax_Supplier3 nvarchar(64)
  831. declare @PurTaxDefault1_FunctionSetting int
  832. declare @PurTaxDefault2_FunctionSetting int
  833. declare @PurTaxDefault3_FunctionSetting int
  834. select @PurTaxDefault1_FunctionSetting = PurTaxDefault1_FunctionSetting,
  835. @PurTaxDefault2_FunctionSetting = PurTaxDefault2_FunctionSetting, @PurTaxDefault3_FunctionSetting = PurTaxDefault3_FunctionSetting
  836. from FunctionSetting
  837. if @PurTaxDefault1_FunctionSetting=0
  838. begin
  839. select top 1 @LastTax_Supplier1 = PurchaseQueryBill.TaxCurrency_PurchaseQueryBill
  840. from PurchaseQueryBill
  841. Left join Supplier
  842. on Supplier.ID_Supplier = PurchaseQueryBill.ID_Supplier
  843. where Supplier.No_Supplier = @No_Supplier
  844. order by Date_PurchaseQueryBill desc
  845. end
  846. else if @PurTaxDefault1_FunctionSetting = 1
  847. begin
  848. select top 1 @LastTax_Supplier1 = TaxCurrency_PurchaseQueryBill
  849. from PurchaseQueryBill
  850. order by Date_PurchaseQueryBill desc
  851. end
  852. else
  853. begin
  854. set @LastTax_Supplier1 = '外加'
  855. end
  856. if @PurTaxDefault2_FunctionSetting=0
  857. begin
  858. select top 1 @LastTax_Supplier2 = PurchaseQueryBill.TaxCurrency_PurchaseQueryBill
  859. from PurchaseQueryBill
  860. Left join Supplier
  861. on Supplier.ID_Supplier = PurchaseQueryBill.ID_Supplier
  862. where Supplier.No_Supplier = @No_Supplier
  863. order by Date_PurchaseQueryBill desc
  864. end
  865. else if @PurTaxDefault2_FunctionSetting = 1
  866. begin
  867. select top 1 @LastTax_Supplier2 = TaxCurrency_PurchaseQueryBill
  868. from PurchaseQueryBill
  869. order by Date_PurchaseQueryBill desc
  870. end
  871. else
  872. begin
  873. set @LastTax_Supplier2 = '外加'
  874. end
  875. if @PurTaxDefault3_FunctionSetting=0
  876. begin
  877. select top 1 @LastTax_Supplier3 = PurchaseQueryBill.TaxCurrency_PurchaseQueryBill
  878. from PurchaseQueryBill
  879. Left join Supplier
  880. on Supplier.ID_Supplier = PurchaseQueryBill.ID_Supplier
  881. where Supplier.No_Supplier = @No_Supplier
  882. order by Date_PurchaseQueryBill desc
  883. end
  884. else if @PurTaxDefault3_FunctionSetting = 1
  885. begin
  886. select top 1 @LastTax_Supplier3 = TaxCurrency_PurchaseQueryBill
  887. from PurchaseQueryBill
  888. order by Date_PurchaseQueryBill desc
  889. end
  890. else
  891. begin
  892. set @LastTax_Supplier3 = '外加'
  893. end
  894. if @LastTax_Supplier1 is null
  895. set @LastTax_Supplier1 = isnull(@LastTax_Supplier2, @LastTax_Supplier3)
  896. SELECT *, ISNULL(@LastTax_Supplier1, '外加') AS LastTax_Supplier FROM Supplier
  897. WHERE No_Supplier=@No_Supplier
  898. ">
  899. <Params>
  900. <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0"/>
  901. </Params>
  902. <Tables>
  903. <Table name="Supplier"/>
  904. </Tables>
  905. </SearchSupplier>
  906. <SearchEmployee CmdType="Text" CmdText="
  907. SELECT No_Employee,Name_Employee
  908. FROM Employee
  909. ORDER BY No_Employee
  910. ">
  911. <Tables>
  912. <Table name="Employee"/>
  913. </Tables>
  914. </SearchEmployee>
  915. <SearchPrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee AS No_Principal, Employee.Name_Employee AS Name_Principal
  916. FROM Employee
  917. ORDER BY No_Employee
  918. ">
  919. <Tables>
  920. <Table name="Principal" />
  921. </Tables>
  922. </SearchPrincipal>
  923. <SearchLinkman CmdType="Text" CmdText="
  924. SELECT Name_Linkman,No_Employee
  925. FROM Linkman
  926. LEFT JOIN Employee ON Linkman.Name_Linkman=Employee.Name_Employee
  927. WHERE ID_Person=@ID_Supplier
  928. Order By No_Employee
  929. ">
  930. <Params>
  931. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  932. </Params>
  933. <Tables>
  934. <Table name="Linkman"/>
  935. </Tables>
  936. </SearchLinkman>
  937. <SearchTelephone CmdType="Text" CmdText="
  938. SELECT No_Telephone
  939. FROM Telephone
  940. WHERE ID_Person=@ID_Supplier
  941. ">
  942. <Params>
  943. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  944. </Params>
  945. <Tables>
  946. <Table name="Telephone"/>
  947. </Tables>
  948. </SearchTelephone>
  949. <SearchFocusTelephone CmdType="Text" CmdText="
  950. SELECT No_Telephone
  951. FROM Telephone
  952. WHERE ID_Person=@ID_Supplier AND Focus_Telephone=1
  953. ">
  954. <Params>
  955. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  956. </Params>
  957. <Tables>
  958. <Table name="FocusTelephone"/>
  959. </Tables>
  960. </SearchFocusTelephone>
  961. <SearchFax CmdType="Text" CmdText="
  962. SELECT No_Fax
  963. FROM Fax
  964. WHERE ID_Person=@ID_Supplier
  965. ">
  966. <Params>
  967. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  968. </Params>
  969. <Tables>
  970. <Table name="Fax"/>
  971. </Tables>
  972. </SearchFax>
  973. <SearchFocusFax CmdType="Text" CmdText="
  974. SELECT No_Fax
  975. FROM Fax
  976. WHERE ID_Person=@ID_Supplier AND Focus_Fax=1
  977. ">
  978. <Params>
  979. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  980. </Params>
  981. <Tables>
  982. <Table name="FocusFax"/>
  983. </Tables>
  984. </SearchFocusFax>
  985. <SearchFocusLinkman CmdType="Text" CmdText="
  986. SELECT Linkman.Name_Linkman FROM Linkman WHERE Linkman.ID_Person = @ID_Supplier
  987. ">
  988. <Params>
  989. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0"/>
  990. </Params>
  991. <Tables>
  992. <Table name="Linkman"/>
  993. </Tables>
  994. </SearchFocusLinkman>
  995. <SearchProduct CmdType="Text" CmdText="
  996. SELECT ID_Product, Name_Product,Unit_Product,Price_Product,SuspendDate_Product
  997. FROM Product
  998. WHERE No_Product=@No_Product
  999. ">
  1000. <Params>
  1001. <Param name="@No_Product" type="Product.No_Product" Index="0"/>
  1002. </Params>
  1003. <Tables>
  1004. <Table name="Product"/>
  1005. </Tables>
  1006. </SearchProduct>
  1007. <SearchCessIn CmdType="Text" CmdText="
  1008. SELECT CessIn_SystemSetting ,SysCurrency_SystemSetting,QAudit_FunctionSetting FROM SystemSetting,FunctionSetting">
  1009. <Tables>
  1010. <Table name="SystemSetting"/>
  1011. </Tables>
  1012. </SearchCessIn>
  1013. <SearchFormat CmdType="Text" CmdText="
  1014. Select * from SystemSetting">
  1015. <Tables>
  1016. <Table name="SystemSettingFormat"/>
  1017. </Tables>
  1018. </SearchFormat>
  1019. <SearchPurchaseQueryBillFirst CmdType="Text" CmdText="
  1020. DECLARE @No_PurchaseQueryBill nvarchar(64)
  1021. DECLARE @ID_PurchaseQueryBill uniqueidentifier
  1022. SELECT Top 1 @ID_PurchaseQueryBill=ID_PurchaseQueryBill, @No_PurchaseQueryBill = No_PurchaseQueryBill
  1023. FROM PurchaseQueryBill
  1024. Order By No_PurchaseQueryBill
  1025. SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  1026. FROM PurchaseQueryBill
  1027. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  1028. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  1029. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  1030. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  1031. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  1032. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
  1033. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1034. SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money,@No_PurchaseQueryBill as No_PurchaseQueryBill
  1035. FROM PurchaseQueryBillProduct
  1036. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  1037. WHERE PurchaseQueryBillProduct.ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1038. Order By CAST(PurchaseQueryBillProduct.No_PurchaseQueryBillProduct AS INT)
  1039. SELECT BillComment.*
  1040. FROM BillComment
  1041. WHERE ID_Bill=@ID_PurchaseQueryBill
  1042. ORDER BY BillComment.No_BillComment
  1043. SELECT ReportComment.*,@No_PurchaseQueryBill as No_PurchaseQueryBill
  1044. FROM ReportComment
  1045. WHERE ID_Bill=@ID_PurchaseQueryBill
  1046. ORDER BY ReportComment.No_ReportComment
  1047. ">
  1048. <Tables>
  1049. <Table name="PurchaseQueryBill"/>
  1050. <Table name="PurchaseQueryBillProduct"/>
  1051. <Table name="BillComment"/>
  1052. <Table name="ReportComment"/>
  1053. </Tables>
  1054. </SearchPurchaseQueryBillFirst>
  1055. <SearchPurchaseQueryBillPrev CmdType="Text" CmdText=" DECLARE @NoNext nvarchar(64)
  1056. DECLARE @ID_PurchaseQueryBill uniqueidentifier
  1057. SELECT Top 1 @ID_PurchaseQueryBill=ID_PurchaseQueryBill, @NoNext = No_PurchaseQueryBill
  1058. FROM PurchaseQueryBill
  1059. WHERE No_PurchaseQueryBill &lt; @No_PurchaseQueryBill
  1060. ORDER By No_PurchaseQueryBill Desc
  1061. SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  1062. FROM PurchaseQueryBill
  1063. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  1064. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  1065. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  1066. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  1067. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  1068. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
  1069. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1070. SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money, @NoNext as No_PurchaseQueryBill
  1071. FROM PurchaseQueryBillProduct
  1072. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  1073. LEFT JOIN PurchaseQueryBill ON PurchaseQueryBill.ID_PurchaseQueryBill = PurchaseQueryBillProduct.ID_PurchaseQueryBill
  1074. WHERE PurchaseQueryBillProduct.ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1075. Order By CAST(No_PurchaseQueryBillProduct AS INT)
  1076. SELECT BillComment.*
  1077. FROM BillComment
  1078. WHERE ID_Bill=@ID_PurchaseQueryBill
  1079. ORDER BY BillComment.No_BillComment
  1080. SELECT ReportComment.*,@NoNext as No_PurchaseQueryBill
  1081. FROM ReportComment
  1082. WHERE ID_Bill=@ID_PurchaseQueryBill
  1083. ORDER BY ReportComment.No_ReportComment
  1084. ">
  1085. <Params>
  1086. <Param name="@No_PurchaseQueryBill" type="PurchaseQueryBill.No_PurchaseQueryBill" Index="0"/>
  1087. </Params>
  1088. <Tables>
  1089. <Table name="PurchaseQueryBill"/>
  1090. <Table name="PurchaseQueryBillProduct"/>
  1091. <Table name="BillComment"/>
  1092. <Table name="ReportComment"/>
  1093. </Tables>
  1094. </SearchPurchaseQueryBillPrev>
  1095. <SearchPurchaseQueryBillNext CmdType="Text" CmdText=" DECLARE @NoNext nvarchar(64)
  1096. DECLARE @ID_PurchaseQueryBill uniqueidentifier
  1097. SELECT Top 1 @ID_PurchaseQueryBill=ID_PurchaseQueryBill,@NoNext = No_PurchaseQueryBill
  1098. FROM PurchaseQueryBill
  1099. WHERE No_PurchaseQueryBill &gt; @No_PurchaseQueryBill
  1100. ORDER By No_PurchaseQueryBill
  1101. SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  1102. FROM PurchaseQueryBill
  1103. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  1104. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  1105. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  1106. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  1107. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  1108. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
  1109. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1110. SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money, @NoNext as No_PurchaseQueryBill
  1111. FROM PurchaseQueryBillProduct
  1112. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  1113. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1114. Order By CAST(No_PurchaseQueryBillProduct AS INT)
  1115. SELECT BillComment.*
  1116. FROM BillComment
  1117. WHERE ID_Bill=@ID_PurchaseQueryBill
  1118. ORDER BY BillComment.No_BillComment
  1119. SELECT ReportComment.*,@NoNext as No_PurchaseQueryBill
  1120. FROM ReportComment
  1121. WHERE ID_Bill=@ID_PurchaseQueryBill
  1122. ORDER BY ReportComment.No_ReportComment
  1123. ">
  1124. <Params>
  1125. <Param name="@No_PurchaseQueryBill" type="PurchaseQueryBill.No_PurchaseQueryBill" Index="0"/>
  1126. </Params>
  1127. <Tables>
  1128. <Table name="PurchaseQueryBill"/>
  1129. <Table name="PurchaseQueryBillProduct"/>
  1130. <Table name="BillComment"/>
  1131. <Table name="ReportComment"/>
  1132. </Tables>
  1133. </SearchPurchaseQueryBillNext>
  1134. <SearchPurchaseQueryBillLast CmdType="Text" CmdText="DECLARE @NoNext nvarchar(64)
  1135. DECLARE @ID_PurchaseQueryBill uniqueidentifier
  1136. SELECT Top 1 @ID_PurchaseQueryBill=ID_PurchaseQueryBill,@NoNext = No_PurchaseQueryBill
  1137. FROM PurchaseQueryBill
  1138. Order By No_PurchaseQueryBill Desc
  1139. SELECT PurchaseQueryBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,ShortName_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END,RegistedAddress_Supplier,PostalCode_Supplier,EmpA.Name_Employee As Name_Principal,EmpA.No_Employee As No_Principal,EmpB.No_Employee As No_Linkman
  1140. FROM PurchaseQueryBill
  1141. LEFT JOIN AppUser a ON a.ID_User=PurchaseQueryBill.ID_Creator
  1142. LEFT JOIN AppUser b ON b.ID_User=PurchaseQueryBill.ID_Assessor
  1143. LEFT JOIN AppUser c ON c.ID_User=PurchaseQueryBill.LastModUser_PurchaseQueryBill
  1144. LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseQueryBill.ID_Supplier
  1145. LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseQueryBill.ID_Principal
  1146. LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseQueryBill.Name_Linkman
  1147. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1148. SELECT PurchaseQueryBillProduct.*,Product.No_Product,Name_Product,Product.Unit_Product,PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct*PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct As Money, @NoNext as No_PurchaseQueryBill
  1149. FROM PurchaseQueryBillProduct
  1150. LEFT JOIN Product ON PurchaseQueryBillProduct.ID_Product=Product.ID_Product
  1151. WHERE ID_PurchaseQueryBill=@ID_PurchaseQueryBill
  1152. Order By CAST(No_PurchaseQueryBillProduct AS INT)
  1153. SELECT BillComment.*
  1154. FROM BillComment
  1155. WHERE ID_Bill=@ID_PurchaseQueryBill
  1156. ORDER BY BillComment.No_BillComment
  1157. SELECT ReportComment.*,@NoNext as No_PurchaseQueryBill
  1158. FROM ReportComment
  1159. WHERE ID_Bill=@ID_PurchaseQueryBill
  1160. ORDER BY ReportComment.No_ReportComment
  1161. ">
  1162. <Tables>
  1163. <Table name="PurchaseQueryBill"/>
  1164. <Table name="PurchaseQueryBillProduct"/>
  1165. <Table name="BillComment"/>
  1166. <Table name="ReportComment"/>
  1167. </Tables>
  1168. </SearchPurchaseQueryBillLast>
  1169. <SearchTypeComment CmdType="Text" CmdText="
  1170. declare @QRemark1_FunctionSetting int
  1171. declare @QRemark2_FunctionSetting int
  1172. Select @QRemark1_FunctionSetting = QRemark1_FunctionSetting, @QRemark2_FunctionSetting = QRemark2_FunctionSetting
  1173. from FunctionSetting
  1174. declare @ID_PurchaseQueryBill uniqueidentifier
  1175. declare @flag int
  1176. set @flag = 0
  1177. if @QRemark1_FunctionSetting = 0
  1178. begin
  1179. select top 1 @ID_PurchaseQueryBill = PurchaseQueryBill.ID_PurchaseQueryBill
  1180. from PurchaseQueryBill
  1181. where ID_Supplier = @ID_Supplier
  1182. order by PurchaseQueryBill.Date_PurchaseQueryBill desc
  1183. if exists( select ReportComment.* from ReportComment where ReportComment.ID_Bill = @ID_PurchaseQueryBill)
  1184. begin
  1185. select ReportComment.Comment_ReportComment from ReportComment where ReportComment.ID_Bill = @ID_PurchaseQueryBill
  1186. ORDER BY ReportComment.No_ReportComment
  1187. set @flag = 1
  1188. end
  1189. end
  1190. else
  1191. begin
  1192. if exists(SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef=26 )
  1193. begin
  1194. SELECT Name_TypeDef as Comment_BillComment FROM TypeDef WHERE Type_TypeDef=26
  1195. set @flag = 1
  1196. end
  1197. end
  1198. if @flag = 0
  1199. begin
  1200. if @QRemark2_FunctionSetting = 0
  1201. begin
  1202. select top 1 @ID_PurchaseQueryBill = PurchaseQueryBill.ID_PurchaseQueryBill
  1203. from PurchaseQueryBill
  1204. where ID_Supplier = @ID_Supplier
  1205. order by PurchaseQueryBill.Date_PurchaseQueryBill desc
  1206. select ReportComment.Comment_ReportComment from ReportComment where ReportComment.ID_Bill = @ID_PurchaseQueryBill
  1207. ORDER BY ReportComment.No_ReportComment
  1208. end
  1209. else
  1210. begin
  1211. SELECT Name_TypeDef as Comment_ReportComment FROM TypeDef WHERE Type_TypeDef=26
  1212. end
  1213. end
  1214. ">
  1215. <Params>
  1216. <Param name="@ID_Supplier" type="PurchaseQueryBill.ID_Supplier" Index="0" />
  1217. </Params>
  1218. <Tables>
  1219. <Table name="TypeComment" />
  1220. </Tables>
  1221. </SearchTypeComment>
  1222. </Search>
  1223. </Server>
  1224. <Lables>
  1225. <Search>
  1226. Empty();
  1227. NewInstance();
  1228. tbNo.ReadOnly=false;
  1229. timeMake.Enabled=false;
  1230. dtpRespondDate.Enabled=false;
  1231. dtpValidityDate.Enabled=false;
  1232. tbNoSupplier.ReadOnly=true;
  1233. cbTaxCurrency.Enabled=false;
  1234. cbCurrency.Enabled=false;
  1235. cbPrincipal.Enabled=false;
  1236. cbLinkman.Enabled=false;
  1237. cbTelephone.Enabled=false;
  1238. cbFax.Enabled=false;
  1239. dgProduct.ReadOnly=true;
  1240. dgRemark.ReadOnly=true;
  1241. dgReportComment.ReadOnly=true;
  1242. txtNumSum.CValue=0.00;
  1243. txtMoneySum.CValue=0.00;
  1244. txtTaxSum.CValue=0.00;
  1245. txtSum.CValue=0.00;
  1246. cbTaxCurrency.Text="";
  1247. #PurchaseQueryBill.Creator=DBNull();
  1248. #PurchaseQueryBill.ID_Creator=DBNull();
  1249. #PurchaseQueryBill.Assessor=DBNull();
  1250. #PurchaseQueryBill.ID_Assessor=DBNull();
  1251. #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DBNull();
  1252. #PurchaseQueryBill.LastModUser_PurchaseQueryBill=DBNull();
  1253. #PurchaseQueryBill.LastModUser=DBNull();
  1254. #PurchaseQueryBill.LastModDate_PurchaseQueryBill=DBNull();
  1255. toolBar.EnableSubmit=false;
  1256. toolBar.EnableModify=false;
  1257. toolBar.EnableDelete=false;
  1258. toolBar.EnableAudit=false;
  1259. toolBar.EnableUnAudit=false;
  1260. toolBar.EnablePrint=false;
  1261. toolBar.EnableNew=GetRight(@Title,"新增");
  1262. toolBar.EnableExport = false;
  1263. toolBar.EnableImport = false;
  1264. UpdateForm(true,"");
  1265. tbNo.Focus();
  1266. @Status=0;
  1267. </Search>
  1268. <New>
  1269. Empty();
  1270. NewInstance();
  1271. tbNo.ReadOnly=true;
  1272. timeMake.Enabled=true;
  1273. dtpRespondDate.Enabled=true;
  1274. dtpValidityDate.Enabled=true;
  1275. tbNoSupplier.ReadOnly=false;
  1276. cbTaxCurrency.Enabled=true;
  1277. cbCurrency.Enabled=false;
  1278. cbPrincipal.Enabled=true;
  1279. cbLinkman.Enabled=true;
  1280. cbTelephone.Enabled=true;
  1281. cbFax.Enabled=true;
  1282. dgProduct.ReadOnly=false;
  1283. dgRemark.ReadOnly=false;
  1284. dgReportComment.ReadOnly=false;
  1285. txtNumSum.CValue=0.00;
  1286. txtMoneySum.CValue=0.00;
  1287. txtTaxSum.CValue=0.00;
  1288. txtSum.CValue=0.00;
  1289. timeMake.Focus();
  1290. #PurchaseQueryBill.TaxCurrency_PurchaseQueryBill= "外加";
  1291. #PurchaseQueryBill.Currency_PurchaseQueryBill= @SysCurrency;
  1292. #PurchaseQueryBill.ID_PurchaseQueryBill=NewGuid();
  1293. #PurchaseQueryBill.Creator=GetCurrentUser();
  1294. #PurchaseQueryBill.ID_Creator=GetLoginUserID();
  1295. #PurchaseQueryBill.Assessor=DBNull();
  1296. #PurchaseQueryBill.ID_Assessor=DBNull();
  1297. #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DBNull();
  1298. #PurchaseQueryBill.LastModUser=DBNull();
  1299. #PurchaseQueryBill.LastModUser_PurchaseQueryBill=DBNull();
  1300. #PurchaseQueryBill.LastModDate_PurchaseQueryBill=DBNull();
  1301. #PurchaseQueryBill.Date_PurchaseQueryBill=GetCurrentTime();
  1302. toolBar.EnableSubmit=GetRight(@Title,"新增");
  1303. toolBar.EnableModify=false;
  1304. toolBar.EnableDelete=false;
  1305. toolBar.EnableAudit=false;
  1306. toolBar.EnableUnAudit=false;
  1307. toolBar.EnableNew=false;
  1308. toolBar.EnablePrint=false;
  1309. toolBar.EnableExport = false;
  1310. toolBar.EnableImport = true;
  1311. SetColumnDefaultValue("PurchaseQueryBillProduct", "Quantity_PurchaseQueryBillProduct",1 );
  1312. UpdateForm(true,"");
  1313. @Status=1;
  1314. </New>
  1315. <View>
  1316. tbNo.ReadOnly=false;
  1317. timeMake.Enabled=false;
  1318. dtpRespondDate.Enabled=false;
  1319. dtpValidityDate.Enabled=false;
  1320. tbNoSupplier.ReadOnly=true;
  1321. cbTaxCurrency.Enabled=false;
  1322. cbCurrency.Enabled=false;
  1323. cbPrincipal.Enabled=false;
  1324. cbLinkman.Enabled=false;
  1325. cbTelephone.Enabled=false;
  1326. cbFax.Enabled=false;
  1327. dgProduct.ReadOnly=true;
  1328. dgRemark.ReadOnly=true;
  1329. dgReportComment.ReadOnly=true;
  1330. toolBar.EnableSubmit=false;
  1331. toolBar.EnablePrint=GetRight(@Title,"打印");
  1332. toolBar.EnableNew=GetRight(@Title,"新增");
  1333. if(Equals(#PurchaseQueryBill.ID_Assessor, DBNull()))
  1334. {
  1335. toolBar.EnableAudit=GetRight(@Title,"审核");
  1336. toolBar.EnableUnAudit=false;
  1337. toolBar.EnableModify=GetRight(@Title,"修改");
  1338. toolBar.EnableDelete=GetRight(@Title,"删除");
  1339. }
  1340. else
  1341. {
  1342. toolBar.EnableAudit=false;
  1343. toolBar.EnableUnAudit=GetRight(@Title,"取消审核");
  1344. toolBar.EnableModify=false;
  1345. toolBar.EnableDelete=false;
  1346. }
  1347. toolBar.EnableExport = true;
  1348. toolBar.EnableImport = false;
  1349. tbNo.Focus();
  1350. UpdateForm(true, "");
  1351. @Status=2;
  1352. </View>
  1353. <Modify>
  1354. tbNo.ReadOnly=true;
  1355. timeMake.Enabled=false;
  1356. dtpRespondDate.Enabled=true;
  1357. dtpValidityDate.Enabled=true;
  1358. tbNoSupplier.ReadOnly=false;
  1359. cbCurrency.Enabled=false;
  1360. cbPrincipal.Enabled=true;
  1361. cbLinkman.Enabled=true;
  1362. cbTelephone.Enabled=true;
  1363. cbFax.Enabled=true;
  1364. dgProduct.ReadOnly=false;
  1365. dgRemark.ReadOnly=false;
  1366. dgReportComment.ReadOnly=false;
  1367. #PurchaseQueryBill.LastModUser=GetCurrentUser();
  1368. #PurchaseQueryBill.LastModUser_PurchaseQueryBill=GetLoginUserID();
  1369. #PurchaseQueryBill.LastModDate_PurchaseQueryBill=GetCurrentTime();
  1370. toolBar.EnableSubmit=GetRight(@Title,"修改");
  1371. toolBar.EnableModify=false;
  1372. toolBar.EnableDelete=false;
  1373. toolBar.EnableAudit=false;
  1374. toolBar.EnableUnAudit=false;
  1375. toolBar.EnableNew=false;
  1376. toolBar.EnablePrint=false;
  1377. toolBar.EnableExport = false;
  1378. toolBar.EnableImport = false;
  1379. SetColumnDefaultValue("PurchaseQueryBillProduct", "Quantity_PurchaseQueryBillProduct",1 );
  1380. @HaveAccessed = !Equals(#PurchaseQueryBill.AssessDate_PurchaseQueryBill,DBNull());
  1381. if(@HaveAccessed)
  1382. cbTaxCurrency.Enabled = false;
  1383. else
  1384. cbTaxCurrency.Enabled = true;
  1385. UpdateForm(true, "");
  1386. @Status=3;
  1387. </Modify>
  1388. <SubmitButtonClick>
  1389. <![CDATA[
  1390. if(!Search("SearchSupplier",tbNoSupplier.CValue)|| !Equals(#PurchaseQueryBill.ID_Supplier,#Supplier.ID_Supplier))
  1391. {
  1392. MessageBox("请输入有效的供应商,回车以示确认!",@Title);
  1393. tbDetail.SelectedIndex = 0;
  1394. tbNoSupplier.Focus();
  1395. return;
  1396. }
  1397. if (!cbTaxCurrency.CheckSelectedItem())
  1398. {
  1399. MessageBox("请选择有效的税别!",@Title);
  1400. tbDetail.SelectedIndex = 0;
  1401. cbTaxCurrency.Focus();
  1402. return;
  1403. }
  1404. if (!cbPrincipal.CheckSelectedItem())
  1405. {
  1406. MessageBox("请选择有效的负责业务!",@Title);
  1407. tbDetail.SelectedIndex = 0;
  1408. cbPrincipal.Focus();
  1409. return;
  1410. }
  1411. if(RowCount("#PurchaseQueryBillProduct")==0)
  1412. {
  1413. MessageBox("请输入采购产品!",@Title);
  1414. tbDetail.SelectedIndex = 1;
  1415. dgProduct.Focus();
  1416. return;
  1417. }
  1418. UpdateForm(false, "");
  1419. SuspendLayout();
  1420. for(@i=0;@i<RowCount("#PurchaseQueryBillProduct");@i=@i+1)
  1421. {
  1422. SetPosition("#PurchaseQueryBillProduct",@i);
  1423. if(Equals(#PurchaseQueryBillProduct.No_Product,""))
  1424. {
  1425. tbDetail.SelectedIndex = 1;
  1426. dgProduct.CurrentRowIndex=@i;
  1427. MessageBox("请输入产品编号!",@Title);
  1428. ResumeLayout();
  1429. return;
  1430. }
  1431. if(Equals(#PurchaseQueryBillProduct.ID_Product,GuidEmpty()))
  1432. {
  1433. tbDetail.SelectedIndex = 1;
  1434. dgProduct.CurrentRowIndex=@i;
  1435. MessageBox("该产品不存在!",@Title);
  1436. ResumeLayout();
  1437. return;
  1438. }
  1439. if(#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct<=0)
  1440. {
  1441. tbDetail.SelectedIndex = 1;
  1442. dgProduct.CurrentRowIndex=@i;
  1443. MessageBox("数量不得小于等于0!",@Title);
  1444. ResumeLayout();
  1445. return;
  1446. }
  1447. if(#PurchaseQueryBillProduct.UnitPrice_PurchaseQueryBillProduct<0)
  1448. {
  1449. tbDetail.SelectedIndex = 1;
  1450. dgProduct.CurrentRowIndex=@i;
  1451. MessageBox("单价不得小于0!",@Title);
  1452. ResumeLayout();
  1453. return;
  1454. }
  1455. if(Equals(#PurchaseQueryBillProduct.ID_PurchaseQueryBillProduct,GuidEmpty()))
  1456. {
  1457. #PurchaseQueryBillProduct.ID_PurchaseQueryBillProduct=NewGuid();
  1458. }
  1459. #PurchaseQueryBillProduct.ID_PurchaseQueryBill=#PurchaseQueryBill.ID_PurchaseQueryBill;
  1460. }
  1461. for(@j=0;@j<RowCount("#BillComment");@j++)
  1462. {
  1463. SetPosition("#BillComment",@j);
  1464. if(Equals(#BillComment.ID_BillComment,GuidEmpty()))
  1465. {
  1466. #BillComment.ID_BillComment=NewGuid();
  1467. }
  1468. #BillComment.ID_Bill=#PurchaseQueryBill.ID_PurchaseQueryBill;
  1469. }
  1470. for(@j=0;@j<RowCount("#ReportComment");@j++)
  1471. {
  1472. SetPosition("#ReportComment",@j);
  1473. if(Equals(#ReportComment.ID_ReportComment,GuidEmpty()))
  1474. {
  1475. #ReportComment.ID_ReportComment=NewGuid();
  1476. }
  1477. #ReportComment.ID_Bill=#PurchaseQueryBill.ID_PurchaseQueryBill;
  1478. }
  1479. ResumeLayout();
  1480. if(@Status==1)
  1481. { #PurchaseQueryBill.CreateDate_PurchaseQueryBill=GetCurrentTime();
  1482. #PurchaseQueryBill.No_PurchaseQueryBill = New("#PurchaseQueryBill.No_PurchaseQueryBill",timeMake.CValue);
  1483. }
  1484. else if(@Status==3)
  1485. {
  1486. #PurchaseQueryBill.LastModUser=GetCurrentUser();
  1487. #PurchaseQueryBill.LastModUser_PurchaseQueryBill=GetLoginUserID();
  1488. #PurchaseQueryBill.LastModDate_PurchaseQueryBill=GetCurrentTime();
  1489. Update();
  1490. }
  1491. ChangeMode("View");
  1492. ]]>
  1493. </SubmitButtonClick>
  1494. <CountSum>
  1495. <![CDATA[
  1496. if (RowCount("#PurchaseQueryBillProduct") == 0)
  1497. {
  1498. txtNumSum.CValue=0;
  1499. txtMoneySum.CValue=0;;
  1500. txtTaxSum.CValue=0;
  1501. txtSum.CValue=0;
  1502. }
  1503. else
  1504. {
  1505. txtNumSum.CValue = SumOfCol("#PurchaseQueryBillProduct.Quantity_PurchaseQueryBillProduct");
  1506. switch (cbTaxCurrency.SelectedName)
  1507. {
  1508. case "外加":
  1509. txtMoneySum.CValue=SumOfCol("#PurchaseQueryBillProduct.Money");
  1510. txtTaxSum.CValue=FormatNumber(txtMoneySum.CValue*@CessIn,@PriceDecimal);
  1511. txtSum.CValue=txtMoneySum.CValue+txtTaxSum.CValue;
  1512. break;
  1513. case "内含":
  1514. txtSum.CValue=SumOfCol("#PurchaseQueryBillProduct.Money");
  1515. txtMoneySum.CValue=FormatNumber(txtSum.CValue/(1+@CessIn),@PriceDecimal);
  1516. txtTaxSum.CValue=txtSum.CValue-txtMoneySum.CValue;
  1517. break;
  1518. case "零税":
  1519. case "免税":
  1520. txtMoneySum.CValue=SumOfCol("#PurchaseQueryBillProduct.Money");
  1521. txtTaxSum.CValue=0;
  1522. txtSum.CValue=txtMoneySum.CValue+txtTaxSum.CValue;
  1523. break;
  1524. }
  1525. UpdateForm(false, "txtMoneySum");
  1526. UpdateForm(false, "txtTaxSum");
  1527. UpdateForm(false, "txtSum");
  1528. }
  1529. ]]>
  1530. </CountSum>
  1531. <AuditLable>
  1532. BeginAudit();
  1533. #PurchaseQueryBill.ID_Assessor=GetLoginUserID();
  1534. #PurchaseQueryBill.Assessor=GetCurrentUser();
  1535. #PurchaseQueryBill.AssessDate_PurchaseQueryBill=DateTimeNow();
  1536. Audit();
  1537. ChangeMode("View");
  1538. EndAudit();
  1539. </AuditLable>
  1540. </Lables>
  1541. </Form>
  1542. </Forms>