w_outware_receive_fx.srw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. $PBExportHeader$w_outware_receive_fx.srw
  2. $PBExportComments$销售发货单 转 采购收货单
  3. forward
  4. global type w_outware_receive_fx from w_publ_base_style
  5. end type
  6. type cb_accept from uo_imflatbutton within w_outware_receive_fx
  7. end type
  8. type cb_reject from uo_imflatbutton within w_outware_receive_fx
  9. end type
  10. type dw_tempoutware from datawindow within w_outware_receive_fx
  11. end type
  12. type st_1 from statictext within w_outware_receive_fx
  13. end type
  14. type mle_summary from multilineedit within w_outware_receive_fx
  15. end type
  16. type tab_1 from tab within w_outware_receive_fx
  17. end type
  18. type tabpage_1 from userobject within tab_1
  19. end type
  20. type dw_tempoutwaremx from u_dw_rbtnfilter within tabpage_1
  21. end type
  22. type tabpage_1 from userobject within tab_1
  23. dw_tempoutwaremx dw_tempoutwaremx
  24. end type
  25. type tab_1 from tab within w_outware_receive_fx
  26. tabpage_1 tabpage_1
  27. end type
  28. type st_2 from statictext within w_outware_receive_fx
  29. end type
  30. type mle_postscript from multilineedit within w_outware_receive_fx
  31. end type
  32. type st_3 from statictext within w_outware_receive_fx
  33. end type
  34. type mle_remark from multilineedit within w_outware_receive_fx
  35. end type
  36. end forward
  37. global type w_outware_receive_fx from w_publ_base_style
  38. integer width = 3771
  39. integer height = 2372
  40. string title = "供应商销售发货单"
  41. boolean minbox = false
  42. windowtype windowtype = response!
  43. windowstate windowstate = maximized!
  44. long backcolor = 16777215
  45. string icon = "graphics\chain_link_128px.ico"
  46. boolean center = true
  47. cb_accept cb_accept
  48. cb_reject cb_reject
  49. dw_tempoutware dw_tempoutware
  50. st_1 st_1
  51. mle_summary mle_summary
  52. tab_1 tab_1
  53. st_2 st_2
  54. mle_postscript mle_postscript
  55. st_3 st_3
  56. mle_remark mle_remark
  57. end type
  58. global w_outware_receive_fx w_outware_receive_fx
  59. type variables
  60. s_open_packet s_tran
  61. datawindow dw_tempoutwaremx
  62. end variables
  63. forward prototypes
  64. public function integer wf_retrieve (readonly string arg_sn, ref string arg_msg)
  65. public subroutine wf_accept ()
  66. public function integer wf_reject (readonly string arg_postscript)
  67. end prototypes
  68. public function integer wf_retrieve (readonly string arg_sn, ref string arg_msg);int rslt = 1
  69. dw_tempoutware.Reset( )
  70. dw_tempoutwaremx.Reset( )
  71. if (arg_sn = '') then
  72. rslt = 0
  73. arg_msg = 'SN号为空'
  74. goto ext
  75. end if
  76. oleobject outwareInfo
  77. outwareInfo = FXAppCom.GetOutWare(app_token_fx, arg_sn, ref arg_msg)
  78. if (arg_msg <> '') then
  79. rslt = 0
  80. goto ext
  81. end if
  82. oleobject outware, outwaremxs, mxItem
  83. outware = outwareInfo.GetPBDictionary('outware')
  84. long row
  85. dw_tempoutware.SetRedraw(false)
  86. row = dw_tempoutware.InsertRow(0)
  87. dw_tempoutware.Object.outwarecode[row] = outware.GetString('outwarecode')
  88. dw_tempoutware.Object.flag_bill[row] = outware.GetInt('flag_bill')
  89. dw_tempoutware.Object.part[row] = outware.GetString('part')
  90. dw_tempoutware.Object.sptname[row] = outware.GetString('sptname')
  91. dw_tempoutware.Object.rel_address[row] = outware.GetString('rel_address')
  92. dw_tempoutware.Object.relstr_1[row] = outware.GetString('relstr_1')
  93. dw_tempoutware.Object.relstr_2[row] = outware.GetString('relstr_2')
  94. dw_tempoutware.Object.damt[row] = outware.GetDouble('damt')
  95. dw_tempoutware.Object.otheramt[row] = outware.GetDouble('otheramt')
  96. if ( not IsNull(outware.GetDateTime('outdate'))) then
  97. dw_tempoutware.Object.outdate[row] = outware.GetDateTime('outdate')
  98. end if
  99. if (not IsNull(outware.GetDateTime('viewdate'))) then
  100. dw_tempoutware.Object.viewdate[row] = outware.GetDateTime('viewdate')
  101. end if
  102. dw_tempoutware.Object.outrep[row] = outware.GetString('outrep')
  103. dw_tempoutware.Object.upname[row] = outware.GetString('upname')
  104. dw_tempoutware.Object.dscrp[row] = outware.GetString('dscrp')
  105. dw_tempoutware.Object.opemp[row] = outware.GetString('opemp')
  106. if (not IsNull(outware.GetDateTime('opdate'))) then
  107. dw_tempoutware.Object.opdate[row] = outware.GetDateTime('opdate')
  108. end if
  109. dw_tempoutware.Object.auditingrep[row] = outware.GetString('auditingrep')
  110. if (not IsNull(outware.GetDateTime('auditingdate'))) then
  111. dw_tempoutware.Object.auditingdate[row] = outware.GetDateTime('auditingdate')
  112. end if
  113. dw_tempoutware.Object.confirmuser[row] = outware.GetString('confirmuser')
  114. if (not IsNull(outware.GetDateTime('confirmtime'))) then
  115. dw_tempoutware.Object.confirmtime[row] = outware.GetDateTime('confirmtime')
  116. end if
  117. dw_tempoutware.SetRedraw(true)
  118. outwaremxs = outwareInfo.GetArrOfPBDictionary('outwaremxs')
  119. long i
  120. dw_tempoutwaremx.SetRedraw(false)
  121. for i = 1 to outwaremxs.Count
  122. mxItem = outwaremxs.GetItem(i - 1)
  123. row = dw_tempoutwaremx.InsertRow(0)
  124. dw_tempoutwaremx.Object.fiebrelcode[row] = mxItem.GetString('fiebrelcode')
  125. dw_tempoutwaremx.Object.mxcode[row] = mxItem.GetString('mxcode')
  126. dw_tempoutwaremx.Object.mtrlcode[row] = mxItem.GetString('mtrlcode')
  127. dw_tempoutwaremx.Object.mtrlname[row] = mxItem.GetString('mtrlname')
  128. dw_tempoutwaremx.Object.mtrlmode[row] = mxItem.GetString('mtrlmode')
  129. dw_tempoutwaremx.Object.qty[row] = mxItem.GetDouble('qty')
  130. dw_tempoutwaremx.Object.accept_qty[row] = mxItem.GetDouble('accept_qty')
  131. dw_tempoutwaremx.Object.accepted_qty[row] = mxItem.GetDouble('accepted_qty')
  132. dw_tempoutwaremx.Object.task_qty[row] = mxItem.GetDouble('task_qty')
  133. dw_tempoutwaremx.Object.unit[row] = Trim(mxItem.GetString('unit'))
  134. dw_tempoutwaremx.Object.enprice[row] = mxItem.GetDouble('enprice')
  135. dw_tempoutwaremx.Object.rebate[row] = mxItem.GetDouble('rebate')
  136. dw_tempoutwaremx.Object.taxrate[row] = mxItem.GetDouble('taxrate')
  137. dw_tempoutwaremx.Object.net_weight[row] = mxItem.GetDouble('net_weight')
  138. dw_tempoutwaremx.Object.gross_weight[row] = mxItem.GetDouble('gross_weight')
  139. dw_tempoutwaremx.Object.cubage[row] = mxItem.GetDouble('cubage')
  140. dw_tempoutwaremx.Object.fxmtrlid[row] = mxItem.GetInt('fxmtrlid')
  141. dw_tempoutwaremx.Object.taskid[row] = mxItem.GetInt('taskid')
  142. dw_tempoutwaremx.Object.printid[row] = mxItem.GetInt('printid')
  143. next
  144. dw_tempoutwaremx.SetRedraw(true)
  145. ext:
  146. return rslt
  147. end function
  148. public subroutine wf_accept ();oleobject item, list
  149. list = FXAppCom.CreArrOfPbDictionary()
  150. long i
  151. for i = 1 to dw_tempoutwaremx.RowCount( )
  152. if (dw_tempoutwaremx.Object.accept_qty[i] <= 0) then continue
  153. item = FXAppCom.CreatePbDictionary()
  154. item.SetInt('taskid', dw_tempoutwaremx.Object.taskid[i])
  155. item.SetInt('printid', dw_tempoutwaremx.Object.printid[i])
  156. item.SetDouble('qty', dw_tempoutwaremx.Object.accept_qty[i])
  157. item.SetString('mxcode', dw_tempoutware.Object.outwarecode[1]) // 存放供应商相关发货单号
  158. list.Add(item)
  159. next
  160. string arg_msg
  161. FXAppCom.AcceptOutware(app_token_fx, list, s_tran.sn, ref arg_msg)
  162. if (arg_msg <> '') then
  163. MessageBox('操作失败', arg_msg)
  164. else
  165. MessageBox('提示', '成功!')
  166. Close(this)
  167. return
  168. end if
  169. end subroutine
  170. public function integer wf_reject (readonly string arg_postscript);int rslt = 1
  171. string arg_msg
  172. FXAppCom.RejectOutware(app_token_fx, s_tran.sn, arg_postscript, ref arg_msg)
  173. if (arg_msg <> '') then
  174. MessageBox('提示', '拒绝操作失败:' + arg_msg)
  175. else
  176. MessageBox('提示' ,'成功')
  177. Close(this)
  178. end if
  179. return rslt
  180. end function
  181. on w_outware_receive_fx.create
  182. int iCurrent
  183. call super::create
  184. this.cb_accept=create cb_accept
  185. this.cb_reject=create cb_reject
  186. this.dw_tempoutware=create dw_tempoutware
  187. this.st_1=create st_1
  188. this.mle_summary=create mle_summary
  189. this.tab_1=create tab_1
  190. this.st_2=create st_2
  191. this.mle_postscript=create mle_postscript
  192. this.st_3=create st_3
  193. this.mle_remark=create mle_remark
  194. iCurrent=UpperBound(this.Control)
  195. this.Control[iCurrent+1]=this.cb_accept
  196. this.Control[iCurrent+2]=this.cb_reject
  197. this.Control[iCurrent+3]=this.dw_tempoutware
  198. this.Control[iCurrent+4]=this.st_1
  199. this.Control[iCurrent+5]=this.mle_summary
  200. this.Control[iCurrent+6]=this.tab_1
  201. this.Control[iCurrent+7]=this.st_2
  202. this.Control[iCurrent+8]=this.mle_postscript
  203. this.Control[iCurrent+9]=this.st_3
  204. this.Control[iCurrent+10]=this.mle_remark
  205. end on
  206. on w_outware_receive_fx.destroy
  207. call super::destroy
  208. destroy(this.cb_accept)
  209. destroy(this.cb_reject)
  210. destroy(this.dw_tempoutware)
  211. destroy(this.st_1)
  212. destroy(this.mle_summary)
  213. destroy(this.tab_1)
  214. destroy(this.st_2)
  215. destroy(this.mle_postscript)
  216. destroy(this.st_3)
  217. destroy(this.mle_remark)
  218. end on
  219. event open;call super::open;s_tran = Message.PowerObjectParm
  220. if IsNUll(s_tran) then
  221. MessageBox('提示', '打开方式有误,SN号为空')
  222. Close(this)
  223. return
  224. end if
  225. dw_tempoutwaremx = tab_1.tabpage_1.dw_tempoutwaremx
  226. mle_summary.Text = s_tran.summary
  227. mle_postscript.Text = s_tran.postscript
  228. mle_remark.Text = s_tran.remark
  229. string arg_msg
  230. wf_retrieve(s_tran.sn, ref arg_msg)
  231. if (arg_msg <> '') then
  232. MessageBox('提示', arg_msg)
  233. Close(this)
  234. return
  235. end if
  236. end event
  237. event resize;call super::resize;if (this.Width < 3762) then this.Width = 3762
  238. if (this.Height < 2292) then this.Height = 2292
  239. mle_summary.Width = this.workspacewidth( ) - mle_summary.X - 14
  240. mle_postscript.Width = mle_summary.Width
  241. mle_remark.Width = mle_summary.Width
  242. tab_1.Width = this.workspacewidth( )
  243. tab_1.tabpage_1.dw_tempoutwaremx.Width = tab_1.Width - 40
  244. tab_1.Height = this.workspaceheight( ) - tab_1.Y
  245. tab_1.tabpage_1.dw_tempoutwaremx.Height = tab_1.Height - 118
  246. cb_exit.X = this.workspacewidth( ) - cb_exit.Width
  247. end event
  248. type cb_func from w_publ_base_style`cb_func within w_outware_receive_fx
  249. boolean visible = false
  250. end type
  251. type cb_exit from w_publ_base_style`cb_exit within w_outware_receive_fx
  252. integer x = 2766
  253. end type
  254. type ln_bar from w_publ_base_style`ln_bar within w_outware_receive_fx
  255. end type
  256. type ln_bar2 from w_publ_base_style`ln_bar2 within w_outware_receive_fx
  257. end type
  258. type r_bar from w_publ_base_style`r_bar within w_outware_receive_fx
  259. end type
  260. type cb_accept from uo_imflatbutton within w_outware_receive_fx
  261. integer width = 384
  262. integer height = 164
  263. integer taborder = 30
  264. boolean bringtotop = true
  265. string text = "确认本次收货"
  266. string normalpicname = "ok.bmp"
  267. integer picsize = 16
  268. toolbaralignment pic_align = alignattop!
  269. boolean border = false
  270. end type
  271. event clicked;call super::clicked;dw_tempoutwaremx.SetFilter('')
  272. dw_tempoutwaremx.Filter()
  273. long cnt
  274. cnt = dw_tempoutwaremx.RowCount( )
  275. if (cnt <= 0) then
  276. MessageBox('提示', '没有收货明细')
  277. return
  278. end if
  279. dw_tempoutwaremx.AcceptText( )
  280. string sum_msg
  281. long i
  282. boolean pass = true
  283. for i = 1 to cnt
  284. if (dw_tempoutwaremx.Object.accept_qty[i] <= 0) then
  285. sum_msg += '第' + string(i) + '行,物料名称[' + string(dw_tempoutwaremx.Object.mtrlname[i]) + '],本次收货数为0~r~n'
  286. end if
  287. if (dw_tempoutwaremx.Object.accept_qty[i] > dw_tempoutwaremx.Object.qty[i]) then
  288. sum_msg += '第' + string(i) + '行,物料名称[' + string(dw_tempoutwaremx.Object.mtrlname[i]) + '],本次收货数大于发货数~r~n'
  289. pass = false
  290. end if
  291. if (dw_tempoutwaremx.Object.accept_qty[i] + dw_tempoutwaremx.Object.accepted_qty[i] > dw_tempoutwaremx.Object.task_qty[i]) then
  292. sum_msg += '第' + string(i) + '行,物料名称[' + string(dw_tempoutwaremx.Object.mtrlname[i]) + '],总收货数大于订单采购数~r~n'
  293. pass = false
  294. end if
  295. next
  296. if (sum_msg <> '' and pass) then
  297. if (MessageBox('提示', sum_msg + '~r~n确认继续?', Question!, YesNoCancel!) <> 1) then
  298. return
  299. end if
  300. elseif (sum_msg <> '' and (not pass)) then
  301. OpenWithParm(w_message_err, '存在本次收货数大于发货数 / 总收货数大于订单采购数的明细,请检查:~r~n' + sum_msg)
  302. return
  303. end if
  304. wf_accept( )
  305. end event
  306. type cb_reject from uo_imflatbutton within w_outware_receive_fx
  307. integer x = 384
  308. integer width = 165
  309. integer height = 164
  310. integer taborder = 30
  311. boolean bringtotop = true
  312. string text = "拒绝"
  313. string normalpicname = "DELETE.BMP"
  314. integer picsize = 16
  315. toolbaralignment pic_align = alignattop!
  316. boolean border = false
  317. end type
  318. event clicked;call super::clicked;Open(w_packet_msg_edit_fx)
  319. s_open_packet s_ret
  320. s_ret = Message.PowerObjectParm
  321. if (s_ret.returnflag = 0) then
  322. MessageBox('提示', '操作已取消')
  323. return
  324. end if
  325. wf_reject(s_ret.postscript)
  326. end event
  327. type dw_tempoutware from datawindow within w_outware_receive_fx
  328. integer y = 172
  329. integer width = 1801
  330. integer height = 1104
  331. integer taborder = 20
  332. boolean bringtotop = true
  333. string title = "none"
  334. string dataobject = "dw_tempoutware"
  335. boolean livescroll = true
  336. end type
  337. type st_1 from statictext within w_outware_receive_fx
  338. integer x = 1824
  339. integer y = 172
  340. integer width = 146
  341. integer height = 48
  342. boolean bringtotop = true
  343. integer textsize = -9
  344. integer weight = 400
  345. fontcharset fontcharset = gb2312charset!
  346. fontpitch fontpitch = variable!
  347. string facename = "宋体"
  348. long textcolor = 33554432
  349. long backcolor = 16777215
  350. string text = "摘要"
  351. boolean focusrectangle = false
  352. end type
  353. type mle_summary from multilineedit within w_outware_receive_fx
  354. integer x = 1824
  355. integer y = 232
  356. integer width = 1929
  357. integer height = 300
  358. integer taborder = 30
  359. boolean bringtotop = true
  360. integer textsize = -9
  361. integer weight = 400
  362. fontcharset fontcharset = gb2312charset!
  363. fontpitch fontpitch = variable!
  364. string facename = "宋体"
  365. long textcolor = 33554432
  366. boolean vscrollbar = true
  367. boolean autovscroll = true
  368. end type
  369. type tab_1 from tab within w_outware_receive_fx
  370. integer x = 5
  371. integer y = 1280
  372. integer width = 3771
  373. integer height = 848
  374. integer taborder = 40
  375. boolean bringtotop = true
  376. integer textsize = -9
  377. integer weight = 400
  378. fontcharset fontcharset = gb2312charset!
  379. fontpitch fontpitch = variable!
  380. string facename = "宋体"
  381. long backcolor = 16777215
  382. boolean raggedright = true
  383. boolean focusonbuttondown = true
  384. integer selectedtab = 1
  385. tabpage_1 tabpage_1
  386. end type
  387. on tab_1.create
  388. this.tabpage_1=create tabpage_1
  389. this.Control[]={this.tabpage_1}
  390. end on
  391. on tab_1.destroy
  392. destroy(this.tabpage_1)
  393. end on
  394. type tabpage_1 from userobject within tab_1
  395. integer x = 18
  396. integer y = 96
  397. integer width = 3735
  398. integer height = 736
  399. long backcolor = 16777215
  400. string text = "发货明细"
  401. long tabtextcolor = 33554432
  402. long tabbackcolor = 16777215
  403. long picturemaskcolor = 536870912
  404. dw_tempoutwaremx dw_tempoutwaremx
  405. end type
  406. on tabpage_1.create
  407. this.dw_tempoutwaremx=create dw_tempoutwaremx
  408. this.Control[]={this.dw_tempoutwaremx}
  409. end on
  410. on tabpage_1.destroy
  411. destroy(this.dw_tempoutwaremx)
  412. end on
  413. type dw_tempoutwaremx from u_dw_rbtnfilter within tabpage_1
  414. integer width = 3707
  415. integer height = 548
  416. integer taborder = 20
  417. string dataobject = "dw_tempoutwaremx"
  418. boolean hscrollbar = true
  419. boolean vscrollbar = true
  420. borderstyle borderstyle = stylebox!
  421. boolean rbutton_filter_use = true
  422. boolean rbutton_setposition_use = true
  423. boolean titleclick_sort_use = true
  424. end type
  425. event clicked;call super::clicked;if (row <= 0) then return
  426. this.SelectRow(0, false)
  427. this.SelectRow(row, true)
  428. end event
  429. type st_2 from statictext within w_outware_receive_fx
  430. integer x = 1824
  431. integer y = 548
  432. integer width = 146
  433. integer height = 48
  434. boolean bringtotop = true
  435. integer textsize = -9
  436. integer weight = 400
  437. fontcharset fontcharset = gb2312charset!
  438. fontpitch fontpitch = variable!
  439. string facename = "宋体"
  440. long textcolor = 33554432
  441. long backcolor = 16777215
  442. string text = "附言"
  443. boolean focusrectangle = false
  444. end type
  445. type mle_postscript from multilineedit within w_outware_receive_fx
  446. integer x = 1824
  447. integer y = 604
  448. integer width = 1929
  449. integer height = 300
  450. integer taborder = 40
  451. boolean bringtotop = true
  452. integer textsize = -9
  453. integer weight = 400
  454. fontcharset fontcharset = gb2312charset!
  455. fontpitch fontpitch = variable!
  456. string facename = "宋体"
  457. long textcolor = 33554432
  458. boolean vscrollbar = true
  459. boolean autovscroll = true
  460. end type
  461. type st_3 from statictext within w_outware_receive_fx
  462. integer x = 1824
  463. integer y = 916
  464. integer width = 146
  465. integer height = 48
  466. boolean bringtotop = true
  467. integer textsize = -9
  468. integer weight = 400
  469. fontcharset fontcharset = gb2312charset!
  470. fontpitch fontpitch = variable!
  471. string facename = "宋体"
  472. long textcolor = 33554432
  473. long backcolor = 16777215
  474. string text = "备注"
  475. boolean focusrectangle = false
  476. end type
  477. type mle_remark from multilineedit within w_outware_receive_fx
  478. integer x = 1824
  479. integer y = 976
  480. integer width = 1929
  481. integer height = 300
  482. integer taborder = 40
  483. boolean bringtotop = true
  484. integer textsize = -9
  485. integer weight = 400
  486. fontcharset fontcharset = gb2312charset!
  487. fontpitch fontpitch = variable!
  488. string facename = "宋体"
  489. long textcolor = 33554432
  490. boolean vscrollbar = true
  491. boolean autovscroll = true
  492. end type