w_reissue_cus_ljfieb.srw 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. $PBExportHeader$w_reissue_cus_ljfieb.srw
  2. forward
  3. global type w_reissue_cus_ljfieb from w_publ_base
  4. end type
  5. type dw_uc from datawindow within w_reissue_cus_ljfieb
  6. end type
  7. type dw_child from u_dw_rbtnfilter within w_reissue_cus_ljfieb
  8. end type
  9. type mle_1 from multilineedit within w_reissue_cus_ljfieb
  10. end type
  11. type st_1 from statictext within w_reissue_cus_ljfieb
  12. end type
  13. type st_2 from statictext within w_reissue_cus_ljfieb
  14. end type
  15. type sle_scname from singlelineedit within w_reissue_cus_ljfieb
  16. end type
  17. type cb_accept from uo_imflatbutton within w_reissue_cus_ljfieb
  18. end type
  19. type cb_feedback from uo_imflatbutton within w_reissue_cus_ljfieb
  20. end type
  21. type cb_reject from uo_imflatbutton within w_reissue_cus_ljfieb
  22. end type
  23. type mle_2 from multilineedit within w_reissue_cus_ljfieb
  24. end type
  25. type st_3 from statictext within w_reissue_cus_ljfieb
  26. end type
  27. type ln_bar from line within w_reissue_cus_ljfieb
  28. end type
  29. type ln_bar2 from line within w_reissue_cus_ljfieb
  30. end type
  31. type ln_1 from line within w_reissue_cus_ljfieb
  32. end type
  33. type ln_2 from line within w_reissue_cus_ljfieb
  34. end type
  35. type r_bar from rectangle within w_reissue_cus_ljfieb
  36. end type
  37. end forward
  38. global type w_reissue_cus_ljfieb from w_publ_base
  39. integer width = 3611
  40. integer height = 2380
  41. string title = "客户费用申请单"
  42. boolean minbox = false
  43. windowtype windowtype = response!
  44. windowstate windowstate = maximized!
  45. event ue_quote ( )
  46. dw_uc dw_uc
  47. dw_child dw_child
  48. mle_1 mle_1
  49. st_1 st_1
  50. st_2 st_2
  51. sle_scname sle_scname
  52. cb_accept cb_accept
  53. cb_feedback cb_feedback
  54. cb_reject cb_reject
  55. mle_2 mle_2
  56. st_3 st_3
  57. ln_bar ln_bar
  58. ln_bar2 ln_bar2
  59. ln_1 ln_1
  60. ln_2 ln_2
  61. r_bar r_bar
  62. end type
  63. global w_reissue_cus_ljfieb w_reissue_cus_ljfieb
  64. type variables
  65. Transaction tr_eb_sqlca
  66. s_packet_ljfieb s_inscust
  67. long ins_scid,ins_cusid,ins_cusid_pack
  68. string ins_sn
  69. uo_quote uo_quote_mtrl
  70. uo_ljfieb uo_fieb
  71. long ins_sendid,ins_receid
  72. string ins_sendsccode,ins_reccesccode
  73. string ins_RelatedCode
  74. datetime ins_addtime
  75. string ins_adduser
  76. string ins_relreissuecode
  77. end variables
  78. forward prototypes
  79. public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg)
  80. public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
  81. public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg)
  82. end prototypes
  83. public function integer wf_retrieve (string arg_sn, long arg_sendcuscommid, string arg_sendsccode, ref string arg_msg);Int rslt = 1
  84. String ls_cuscode
  85. Long uc_row
  86. Long ll_i, ll_rowcnt,ll_row
  87. Long ll_moneyid,ll_banktypeid
  88. int li_CusType
  89. Decimal ls_1stnewprice,ls_1stzqrate
  90. dw_uc.Retrieve(arg_sn)
  91. dw_child.Retrieve(arg_sn)
  92. uc_row = dw_uc.GetRow()
  93. IF uc_row <= 0 THEN
  94. rslt = 0
  95. arg_msg = '没有对应的单据信息'
  96. GOTO ext
  97. END IF
  98. SELECT CusCode,CusType
  99. INTO :ls_cuscode,:li_CusType
  100. FROM LJFIEB_CusComm
  101. Where CusCommID = :arg_sendcuscommid Using tr_eb_sqlca;
  102. IF tr_eb_sqlca.SQLCode <> 0 THEN
  103. ls_cuscode = ''
  104. END IF
  105. If li_CusType = 5 Then
  106. Select cuscode Into :ls_cuscode
  107. From u_cust
  108. Where cusid = :ins_cusid_pack Using sqlca;
  109. If sqlca.SQLCode <> 0 Then
  110. ls_cuscode = ''
  111. End If
  112. End If
  113. IF Trim(ls_cuscode) = '' THEN
  114. rslt = 0
  115. arg_msg = '客户信息不明确,请检查'
  116. GOTO ext
  117. END IF
  118. Long cusid
  119. String CusCode, Name
  120. SELECT cusid,
  121. cuscode,
  122. name
  123. INTO
  124. :cusid,
  125. :cuscode,
  126. :Name
  127. From u_cust
  128. Where (commcode = :ls_cuscode And commsccode = :arg_SendSCcode and :li_CusType <> 5
  129. or cuscode = :ls_cuscode and :li_custype = 5 ) Using sqlca;
  130. IF sqlca.SQLCode <> 0 THEN
  131. rslt = 0
  132. arg_msg = '查询客户信息失败,请检查通信设置是否正确,'+sqlca.SQLErrText
  133. GOTO ext
  134. END IF
  135. ins_cusid = cusid
  136. //dw_uc.Object.cusid[uc_row] = cusid
  137. dw_uc.Object.CusCode[uc_row] = CusCode
  138. dw_uc.Object.cusname[uc_row] = Name
  139. ext:
  140. RETURN rslt
  141. end function
  142. public function integer wf_importnewbj (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
  143. IF arg_moneyid = 0 THEN
  144. rslt = 0
  145. arg_msg = '请先选择币种'
  146. GOTO ext
  147. END IF
  148. IF IsNull(arg_cusid) THEN arg_cusid = 0
  149. IF arg_cusid = 0 THEN
  150. rslt = 0
  151. arg_msg = "请选择销售客户!"
  152. GOTO ext
  153. END IF
  154. SELECT u_cus_price.fprice_bj,u_cus_price.zqrate_bj
  155. INTO :arg_price,:arg_rebate
  156. FROM u_cus_price
  157. WHERE ( u_cus_price.cusid = :arg_cusid ) AND
  158. ( u_cus_price.mtrlid = :arg_mtrlid ) AND
  159. ( u_cus_price.status = :arg_status ) AND
  160. ( u_cus_price.pcode = :arg_pcode ) AND
  161. ( u_cus_price.woodcode = :arg_woodcode ) and
  162. ( u_cus_price.moneyid = :arg_moneyid);
  163. IF sqlca.SQLCode <> 0 THEN
  164. rslt = 0
  165. arg_msg = "没有最新销售价!"
  166. GOTO ext
  167. END IF
  168. ext:
  169. IF rslt = 0 THEN
  170. arg_price = 0
  171. arg_rebate = 0
  172. END IF
  173. RETURN rslt
  174. end function
  175. public function integer wf_importnewprice (long arg_cusid, long arg_moneyid, long arg_mtrlid, string arg_status, string arg_woodcode, string arg_pcode, ref decimal arg_price, ref decimal arg_rebate, ref string arg_msg);Int rslt = 1
  176. IF arg_moneyid = 0 THEN
  177. rslt = 0
  178. arg_msg = '请先选择币种'
  179. GOTO ext
  180. END IF
  181. IF IsNull(arg_cusid) THEN arg_cusid = 0
  182. IF arg_cusid = 0 THEN
  183. rslt = 0
  184. arg_msg = "请选择销售客户!"
  185. GOTO ext
  186. END IF
  187. SELECT u_cus_price.fprice,u_cus_price.zqrate
  188. INTO :arg_price,:arg_rebate
  189. FROM u_cus_price
  190. WHERE ( u_cus_price.cusid = :arg_cusid ) AND
  191. ( u_cus_price.mtrlid = :arg_mtrlid ) AND
  192. ( u_cus_price.status = :arg_status ) AND
  193. ( u_cus_price.pcode = :arg_pcode ) AND
  194. ( u_cus_price.woodcode = :arg_woodcode ) and
  195. ( u_cus_price.moneyid = :arg_moneyid);
  196. IF sqlca.SQLCode <> 0 THEN
  197. rslt = 0
  198. arg_msg = "没有最新销售价!"
  199. GOTO ext
  200. END IF
  201. ext:
  202. IF rslt = 0 THEN
  203. arg_price = 0
  204. arg_rebate = 0
  205. END IF
  206. RETURN rslt
  207. end function
  208. on w_reissue_cus_ljfieb.create
  209. int iCurrent
  210. call super::create
  211. this.dw_uc=create dw_uc
  212. this.dw_child=create dw_child
  213. this.mle_1=create mle_1
  214. this.st_1=create st_1
  215. this.st_2=create st_2
  216. this.sle_scname=create sle_scname
  217. this.cb_accept=create cb_accept
  218. this.cb_feedback=create cb_feedback
  219. this.cb_reject=create cb_reject
  220. this.mle_2=create mle_2
  221. this.st_3=create st_3
  222. this.ln_bar=create ln_bar
  223. this.ln_bar2=create ln_bar2
  224. this.ln_1=create ln_1
  225. this.ln_2=create ln_2
  226. this.r_bar=create r_bar
  227. iCurrent=UpperBound(this.Control)
  228. this.Control[iCurrent+1]=this.dw_uc
  229. this.Control[iCurrent+2]=this.dw_child
  230. this.Control[iCurrent+3]=this.mle_1
  231. this.Control[iCurrent+4]=this.st_1
  232. this.Control[iCurrent+5]=this.st_2
  233. this.Control[iCurrent+6]=this.sle_scname
  234. this.Control[iCurrent+7]=this.cb_accept
  235. this.Control[iCurrent+8]=this.cb_feedback
  236. this.Control[iCurrent+9]=this.cb_reject
  237. this.Control[iCurrent+10]=this.mle_2
  238. this.Control[iCurrent+11]=this.st_3
  239. this.Control[iCurrent+12]=this.ln_bar
  240. this.Control[iCurrent+13]=this.ln_bar2
  241. this.Control[iCurrent+14]=this.ln_1
  242. this.Control[iCurrent+15]=this.ln_2
  243. this.Control[iCurrent+16]=this.r_bar
  244. end on
  245. on w_reissue_cus_ljfieb.destroy
  246. call super::destroy
  247. destroy(this.dw_uc)
  248. destroy(this.dw_child)
  249. destroy(this.mle_1)
  250. destroy(this.st_1)
  251. destroy(this.st_2)
  252. destroy(this.sle_scname)
  253. destroy(this.cb_accept)
  254. destroy(this.cb_feedback)
  255. destroy(this.cb_reject)
  256. destroy(this.mle_2)
  257. destroy(this.st_3)
  258. destroy(this.ln_bar)
  259. destroy(this.ln_bar2)
  260. destroy(this.ln_1)
  261. destroy(this.ln_2)
  262. destroy(this.r_bar)
  263. end on
  264. event open;call super::open;tr_eb_sqlca = sys_email_sqlca // 电子商务连接
  265. IF sys_email_sqlca.DBHandle() = 0 THEN
  266. MessageBox('Error','电子商务数据库连接失败,请检查')
  267. RETURN
  268. END IF
  269. dw_uc.settransobject(tr_eb_sqlca)
  270. dw_child.settransobject(tr_eb_sqlca)
  271. uo_fieb = Create uo_ljfieb
  272. uo_fieb.commit_transaction = tr_eb_sqlca
  273. s_inscust = Message.PowerObjectParm
  274. ins_sn = s_inscust.serialnum
  275. ins_sendid = s_inscust.sendcuscommid
  276. ins_receid = s_inscust.receivecuscommid
  277. ins_sendsccode = s_inscust.sendsccode
  278. ins_reccesccode = s_inscust.receivesccode
  279. ins_RelatedCode = s_inscust.RelatedCode
  280. ins_addtime = s_inscust.addtime
  281. ins_adduser = s_inscust.adduser
  282. String ls_sccode,ls_scname
  283. String arg_msg
  284. ls_sccode = s_inscust.receivesccode
  285. SELECT scid,scname
  286. INTO :ins_scid,:ls_scname
  287. FROM u_scdef
  288. Where sccode = :ls_sccode;
  289. IF sqlca.SQLCode <> 0 THEN
  290. MessageBox('Error','查询分部信息失败,'+sqlca.SQLErrText)
  291. RETURN
  292. END IF
  293. sle_scname.Text = ls_scname
  294. mle_1.Text = s_inscust.postscript
  295. mle_2.Text = s_inscust.remark
  296. long ll_status
  297. SELECT status,cusid INTO :ll_status,:ins_cusid_pack
  298. FROM LJFIEB_packet
  299. Where serialnum = :ins_sn Using tr_eb_sqlca;
  300. IF tr_eb_sqlca.SQLCode <> 0 THEN
  301. MessageBox('Error','查询通信数据失败,'+sqlca.SQLErrText)
  302. RETURN
  303. END IF
  304. if ll_status <> 5 then
  305. cb_accept.enabled = false
  306. cb_reject.enabled = false
  307. end if
  308. IF wf_retrieve(ins_sn,ins_sendid,ins_sendsccode,arg_msg) = 0 THEN
  309. MessageBox('Error',arg_msg)
  310. RETURN
  311. END IF
  312. //更新对方状态-已打开
  313. string ls_SerialNum
  314. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  315. From u_user Using sqlca;
  316. IF sqlca.SQLCode <> 0 THEN
  317. return
  318. END IF
  319. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  320. IF ls_SerialNum = '' THEN
  321. return
  322. END IF
  323. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,5,'打开消息','','',ins_sn,'',0,arg_msg,True) = 0 THEN
  324. return
  325. END IF
  326. end event
  327. event resize;call super::resize;ln_bar.endx = this.width
  328. ln_bar2.endx = this.width
  329. r_bar.width = this.width
  330. ln_1.endx = this.width
  331. ln_2.endx = this.width
  332. dw_child.width = this.WorkSpaceWidth() - 10
  333. mle_1.width = dw_child.width - dw_uc.width - 4
  334. mle_2.width = mle_1.width
  335. dw_child.height = this.workspaceheight() - dw_child.y - 30
  336. end event
  337. event close;call super::close;destroy uo_fieb
  338. closewithreturn(this,ins_relreissuecode)
  339. end event
  340. type cb_func from w_publ_base`cb_func within w_reissue_cus_ljfieb
  341. boolean visible = false
  342. end type
  343. type cb_exit from w_publ_base`cb_exit within w_reissue_cus_ljfieb
  344. integer x = 1111
  345. integer width = 183
  346. integer height = 164
  347. integer picsize = 16
  348. toolbaralignment pic_align = alignattop!
  349. boolean border = false
  350. end type
  351. type dw_uc from datawindow within w_reissue_cus_ljfieb
  352. integer y = 296
  353. integer width = 1966
  354. integer height = 1092
  355. integer taborder = 30
  356. boolean bringtotop = true
  357. string title = "none"
  358. string dataobject = "dw_reissue_cus_ljfieb"
  359. boolean livescroll = true
  360. borderstyle borderstyle = stylelowered!
  361. end type
  362. type dw_child from u_dw_rbtnfilter within w_reissue_cus_ljfieb
  363. integer y = 1404
  364. integer width = 3584
  365. integer height = 852
  366. integer taborder = 20
  367. boolean bringtotop = true
  368. boolean titlebar = true
  369. string title = "单据明细内容"
  370. string dataobject = "dw_reissue_mx_ljfieb"
  371. boolean maxbox = true
  372. boolean hscrollbar = true
  373. boolean vscrollbar = true
  374. boolean hsplitscroll = true
  375. end type
  376. event rowfocuschanged;call super::rowfocuschanged; IF currentrow <= 0 THEN RETURN
  377. THIS.SelectRow(0,FALSE)
  378. THIS.SelectRow(currentrow,TRUE)
  379. this.setrow(currentrow)
  380. end event
  381. event clicked;call super::clicked; IF row <= 0 THEN RETURN
  382. THIS.SelectRow(0,FALSE)
  383. THIS.SelectRow(row,TRUE)
  384. this.setrow(row)
  385. end event
  386. event rbuttondown;call super::rbuttondown;Long ll_row,ll_column
  387. ll_row = This.GetRow()
  388. ll_column = This.GetColumn()
  389. IF ll_row <= 0 THEN RETURN
  390. IF ll_column <= 0 THEN RETURN
  391. IF Left( This.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  392. s_calender_arg s_calender
  393. s_calender.PointerX = This.PointerX()
  394. s_calender.PointerY = This.PointerY()
  395. s_calender.X = This.X + Parent.X
  396. s_calender.Y = This.Y + Parent.Y
  397. OpenWithParm(w_calendar,s_calender)
  398. This.SetItem(ll_row,ll_column,id_date_selected)
  399. END IF
  400. end event
  401. type mle_1 from multilineedit within w_reissue_cus_ljfieb
  402. integer x = 1970
  403. integer y = 360
  404. integer width = 1595
  405. integer height = 664
  406. integer taborder = 40
  407. boolean bringtotop = true
  408. integer textsize = -9
  409. integer weight = 400
  410. fontcharset fontcharset = gb2312charset!
  411. fontpitch fontpitch = variable!
  412. string facename = "宋体"
  413. long textcolor = 33554432
  414. boolean vscrollbar = true
  415. boolean autovscroll = true
  416. boolean displayonly = true
  417. borderstyle borderstyle = stylelowered!
  418. end type
  419. type st_1 from statictext within w_reissue_cus_ljfieb
  420. integer x = 1979
  421. integer y = 300
  422. integer width = 142
  423. integer height = 56
  424. boolean bringtotop = true
  425. integer textsize = -9
  426. integer weight = 400
  427. fontcharset fontcharset = gb2312charset!
  428. fontpitch fontpitch = variable!
  429. string facename = "宋体"
  430. long textcolor = 33554432
  431. long backcolor = 134217739
  432. string text = "附言"
  433. boolean focusrectangle = false
  434. end type
  435. type st_2 from statictext within w_reissue_cus_ljfieb
  436. integer x = 23
  437. integer y = 204
  438. integer width = 155
  439. integer height = 48
  440. boolean bringtotop = true
  441. integer textsize = -9
  442. integer weight = 400
  443. fontcharset fontcharset = gb2312charset!
  444. fontpitch fontpitch = variable!
  445. string facename = "宋体"
  446. long textcolor = 33554432
  447. long backcolor = 134217739
  448. string text = "分部"
  449. alignment alignment = right!
  450. boolean focusrectangle = false
  451. end type
  452. type sle_scname from singlelineedit within w_reissue_cus_ljfieb
  453. integer x = 210
  454. integer y = 188
  455. integer width = 443
  456. integer height = 84
  457. integer taborder = 30
  458. boolean bringtotop = true
  459. integer textsize = -9
  460. integer weight = 400
  461. fontcharset fontcharset = gb2312charset!
  462. fontpitch fontpitch = variable!
  463. string facename = "宋体"
  464. long textcolor = 33554432
  465. boolean displayonly = true
  466. borderstyle borderstyle = stylelowered!
  467. end type
  468. type cb_accept from uo_imflatbutton within w_reissue_cus_ljfieb
  469. integer width = 439
  470. integer height = 164
  471. integer taborder = 30
  472. boolean bringtotop = true
  473. string text = "转为客户费用单"
  474. string normalpicname = "ok.bmp"
  475. integer picsize = 16
  476. toolbaralignment pic_align = alignattop!
  477. boolean border = false
  478. end type
  479. event clicked;call super::clicked;IF Not f_power_ind(3405) THEN
  480. MessageBox(publ_operator,sys_msg_pow)
  481. RETURN
  482. END IF
  483. IF MessageBox('询问','确定要接受当前费用申请单,转为正式客户费用单吗?',question!,yesno!) = 2 THEN RETURN
  484. if ins_cusid = 0 then
  485. messagebox('系统提示','客户信息不明确,不能建立客户费用单,请检查')
  486. return
  487. end if
  488. s_packet_ljfieb s_edit_tran
  489. s_edit_tran.serialnum = ins_sn
  490. s_edit_tran.cusid = ins_cusid
  491. s_edit_tran.scid = ins_scid
  492. s_edit_tran.billtype = 1
  493. openwithparm(w_reissue_cus_ljfieb_edit,s_edit_tran)
  494. string ls_relreissuecode
  495. ls_relreissuecode = message.stringparm
  496. if ls_relreissuecode = '' then return
  497. ins_relreissuecode = ls_relreissuecode
  498. String arg_msg
  499. String ls_SerialNum
  500. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  501. From u_user Using sqlca;
  502. IF sqlca.SQLCode <> 0 THEN
  503. ROLLBACK Using sqlca;
  504. MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
  505. RETURN
  506. END IF
  507. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  508. IF ls_SerialNum = '' THEN
  509. MessageBox('Error','错误的发送序列号')
  510. RETURN
  511. END IF
  512. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,6,'安排报价','','',ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
  513. MessageBox('系统提示','发送确认指令失败 '+arg_msg)
  514. RETURN
  515. END IF
  516. IF MessageBox('系统提示','成功生成客户费用单:'+ins_relreissuecode+',是否马上打开?',question!,yesno!) = 2 THEN ins_relreissuecode = ''
  517. Close(Parent)
  518. end event
  519. type cb_feedback from uo_imflatbutton within w_reissue_cus_ljfieb
  520. integer x = 439
  521. integer width = 439
  522. integer height = 164
  523. integer taborder = 10
  524. boolean bringtotop = true
  525. string text = "相关客户费用单"
  526. string normalpicname = "open.BMP"
  527. integer picsize = 16
  528. toolbaralignment pic_align = alignattop!
  529. boolean border = false
  530. end type
  531. event clicked;call super::clicked;Long ll_row
  532. String ls_code
  533. Long cnt
  534. string ls_relreissuecode
  535. ll_row = dw_uc.GetRow()
  536. If ll_row <= 0 Then Return
  537. If dw_uc.Object.flag[ll_row] = 0 Then
  538. MessageBox('系统提示','本客户费用申请单尚未进行处理')
  539. Return
  540. End If
  541. ls_code = dw_uc.Object.relreissuecode[ll_row]
  542. Select count(*)
  543. Into :cnt
  544. From u_reissue
  545. Where reissuecode = :ls_code Using sqlca;
  546. If sqlca.SQLCode <> 0 Then
  547. MessageBox('Error','查询费用单信息失败,'+sqlca.SQLErrText)
  548. Return
  549. End If
  550. If cnt = 0 Then
  551. If Not f_power_ind(3405) Then
  552. MessageBox('系统提示','无法查询相关费用单,可能已被删除')
  553. Return
  554. Else
  555. If MessageBox('询问','无法查询相关费用单,可能已被删除,是否重新生成新的费用单?',question!,yesno!) = 2 Then Return
  556. If ins_cusid = 0 Then
  557. MessageBox('系统提示','客户信息不明确,不能建立客户费用单,请检查')
  558. Return
  559. End If
  560. s_packet_ljfieb s_edit_tran
  561. s_edit_tran.serialnum = ins_sn
  562. s_edit_tran.cusid = ins_cusid
  563. s_edit_tran.scid = ins_scid
  564. s_edit_tran.billtype = 1
  565. OpenWithParm(w_reissue_cus_ljfieb_edit,s_edit_tran)
  566. ls_relreissuecode = Message.StringParm
  567. If ls_relreissuecode = '' Then Return
  568. dw_uc.Object.relreissuecode[ll_row] = ls_relreissuecode
  569. f_open_win(ins_scid,ls_relreissuecode)
  570. End If
  571. Else
  572. f_open_win(ins_scid,ls_code)
  573. End If
  574. end event
  575. type cb_reject from uo_imflatbutton within w_reissue_cus_ljfieb
  576. integer x = 882
  577. integer width = 219
  578. integer height = 164
  579. integer taborder = 30
  580. boolean bringtotop = true
  581. string text = "拒绝"
  582. string normalpicname = "DELETE.BMP"
  583. integer picsize = 16
  584. toolbaralignment pic_align = alignattop!
  585. boolean border = false
  586. end type
  587. event clicked;call super::clicked;IF Not f_power_ind(3406) THEN
  588. MessageBox(publ_operator,sys_msg_pow)
  589. RETURN
  590. END IF
  591. String arg_summary,arg_postscript,arg_remark
  592. String arg_msg
  593. String ls_SerialNum
  594. SELECT TOP 1 NEWID() INTO :ls_SerialNum
  595. From u_user Using sqlca;
  596. IF sqlca.SQLCode <> 0 THEN
  597. ROLLBACK Using sqlca;
  598. MessageBox('Error','生成序列号失败,'+sqlca.SQLErrText)
  599. RETURN
  600. END IF
  601. IF IsNull(ls_SerialNum) THEN ls_SerialNum = ''
  602. IF ls_SerialNum = '' THEN
  603. MessageBox('Error','错误的发送序列号')
  604. RETURN
  605. END IF
  606. s_packet_ljfieb s_pack,s_return
  607. //s_pack.summary = '拒绝订单:'+ins_RelatedCode
  608. OpenWithParm(w_dscrp_edit_ljfieb,s_pack)
  609. s_return = Message.PowerObjectParm
  610. IF s_return.returnflag <> 1 THEN RETURN
  611. //arg_summary = s_return.summary
  612. arg_postscript = s_return.postscript
  613. arg_remark = s_return.remark
  614. UPDATE LJFIEB_tempspt_price_change
  615. SET flag = 2
  616. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  617. IF tr_eb_sqlca.SQLCode <> 0 THEN
  618. ROLLBACK Using tr_eb_sqlca;
  619. MessageBox('Error','更新费用单状态失败,'+tr_eb_sqlca.SQLErrText)
  620. RETURN 0
  621. END IF
  622. //更新本地通信记录
  623. UPDATE LJFIEB_packet
  624. SET status = 10,
  625. Complete = 1
  626. Where SerialNum = :ins_sn Using tr_eb_sqlca;
  627. IF tr_eb_sqlca.SQLCode <> 0 THEN
  628. ROLLBACK Using tr_eb_sqlca;
  629. MessageBox('Error', '更新本地通信记录失败,'+tr_eb_sqlca.SQLErrText)
  630. RETURN
  631. END IF
  632. IF uo_fieb.add_packet(ls_SerialNum,'',ins_receid,ins_reccesccode,ins_sendid,ins_sendsccode,11,arg_summary,arg_postscript,arg_remark,ins_sn,ins_RelatedCode,0,arg_msg,True) = 0 THEN
  633. MessageBox('系统提示','发送确认指令失败 '+arg_msg)
  634. RETURN
  635. END IF
  636. MessageBox('系统提示','操作成功')
  637. Close(Parent)
  638. end event
  639. type mle_2 from multilineedit within w_reissue_cus_ljfieb
  640. integer x = 1970
  641. integer y = 1120
  642. integer width = 1595
  643. integer height = 264
  644. integer taborder = 50
  645. boolean bringtotop = true
  646. integer textsize = -9
  647. integer weight = 400
  648. fontcharset fontcharset = gb2312charset!
  649. fontpitch fontpitch = variable!
  650. string facename = "宋体"
  651. long textcolor = 33554432
  652. boolean vscrollbar = true
  653. boolean autovscroll = true
  654. boolean displayonly = true
  655. borderstyle borderstyle = stylelowered!
  656. end type
  657. type st_3 from statictext within w_reissue_cus_ljfieb
  658. integer x = 1979
  659. integer y = 1060
  660. integer width = 128
  661. integer height = 48
  662. boolean bringtotop = true
  663. integer textsize = -9
  664. integer weight = 400
  665. fontcharset fontcharset = gb2312charset!
  666. fontpitch fontpitch = variable!
  667. string facename = "宋体"
  668. long textcolor = 33554432
  669. long backcolor = 134217739
  670. string text = "备注"
  671. boolean focusrectangle = false
  672. end type
  673. type ln_bar from line within w_reissue_cus_ljfieb
  674. long linecolor = 268435456
  675. integer linethickness = 4
  676. integer beginy = 172
  677. integer endx = 3200
  678. integer endy = 172
  679. end type
  680. type ln_bar2 from line within w_reissue_cus_ljfieb
  681. long linecolor = 16777215
  682. integer linethickness = 4
  683. integer beginx = 9
  684. integer beginy = 176
  685. integer endx = 3273
  686. integer endy = 176
  687. end type
  688. type ln_1 from line within w_reissue_cus_ljfieb
  689. long linecolor = 268435456
  690. integer linethickness = 4
  691. integer beginy = 284
  692. integer endx = 3250
  693. integer endy = 284
  694. end type
  695. type ln_2 from line within w_reissue_cus_ljfieb
  696. long linecolor = 16777215
  697. integer linethickness = 4
  698. integer beginy = 288
  699. integer endx = 3282
  700. integer endy = 288
  701. end type
  702. type r_bar from rectangle within w_reissue_cus_ljfieb
  703. long linecolor = 16777215
  704. integer linethickness = 4
  705. long fillcolor = 1073741824
  706. integer x = 3351
  707. integer width = 87
  708. integer height = 68
  709. end type
  710. event constructor;this.fillcolor = 14215660
  711. this.linecolor = 14215660
  712. this.x = -1
  713. this.y = -1
  714. this.height = ln_bar.beginy - 5
  715. end event