w_accset_info.srw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. $PBExportHeader$w_accset_info.srw
  2. forward
  3. global type w_accset_info from w_publ_base
  4. end type
  5. type tab_accsetinfo from tab within w_accset_info
  6. end type
  7. type tabpage_1 from userobject within tab_accsetinfo
  8. end type
  9. type dw_1 from datawindow within tabpage_1
  10. end type
  11. type tabpage_1 from userobject within tab_accsetinfo
  12. dw_1 dw_1
  13. end type
  14. type tabpage_2 from userobject within tab_accsetinfo
  15. end type
  16. type dw_2 from datawindow within tabpage_2
  17. end type
  18. type dw_credenceword_index from datawindow within tabpage_2
  19. end type
  20. type cb_4 from uo_imflatbutton within tabpage_2
  21. end type
  22. type cb_5 from uo_imflatbutton within tabpage_2
  23. end type
  24. type tabpage_2 from userobject within tab_accsetinfo
  25. dw_2 dw_2
  26. dw_credenceword_index dw_credenceword_index
  27. cb_4 cb_4
  28. cb_5 cb_5
  29. end type
  30. type tabpage_3 from userobject within tab_accsetinfo
  31. end type
  32. type em_1 from editmask within tabpage_3
  33. end type
  34. type st_2 from statictext within tabpage_3
  35. end type
  36. type dw_3 from datawindow within tabpage_3
  37. end type
  38. type cb_2 from uo_imflatbutton within tabpage_3
  39. end type
  40. type cb_7 from uo_imflatbutton within tabpage_3
  41. end type
  42. type tabpage_3 from userobject within tab_accsetinfo
  43. em_1 em_1
  44. st_2 st_2
  45. dw_3 dw_3
  46. cb_2 cb_2
  47. cb_7 cb_7
  48. end type
  49. type tabpage_4 from userobject within tab_accsetinfo
  50. end type
  51. type dw_4 from datawindow within tabpage_4
  52. end type
  53. type tabpage_4 from userobject within tab_accsetinfo
  54. dw_4 dw_4
  55. end type
  56. type tab_accsetinfo from tab within w_accset_info
  57. tabpage_1 tabpage_1
  58. tabpage_2 tabpage_2
  59. tabpage_3 tabpage_3
  60. tabpage_4 tabpage_4
  61. end type
  62. type cb_1 from uo_imflatbutton within w_accset_info
  63. end type
  64. end forward
  65. global type w_accset_info from w_publ_base
  66. integer width = 2167
  67. integer height = 1344
  68. string title = "帐套选项"
  69. boolean minbox = false
  70. long backcolor = 80269524
  71. tab_accsetinfo tab_accsetinfo
  72. cb_1 cb_1
  73. end type
  74. global w_accset_info w_accset_info
  75. type variables
  76. datawindow dw1,dw2,dw3,dw4
  77. uo_accset uo_newaccset
  78. s_subject_array ins_s_subject
  79. datastore ds_initsubject
  80. end variables
  81. forward prototypes
  82. public function integer wf_import_subject (ref string arg_msg)
  83. public function integer wf_get_subject (long arg_cropid, ref string arg_msg)
  84. end prototypes
  85. public function integer wf_import_subject (ref string arg_msg);String ls_filename
  86. ds_initsubject = CREATE datastore
  87. ds_initsubject.DataObject = "d_subjectdata_import"
  88. ds_initsubject.SetTransObject(sqlca)
  89. ls_filename = sys_cur_path +'initdata.dbf'
  90. IF NOT FileExists ( ls_filename ) THEN
  91. arg_msg = '初始化科目失败,没有找到科目文件'
  92. RETURN 0
  93. END IF
  94. IF ds_initsubject.ImportFile ( ls_filename ) <= 0 THEN
  95. arg_msg = '初始化科目失败,导入科目数据失败或文件中没有相应企业的科目'
  96. RETURN 0
  97. END IF
  98. RETURN 1
  99. end function
  100. public function integer wf_get_subject (long arg_cropid, ref string arg_msg);Long rslt = 1,itmxt = 0,i
  101. ds_initsubject.SetFilter('croptypeid = '+ String(arg_cropid))
  102. ds_initsubject.Filter( )
  103. IF ds_initsubject.RowCount() > 0 THEN
  104. FOR i = 1 To ds_initsubject.RowCount()
  105. itmxt++
  106. ins_s_subject.croptypeid[itmxt] = ds_initsubject.Object.croptypeid[i]
  107. ins_s_subject.subid[itmxt] = ds_initsubject.Object.subid[i]
  108. ins_s_subject.Name[itmxt] = ds_initsubject.Object.Name[i]
  109. ins_s_subject.dcflag[itmxt] = ds_initsubject.Object.dcflag[i]
  110. ins_s_subject.detailflag[itmxt] = ds_initsubject.Object.detailflag[i]
  111. ins_s_subject.hswb[itmxt] = ds_initsubject.Object.hswb[i]
  112. ins_s_subject.moneyid[itmxt] = ds_initsubject.Object.moneyid[i]
  113. ins_s_subject.hsqty[itmxt] = ds_initsubject.Object.hsqty[i]
  114. ins_s_subject.unit[itmxt] = ds_initsubject.Object.unit[i]
  115. ins_s_subject.hsdept[itmxt] = ds_initsubject.Object.hsdept[i]
  116. ins_s_subject.hsemp[itmxt] = ds_initsubject.Object.hsemp[i]
  117. ins_s_subject.hsitem[itmxt] = ds_initsubject.Object.hsitem[i]
  118. ins_s_subject.hstrader[itmxt] = ds_initsubject.Object.hstrader[i]
  119. ins_s_subject.attrflag[itmxt] = ds_initsubject.Object.attrflag[i]
  120. ins_s_subject.specialcode[itmxt] = ds_initsubject.Object.specialcode[i]
  121. ins_s_subject.relevantid[itmxt] = ds_initsubject.Object.relevantid[i]
  122. IF IsNull(ds_initsubject.Object.relevantid[i]) THEN
  123. MessageBox("","")
  124. END IF
  125. NEXT
  126. END IF
  127. RETURN rslt
  128. end function
  129. on w_accset_info.create
  130. int iCurrent
  131. call super::create
  132. this.tab_accsetinfo=create tab_accsetinfo
  133. this.cb_1=create cb_1
  134. iCurrent=UpperBound(this.Control)
  135. this.Control[iCurrent+1]=this.tab_accsetinfo
  136. this.Control[iCurrent+2]=this.cb_1
  137. end on
  138. on w_accset_info.destroy
  139. call super::destroy
  140. destroy(this.tab_accsetinfo)
  141. destroy(this.cb_1)
  142. end on
  143. event open;call super::open;Long cnt = 0
  144. String arg_msg
  145. uo_newaccset = CREATE uo_accset
  146. IF wf_import_subject(arg_msg) = 0 THEN
  147. MessageBox(publ_operator, arg_msg)
  148. Close(This)
  149. END IF
  150. SELECT count(*) INTO :cnt
  151. From cw_accset;
  152. IF sqlca.SQLCode <> 0 THEN
  153. cnt = 0
  154. END IF
  155. IF cnt = 0 THEN
  156. INSERT INTO cw_accset
  157. (accsetid,accsetname,step1,step2,step3,step4,step5,step6,ifnewsubid)
  158. VALUES
  159. (11,'000',4,3,3,3,3,2,1);
  160. IF sqlca.SQLCode <> 0 THEN
  161. arg_msg = sqlca.SQLErrText
  162. ROLLBACK;
  163. MessageBox('提示','建立帐套失败,原因:'+arg_msg)
  164. ELSE
  165. //取科目
  166. IF wf_get_subject(0,arg_msg) = 0 THEN
  167. MessageBox(publ_operator,arg_msg)
  168. RETURN
  169. END IF
  170. uo_newaccset.accsetid = 11
  171. IF uo_newaccset.subject_arrray(ins_s_subject,arg_msg,False) = 0 THEN
  172. MessageBox(publ_operator,arg_msg)
  173. RETURN
  174. END IF
  175. COMMIT;
  176. END IF
  177. END IF
  178. dw1 = tab_accsetinfo.tabpage_1.dw_1
  179. dw2 = tab_accsetinfo.tabpage_2.dw_2
  180. dw3 = tab_accsetinfo.tabpage_3.dw_3
  181. dw4 = tab_accsetinfo.tabpage_4.dw_4
  182. dw1.SetTransObject(sqlca)
  183. dw2.SetTransObject(sqlca)
  184. dw3.SetTransObject(sqlca)
  185. dw4.SetTransObject(sqlca)
  186. tab_accsetinfo.tabpage_2.dw_credenceword_index.SetTransObject(sqlca)
  187. dw1.Retrieve(sys_accsetid)
  188. dw2.Retrieve(sys_accsetid)
  189. tab_accsetinfo.tabpage_3.cb_2.TriggerEvent(Clicked!) //retrieve dw3)
  190. Int li_ifstart
  191. IF sys_accsetbegin THEN
  192. li_ifstart = 1
  193. ELSE
  194. li_ifstart = 0
  195. END IF
  196. dw4.Retrieve(sys_accsetid,li_ifstart)
  197. tab_accsetinfo.tabpage_2.dw_credenceword_index.Retrieve(sys_accsetid)
  198. end event
  199. event close;call super::close;Destroy uo_accset
  200. end event
  201. type cb_func from w_publ_base`cb_func within w_accset_info
  202. boolean visible = false
  203. integer x = 1783
  204. integer y = 1184
  205. boolean enabled = false
  206. end type
  207. type cb_exit from w_publ_base`cb_exit within w_accset_info
  208. integer x = 1120
  209. integer y = 1116
  210. end type
  211. type tab_accsetinfo from tab within w_accset_info
  212. integer x = 46
  213. integer y = 24
  214. integer width = 2043
  215. integer height = 1068
  216. integer taborder = 20
  217. integer textsize = -9
  218. integer weight = 400
  219. fontcharset fontcharset = gb2312charset!
  220. fontpitch fontpitch = variable!
  221. string facename = "宋体"
  222. long backcolor = 80269524
  223. boolean raggedright = true
  224. integer selectedtab = 1
  225. tabpage_1 tabpage_1
  226. tabpage_2 tabpage_2
  227. tabpage_3 tabpage_3
  228. tabpage_4 tabpage_4
  229. end type
  230. on tab_accsetinfo.create
  231. this.tabpage_1=create tabpage_1
  232. this.tabpage_2=create tabpage_2
  233. this.tabpage_3=create tabpage_3
  234. this.tabpage_4=create tabpage_4
  235. this.Control[]={this.tabpage_1,&
  236. this.tabpage_2,&
  237. this.tabpage_3,&
  238. this.tabpage_4}
  239. end on
  240. on tab_accsetinfo.destroy
  241. destroy(this.tabpage_1)
  242. destroy(this.tabpage_2)
  243. destroy(this.tabpage_3)
  244. destroy(this.tabpage_4)
  245. end on
  246. type tabpage_1 from userobject within tab_accsetinfo
  247. integer x = 18
  248. integer y = 112
  249. integer width = 2007
  250. integer height = 940
  251. long backcolor = 80269524
  252. string text = "企业信息"
  253. long tabtextcolor = 33554432
  254. long tabbackcolor = 80269524
  255. string picturename = "Custom092!"
  256. long picturemaskcolor = 553648127
  257. dw_1 dw_1
  258. end type
  259. on tabpage_1.create
  260. this.dw_1=create dw_1
  261. this.Control[]={this.dw_1}
  262. end on
  263. on tabpage_1.destroy
  264. destroy(this.dw_1)
  265. end on
  266. type dw_1 from datawindow within tabpage_1
  267. integer x = 87
  268. integer y = 40
  269. integer width = 1824
  270. integer height = 876
  271. integer taborder = 30
  272. boolean bringtotop = true
  273. string dataobject = "dw_accset_info"
  274. boolean border = false
  275. boolean livescroll = true
  276. end type
  277. type tabpage_2 from userobject within tab_accsetinfo
  278. integer x = 18
  279. integer y = 112
  280. integer width = 2007
  281. integer height = 940
  282. long backcolor = 80269524
  283. string text = "帐套参数"
  284. long tabtextcolor = 33554432
  285. long tabbackcolor = 80269524
  286. string picturename = "EditFuncDeclare!"
  287. long picturemaskcolor = 553648127
  288. dw_2 dw_2
  289. dw_credenceword_index dw_credenceword_index
  290. cb_4 cb_4
  291. cb_5 cb_5
  292. end type
  293. on tabpage_2.create
  294. this.dw_2=create dw_2
  295. this.dw_credenceword_index=create dw_credenceword_index
  296. this.cb_4=create cb_4
  297. this.cb_5=create cb_5
  298. this.Control[]={this.dw_2,&
  299. this.dw_credenceword_index,&
  300. this.cb_4,&
  301. this.cb_5}
  302. end on
  303. on tabpage_2.destroy
  304. destroy(this.dw_2)
  305. destroy(this.dw_credenceword_index)
  306. destroy(this.cb_4)
  307. destroy(this.cb_5)
  308. end on
  309. type dw_2 from datawindow within tabpage_2
  310. integer x = 32
  311. integer y = 88
  312. integer width = 1065
  313. integer height = 780
  314. integer taborder = 20
  315. boolean bringtotop = true
  316. string dataobject = "dw_accset_info2"
  317. boolean border = false
  318. boolean livescroll = true
  319. end type
  320. type dw_credenceword_index from datawindow within tabpage_2
  321. integer x = 1134
  322. integer y = 88
  323. integer width = 594
  324. integer height = 780
  325. integer taborder = 40
  326. boolean bringtotop = true
  327. string dataobject = "dw_credenceword_index"
  328. boolean livescroll = true
  329. borderstyle borderstyle = stylelowered!
  330. end type
  331. type cb_4 from uo_imflatbutton within tabpage_2
  332. integer x = 1737
  333. integer y = 124
  334. integer width = 233
  335. integer height = 96
  336. integer taborder = 40
  337. boolean bringtotop = true
  338. string text = "增加"
  339. end type
  340. event clicked;long li_row
  341. li_row=dw_credenceword_index.insertrow(0)
  342. dw_credenceword_index.object.accsetid[li_row]=sys_accsetid
  343. end event
  344. type cb_5 from uo_imflatbutton within tabpage_2
  345. integer x = 1737
  346. integer y = 224
  347. integer width = 233
  348. integer height = 96
  349. integer taborder = 40
  350. boolean bringtotop = true
  351. string text = "删除"
  352. end type
  353. event clicked;long li_row
  354. li_row=dw_credenceword_index.getrow()
  355. if li_row=0 then
  356. messagebox(publ_operator,'没有可删除凭证字')
  357. return
  358. end if
  359. dw_credenceword_index.deleterow(li_row)
  360. end event
  361. type tabpage_3 from userobject within tab_accsetinfo
  362. integer x = 18
  363. integer y = 112
  364. integer width = 2007
  365. integer height = 940
  366. long backcolor = 80269524
  367. string text = "会计月历"
  368. long tabtextcolor = 33554432
  369. long tabbackcolor = 80269524
  370. string picturename = "Custom023!"
  371. long picturemaskcolor = 553648127
  372. em_1 em_1
  373. st_2 st_2
  374. dw_3 dw_3
  375. cb_2 cb_2
  376. cb_7 cb_7
  377. end type
  378. on tabpage_3.create
  379. this.em_1=create em_1
  380. this.st_2=create st_2
  381. this.dw_3=create dw_3
  382. this.cb_2=create cb_2
  383. this.cb_7=create cb_7
  384. this.Control[]={this.em_1,&
  385. this.st_2,&
  386. this.dw_3,&
  387. this.cb_2,&
  388. this.cb_7}
  389. end on
  390. on tabpage_3.destroy
  391. destroy(this.em_1)
  392. destroy(this.st_2)
  393. destroy(this.dw_3)
  394. destroy(this.cb_2)
  395. destroy(this.cb_7)
  396. end on
  397. type em_1 from editmask within tabpage_3
  398. integer x = 366
  399. integer y = 48
  400. integer width = 370
  401. integer height = 92
  402. integer taborder = 40
  403. boolean bringtotop = true
  404. integer textsize = -9
  405. integer weight = 400
  406. fontcharset fontcharset = gb2312charset!
  407. fontpitch fontpitch = variable!
  408. string facename = "宋体"
  409. long textcolor = 33554432
  410. borderstyle borderstyle = stylelowered!
  411. string mask = "####"
  412. boolean spin = true
  413. end type
  414. event constructor;IF sys_accsetbegin THEN
  415. This.Text = Left(String(sys_curyearmon),4)
  416. ELSE
  417. IF sys_startyearmon = 0 THEN
  418. This.Text = String(Today(),'yyyy')
  419. ELSE
  420. This.Text = Left(String(sys_startyearmon),4)
  421. END IF
  422. END IF
  423. end event
  424. event modified;cb_2.triggerevent(clicked!)
  425. end event
  426. type st_2 from statictext within tabpage_3
  427. integer x = 82
  428. integer y = 68
  429. integer width = 283
  430. integer height = 76
  431. boolean bringtotop = true
  432. integer textsize = -9
  433. integer weight = 400
  434. fontcharset fontcharset = gb2312charset!
  435. fontpitch fontpitch = variable!
  436. string facename = "宋体"
  437. long textcolor = 33554432
  438. long backcolor = 67108864
  439. boolean enabled = false
  440. string text = "会计年度:"
  441. alignment alignment = right!
  442. boolean focusrectangle = false
  443. end type
  444. type dw_3 from datawindow within tabpage_3
  445. integer x = 841
  446. integer y = 12
  447. integer width = 1015
  448. integer height = 916
  449. integer taborder = 30
  450. boolean bringtotop = true
  451. string dataobject = "dw_accset_info3"
  452. boolean livescroll = true
  453. borderstyle borderstyle = stylelowered!
  454. end type
  455. type cb_2 from uo_imflatbutton within tabpage_3
  456. integer x = 741
  457. integer y = 48
  458. integer width = 91
  459. integer height = 92
  460. integer taborder = 50
  461. boolean bringtotop = true
  462. string text = ".."
  463. end type
  464. event clicked;dw_3.retrieve(sys_accsetid,long(em_1.text))
  465. end event
  466. type cb_7 from uo_imflatbutton within tabpage_3
  467. integer x = 430
  468. integer y = 156
  469. integer width = 384
  470. integer height = 92
  471. integer taborder = 50
  472. boolean bringtotop = true
  473. string text = "重新生成月历"
  474. end type
  475. event clicked;Long next_y,ll_cnt_next_y
  476. s_calendar s_calendar_array[]
  477. String arg_msg
  478. IF MessageBox (publ_operator,"是否确定要重置月历?(选择确定后先删除原月历,再重新生成新的月历)",Question!,YesNo! ) = 2 THEN
  479. RETURN
  480. END IF
  481. next_y = Long(Left(em_1.Text,4))
  482. DELETE FROM cw_calendar Where accsetid = :sys_accsetid;
  483. IF sqlca.SQLCode <> 0 THEN
  484. arg_msg = sqlca.SQLErrText
  485. ROLLBACK;
  486. MessageBox('提示','删除原月历失败,'+arg_msg)
  487. RETURN
  488. END IF
  489. f_init_calendar_array(next_y,s_calendar_array[])
  490. Long k
  491. FOR k = 1 TO UpperBound(s_calendar_array)
  492. INSERT INTO cw_calendar(accsetid,cmonth,sdate,edate)
  493. Values(:sys_accsetid,:s_calendar_array[k].cmonth,:s_calendar_array[k].sdate,:s_calendar_array[k].edate);
  494. IF sqlca.SQLCode <> 0 THEN
  495. arg_msg = String(s_calendar_array[k].cmonth)+',加入新月历失败,'+sqlca.SQLErrText
  496. ROLLBACK;
  497. MessageBox('提示',arg_msg)
  498. RETURN
  499. END IF
  500. NEXT
  501. COMMIT;
  502. MessageBox('提示','操作完成')
  503. //日志
  504. String ls_code
  505. ls_code = publ_operator
  506. f_setsysoplog('重置月历','重置月历,用户:'+ls_code,arg_msg,TRUE)
  507. //--
  508. cb_2.TriggerEvent(Clicked!)
  509. end event
  510. type tabpage_4 from userobject within tab_accsetinfo
  511. integer x = 18
  512. integer y = 112
  513. integer width = 2007
  514. integer height = 940
  515. long backcolor = 80269524
  516. string text = "凭证选项"
  517. long tabtextcolor = 33554432
  518. long tabbackcolor = 80269524
  519. string picturename = "Start!"
  520. long picturemaskcolor = 553648127
  521. dw_4 dw_4
  522. end type
  523. on tabpage_4.create
  524. this.dw_4=create dw_4
  525. this.Control[]={this.dw_4}
  526. end on
  527. on tabpage_4.destroy
  528. destroy(this.dw_4)
  529. end on
  530. type dw_4 from datawindow within tabpage_4
  531. integer x = 233
  532. integer y = 104
  533. integer width = 1330
  534. integer height = 736
  535. integer taborder = 20
  536. boolean bringtotop = true
  537. string dataobject = "dw_accset_info4"
  538. boolean border = false
  539. boolean livescroll = true
  540. end type
  541. type cb_1 from uo_imflatbutton within w_accset_info
  542. integer x = 617
  543. integer y = 1116
  544. integer width = 311
  545. integer height = 96
  546. integer taborder = 30
  547. boolean bringtotop = true
  548. string normalpicname = "ok.bmp"
  549. end type
  550. event clicked;String ls_errmsg
  551. dw1.AcceptText()
  552. IF dw1.UPDATE() = -1 THEN
  553. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  554. ROLLBACK;
  555. MessageBox (publ_operator,ls_errmsg+",保存企业信息操作失败!",Exclamation!,OK!)
  556. RETURN
  557. END IF
  558. dw2.AcceptText()
  559. IF dw2.UPDATE() = -1 THEN
  560. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  561. ROLLBACK;
  562. MessageBox (publ_operator,ls_errmsg+",保存帐套代号信息操作失败!",Exclamation!,OK!)
  563. RETURN
  564. END IF
  565. tab_accsetinfo.tabpage_2.dw_credenceword_index.AcceptText()
  566. IF tab_accsetinfo.tabpage_2.dw_credenceword_index.UPDATE() = -1 THEN
  567. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  568. ROLLBACK;
  569. MessageBox (publ_operator,ls_errmsg+",保存帐套参数操作失败!",Exclamation!,OK!)
  570. RETURN
  571. END IF
  572. dw3.AcceptText()
  573. IF dw3.UPDATE() = -1 THEN
  574. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  575. ROLLBACK;
  576. MessageBox (publ_operator,ls_errmsg+",保存会计月历操作失败!",Exclamation!,OK!)
  577. RETURN
  578. END IF
  579. dw4.AcceptText()
  580. IF dw4.UPDATE() = -1 THEN
  581. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  582. ROLLBACK;
  583. MessageBox (publ_operator,ls_errmsg+",保存凭证选项操作失败!",Exclamation!,OK!)
  584. RETURN
  585. END IF
  586. IF NOT sys_accsetbegin THEN
  587. s_calendar l_s_calendar[]
  588. Long arg_year
  589. String arg_msg
  590. arg_year = dw4.Object.startyear[1]
  591. f_init_calendar_array(arg_year,l_s_calendar[])
  592. DELETE FROM cw_calendar Where accsetid = :sys_accsetid;
  593. IF sqlca.SQLCode <> 0 THEN
  594. ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
  595. ROLLBACK;
  596. MessageBox (publ_operator,ls_errmsg+",删除原日历操作失败!",Exclamation!,OK!)
  597. RETURN
  598. END IF
  599. uo_accset uo_newaccset
  600. uo_newaccset = CREATE uo_accset
  601. uo_newaccset.accsetid = sys_accsetid
  602. IF uo_newaccset.new_calendar(l_s_calendar[],arg_msg,FALSE) = 0 THEN
  603. MessageBox(publ_operator,arg_msg)
  604. RETURN
  605. END IF
  606. DESTROY uo_newaccset
  607. END IF
  608. COMMIT;
  609. MessageBox(publ_operator,'帐套选项保存成功,系统将退出,请重新进入系统')
  610. HALT
  611. end event