w_outware_sale_mod_price.srw 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. $PBExportHeader$w_outware_sale_mod_price.srw
  2. forward
  3. global type w_outware_sale_mod_price from w_publ_base
  4. end type
  5. type cb_ok from uo_imflatbutton within w_outware_sale_mod_price
  6. end type
  7. type cb_1 from commandbutton within w_outware_sale_mod_price
  8. end type
  9. type cb_select from commandbutton within w_outware_sale_mod_price
  10. end type
  11. type cb_savemx from commandbutton within w_outware_sale_mod_price
  12. end type
  13. type cb_out from commandbutton within w_outware_sale_mod_price
  14. end type
  15. type cb_delmtrl from commandbutton within w_outware_sale_mod_price
  16. end type
  17. type st_3 from statictext within w_outware_sale_mod_price
  18. end type
  19. type em_1 from editmask within w_outware_sale_mod_price
  20. end type
  21. type pb_em1 from picturebutton within w_outware_sale_mod_price
  22. end type
  23. type st_4 from statictext within w_outware_sale_mod_price
  24. end type
  25. type em_2 from editmask within w_outware_sale_mod_price
  26. end type
  27. type pb_em2 from picturebutton within w_outware_sale_mod_price
  28. end type
  29. type pb_2 from picturebutton within w_outware_sale_mod_price
  30. end type
  31. type dw_2 from u_dw_rbtnfilter within w_outware_sale_mod_price
  32. end type
  33. type cb_delmx from commandbutton within w_outware_sale_mod_price
  34. end type
  35. type dw_1 from u_dw_rbtnfilter within w_outware_sale_mod_price
  36. end type
  37. type cb_modprice from commandbutton within w_outware_sale_mod_price
  38. end type
  39. end forward
  40. global type w_outware_sale_mod_price from w_publ_base
  41. integer width = 5463
  42. integer height = 2084
  43. string title = "批量修改单价"
  44. boolean maxbox = true
  45. windowstate windowstate = maximized!
  46. event ue_view_status ( long arg_row, string arg_status )
  47. event ue_allowedit ( )
  48. event ue_calculate ( )
  49. event ue_mod_face ( )
  50. cb_ok cb_ok
  51. cb_1 cb_1
  52. cb_select cb_select
  53. cb_savemx cb_savemx
  54. cb_out cb_out
  55. cb_delmtrl cb_delmtrl
  56. st_3 st_3
  57. em_1 em_1
  58. pb_em1 pb_em1
  59. st_4 st_4
  60. em_2 em_2
  61. pb_em2 pb_em2
  62. pb_2 pb_2
  63. dw_2 dw_2
  64. cb_delmx cb_delmx
  65. dw_1 dw_1
  66. cb_modprice cb_modprice
  67. end type
  68. global w_outware_sale_mod_price w_outware_sale_mod_price
  69. type variables
  70. s_edit_index_tran s_tran
  71. long ins_scid,ins_inwareid
  72. string ins_inwarecode
  73. int ii_enamt_edit = 0//0:不使用录入,不能编辑; 1:使用录入,可以编辑
  74. int flag = 0
  75. int cur_pcode = 1,cur_status = 1,cur_woodcode = 1
  76. end variables
  77. forward prototypes
  78. public subroutine wf_mod_face ()
  79. public subroutine wf_savecheck ()
  80. public subroutine wf_select (integer arg_mtrlid)
  81. end prototypes
  82. event ue_view_status(long arg_row, string arg_status);s_view_dscrp s_view,s_return
  83. String ls_dscrp
  84. long ll_mtrlid,ll_statusflag,ll_woodcodeflag,ll_pcodeflag
  85. dw_1.AcceptText()
  86. ll_mtrlid = dw_1.object.mtrlid[arg_row]
  87. SELECT
  88. statusflag,
  89. woodcodeflag,
  90. pcodeflag
  91. into
  92. :ll_statusflag,:ll_woodcodeflag,:ll_pcodeflag
  93. FROM U_MTRLDEF
  94. where mtrlid = :ll_mtrlid;
  95. IF arg_status = 'status' THEN
  96. IF ll_statusflag<>5 THEN RETURN
  97. ELSEIF arg_status = 'woodcode' THEN
  98. IF ll_woodcodeflag<>5 THEN RETURN
  99. ELSEIF arg_status = 'pcode' then
  100. IF ll_pcodeflag<>5 THEN RETURN
  101. ELSE
  102. RETURN
  103. END IF
  104. ls_dscrp = dw_1.GetItemString(arg_row, arg_status)
  105. s_view.Title = '配置内容'
  106. s_view.dscrp = ls_dscrp
  107. s_view.editmode = dw_edit_mode
  108. OpenWithParm(w_view_status,s_view)
  109. IF dw_edit_mode THEN
  110. s_return = Message.PowerObjectParm
  111. dw_1.setitem(arg_row,arg_status,s_return.dscrp)
  112. END IF
  113. end event
  114. event ue_allowedit();Long Columns
  115. Int i
  116. String ls_modify_str
  117. Long ll_row
  118. Long ll_value
  119. Long ll_statusflag,ll_woodcodeflag,ll_pcodeflag
  120. String ls_status,ls_woodcode,ls_pcode
  121. String ls_data_type
  122. ll_row = dw_1.GetRow()
  123. IF ll_row <= 0 THEN RETURN
  124. Columns = Long(dw_1.Describe("DataWindow.Column.Count"))
  125. FOR i = 1 To Columns
  126. ls_modify_str = dw_1.Describe("#" + String(i) + ".name")
  127. ls_modify_str = Lower(ls_modify_str)
  128. IF i = 1 THEN //第1个字段,约定物料ID
  129. ls_data_type = dw_1.Describe(ls_modify_str+".ColType")
  130. IF ls_data_type = "long" THEN
  131. ll_value = dw_1.GetItemNumber(ll_row,ls_modify_str)
  132. END IF
  133. END IF
  134. IF Pos(ls_modify_str,'statusflag') > 0 THEN
  135. ls_data_type = dw_1.Describe(ls_modify_str+".ColType")
  136. IF ls_data_type = "long" THEN
  137. ll_statusflag = dw_1.GetItemNumber(ll_row,ls_modify_str)
  138. END IF
  139. END IF
  140. IF Pos(ls_modify_str,'woodcodeflag') > 0 THEN
  141. ls_data_type = dw_1.Describe(ls_modify_str+".ColType")
  142. IF ls_data_type = "long" THEN
  143. ll_woodcodeflag = dw_1.GetItemNumber(ll_row,ls_modify_str)
  144. END IF
  145. END IF
  146. IF Pos(ls_modify_str,'pcodeflag') > 0 THEN
  147. ls_data_type = dw_1.Describe(ls_modify_str+".ColType")
  148. IF ls_data_type = "long" THEN
  149. ll_pcodeflag = dw_1.GetItemNumber(ll_row,ls_modify_str)
  150. END IF
  151. END IF
  152. IF Pos(ls_modify_str,'status') > 0 And Pos(ls_modify_str,'statusflag') = 0 And Pos(ls_modify_str,'statustype') = 0 THEN
  153. IF Len(ls_modify_str) = Len('status') Or Pos(ls_modify_str,'_status') > 0 THEN
  154. IF Not (Pos(ls_modify_str,'u_saletask_status') > 0 Or &
  155. Pos(ls_modify_str,'u_buytask_status') > 0 Or &
  156. Pos(ls_modify_str,'u_order_ml_status') > 0 Or &
  157. Pos(ls_modify_str,'u_order_wfjg_status') > 0 Or &
  158. Pos(ls_modify_str,'u_rs_empinfo_status') > 0 ) THEN
  159. ls_status = ls_modify_str
  160. END IF
  161. END IF
  162. END IF
  163. IF Pos(ls_modify_str,'woodcode') > 0 And Pos(ls_modify_str,'woodcodeflag') = 0 And Pos(ls_modify_str,'woodcodetype') = 0 THEN
  164. IF Len(ls_modify_str) = Len('woodcode') Or Pos(ls_modify_str,'_woodcode') > 0 THEN
  165. ls_woodcode = ls_modify_str
  166. END IF
  167. END IF
  168. IF Pos(ls_modify_str,'pcode') > 0 And Pos(ls_modify_str,'pcodeflag') = 0 And Pos(ls_modify_str,'pcodetype') = 0 THEN
  169. IF Len(ls_modify_str) = Len('pcode') Or Pos(ls_modify_str,'_pcode') > 0 THEN
  170. ls_pcode = ls_modify_str
  171. END IF
  172. END IF
  173. NEXT
  174. IF ls_status <> '' THEN
  175. IF ll_statusflag = 5 THEN //只有5-仅填写时,才能用向下键切换到下一行, 使用ddlb时向下键是被屏蔽的
  176. dw_1.Modify(ls_status+".edit.case='any'")
  177. dw_1.Modify(ls_status+".edit.AutoSelect='Yes'")
  178. ELSE
  179. dw_1.Modify(ls_status+".ddlb.case='any'")
  180. IF ll_statusflag <> 0 Or ll_value = 0 THEN
  181. dw_1.Modify(ls_status+".dddw.allowedit = no")
  182. ELSE
  183. dw_1.Modify(ls_status+".dddw.allowedit = yes")
  184. END IF
  185. END IF
  186. END IF
  187. IF ls_woodcode <> '' THEN
  188. IF ll_woodcodeflag = 5 THEN
  189. dw_1.Modify(ls_woodcode+".edit.case='any'")
  190. dw_1.Modify(ls_woodcode+".edit.AutoSelect='Yes'")
  191. ELSE
  192. dw_1.Modify(ls_woodcode+".ddlb.case='any'")
  193. IF ll_woodcodeflag <> 0 Or ll_value = 0 THEN
  194. dw_1.Modify(ls_woodcode+".dddw.allowedit = no")
  195. ELSE
  196. dw_1.Modify(ls_woodcode+".dddw.allowedit = yes")
  197. END IF
  198. END IF
  199. END IF
  200. IF ls_pcode <> '' THEN
  201. IF ll_pcodeflag = 5 THEN
  202. dw_1.Modify(ls_pcode+".edit.case='any'")
  203. dw_1.Modify(ls_pcode+".edit.AutoSelect='Yes'")
  204. ELSE
  205. dw_1.Modify(ls_pcode+".ddlb.case='any'")
  206. IF ll_pcodeflag <> 0 Or ll_value = 0 THEN
  207. dw_1.Modify(ls_pcode+".dddw.allowedit = no")
  208. ELSE
  209. dw_1.Modify(ls_pcode+".dddw.allowedit = yes")
  210. END IF
  211. END IF
  212. END IF
  213. end event
  214. event ue_calculate();if dw_1.rowcount()<=0 then return
  215. if dw_2.rowcount()<=0 then return
  216. dw_1.accepttext()
  217. long ll_mtrlid
  218. string ll_status,ll_woodcode,ll_pcode
  219. int row,i
  220. for i = 1 to dw_1.rowcount()
  221. dw_1.object.oldprice[i] = dw_1.object.price[i]
  222. next
  223. for row = 1 to dw_1.rowcount()
  224. ll_mtrlid = dw_1.object.mtrlid[row]
  225. ll_status = dw_1.object.status[row]
  226. ll_woodcode = dw_1.object.woodcode[row]
  227. ll_pcode = dw_1.object.pcode[row]
  228. wf_select(ll_mtrlid)
  229. for i =1 to dw_2.rowcount()
  230. if dw_2.object.mtrlid[i] = ll_mtrlid and (dw_2.object.status[i] = ll_status or cur_status = 0) and (dw_2.object.woodcode[i] = ll_woodcode or cur_woodcode = 0) and (dw_2.object.pcode[i] = ll_pcode or cur_pcode = 0) then
  231. dw_2.object.price[i] = dw_1.object.price[row]
  232. end if
  233. next
  234. next
  235. for row= 1 to dw_2.rowcount()
  236. dw_2.object.fprice[row] = Round(dw_2.object.price[row] * dw_2.object.mrate[row] ,10)
  237. dw_2.object.enamt[row] = Round(dw_2.object.saleqty[row] *dw_2.object.price[row]* dw_2.object.rebate[row], 2)
  238. dw_2.object.enamt_tax[row] = Round((dw_2.object.saleqty[row] *dw_2.object.price[row]* dw_2.object.rebate[row]) * dw_2.object.tax[row] / (1 + dw_2.object.tax[row]), 2)
  239. dw_2.object.bsamt[row] = Round(dw_2.object.saleqty[row] * dw_2.object.fprice[row] * dw_2.object.rebate[row], 2)
  240. dw_2.object.bsamt_tax[row] = Round((dw_2.object.saleqty[row] * dw_2.object.fprice[row] * dw_2.object.rebate[row] ) * dw_2.object.tax[row] / (1 + dw_2.object.tax[row] ), 2)
  241. dw_2.object.ware_enprice[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) //原币,库存单位,单价
  242. dw_2.object.ware_fprice[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) * dw_2.object.mrate[row] //本位币,库存单位,单价
  243. dw_2.object.ware_price[row] = Round((dw_2.object.price[row] * dw_2.object.saleqty[row] )/Round(dw_2.object.saleqty[row] * dw_2.object.rate[row] ,5),10) * dw_2.object.mrate[row] * dw_2.object.rebate[row] //本位币,库存单位,实价
  244. dw_2.object.enamt_notax[row] = dw_2.object.enamt[row] - dw_2.object.enamt_tax[row]
  245. dw_2.object.enprice_notax[row] = dw_2.Object.price[row] / (1 + dw_2.object.tax[row])
  246. dw_2.object.relprice[row] = Round(dw_2.object.price[row] * dw_2.object.mrate[row] * dw_2.object.rebate[row],10)
  247. next
  248. end event
  249. event ue_mod_face();//
  250. if dw_1.rowcount() > 0 then
  251. cb_select.enabled = true
  252. else
  253. cb_select.enabled = false
  254. cb_delmtrl.enabled = false
  255. cb_modprice.enabled = false
  256. cb_delmx.enabled = false
  257. cb_savemx.enabled = false
  258. end if
  259. end event
  260. public subroutine wf_mod_face ();//
  261. if dw_1.rowcount() > 0 then
  262. cb_select.enabled = true
  263. cb_delmtrl.enabled = true
  264. cb_modprice.enabled = true
  265. cb_delmx.enabled = true
  266. cb_savemx.enabled = true
  267. else
  268. cb_select.enabled = false
  269. cb_delmtrl.enabled = false
  270. cb_modprice.enabled = false
  271. cb_delmx.enabled = false
  272. cb_savemx.enabled = false
  273. end if
  274. end subroutine
  275. public subroutine wf_savecheck ();//
  276. end subroutine
  277. public subroutine wf_select (integer arg_mtrlid);int arg_ifpz = 7
  278. select price_ifpz into :arg_ifpz from u_mtrldef where mtrlid = :arg_mtrlid;
  279. if sqlca.sqlcode <> 0 then
  280. arg_ifpz = 7
  281. end if
  282. if arg_ifpz = 1 then
  283. cur_status = 1
  284. cur_woodcode =0
  285. cur_pcode =0
  286. elseif arg_ifpz = 2 then
  287. cur_status = 0
  288. cur_woodcode =1
  289. cur_pcode =0
  290. elseif arg_ifpz = 3 then
  291. cur_status = 0
  292. cur_woodcode =0
  293. cur_pcode =1
  294. elseif arg_ifpz = 4 then
  295. cur_status = 1
  296. cur_woodcode =1
  297. cur_pcode =0
  298. elseif arg_ifpz = 5 then
  299. cur_status = 0
  300. cur_woodcode =1
  301. cur_pcode =1
  302. elseif arg_ifpz = 6 then
  303. cur_status = 1
  304. cur_woodcode =0
  305. cur_pcode =1
  306. elseif arg_ifpz = 7 then
  307. cur_status = 1
  308. cur_woodcode =1
  309. cur_pcode =1
  310. else
  311. cur_status = 0
  312. cur_woodcode =0
  313. cur_pcode =0
  314. end if
  315. end subroutine
  316. on w_outware_sale_mod_price.create
  317. int iCurrent
  318. call super::create
  319. this.cb_ok=create cb_ok
  320. this.cb_1=create cb_1
  321. this.cb_select=create cb_select
  322. this.cb_savemx=create cb_savemx
  323. this.cb_out=create cb_out
  324. this.cb_delmtrl=create cb_delmtrl
  325. this.st_3=create st_3
  326. this.em_1=create em_1
  327. this.pb_em1=create pb_em1
  328. this.st_4=create st_4
  329. this.em_2=create em_2
  330. this.pb_em2=create pb_em2
  331. this.pb_2=create pb_2
  332. this.dw_2=create dw_2
  333. this.cb_delmx=create cb_delmx
  334. this.dw_1=create dw_1
  335. this.cb_modprice=create cb_modprice
  336. iCurrent=UpperBound(this.Control)
  337. this.Control[iCurrent+1]=this.cb_ok
  338. this.Control[iCurrent+2]=this.cb_1
  339. this.Control[iCurrent+3]=this.cb_select
  340. this.Control[iCurrent+4]=this.cb_savemx
  341. this.Control[iCurrent+5]=this.cb_out
  342. this.Control[iCurrent+6]=this.cb_delmtrl
  343. this.Control[iCurrent+7]=this.st_3
  344. this.Control[iCurrent+8]=this.em_1
  345. this.Control[iCurrent+9]=this.pb_em1
  346. this.Control[iCurrent+10]=this.st_4
  347. this.Control[iCurrent+11]=this.em_2
  348. this.Control[iCurrent+12]=this.pb_em2
  349. this.Control[iCurrent+13]=this.pb_2
  350. this.Control[iCurrent+14]=this.dw_2
  351. this.Control[iCurrent+15]=this.cb_delmx
  352. this.Control[iCurrent+16]=this.dw_1
  353. this.Control[iCurrent+17]=this.cb_modprice
  354. end on
  355. on w_outware_sale_mod_price.destroy
  356. call super::destroy
  357. destroy(this.cb_ok)
  358. destroy(this.cb_1)
  359. destroy(this.cb_select)
  360. destroy(this.cb_savemx)
  361. destroy(this.cb_out)
  362. destroy(this.cb_delmtrl)
  363. destroy(this.st_3)
  364. destroy(this.em_1)
  365. destroy(this.pb_em1)
  366. destroy(this.st_4)
  367. destroy(this.em_2)
  368. destroy(this.pb_em2)
  369. destroy(this.pb_2)
  370. destroy(this.dw_2)
  371. destroy(this.cb_delmx)
  372. destroy(this.dw_1)
  373. destroy(this.cb_modprice)
  374. end on
  375. event open;call super::open;//long li_row
  376. //li_row=dw_1.insertrow(0)
  377. //dw_1.scrolltorow(li_row)
  378. //dw_1.SetColumn ('mtrlcode')
  379. EM_1.text = string(today())
  380. EM_2.text = string(today())
  381. dw_edit_mode = true
  382. wf_mod_face()
  383. end event
  384. event resize;call super::resize;dw_1.height = THIS.workspaceheight() - dw_1.y - 10
  385. dw_2.height = THIS.workspaceheight() - dw_2.y - 10
  386. dw_2.Width = this.workspacewidth() - dw_2.X - 10
  387. end event
  388. type cb_func from w_publ_base`cb_func within w_outware_sale_mod_price
  389. boolean visible = false
  390. end type
  391. type cb_exit from w_publ_base`cb_exit within w_outware_sale_mod_price
  392. boolean visible = false
  393. integer x = 2258
  394. integer y = 1380
  395. integer picsize = 16
  396. end type
  397. type cb_ok from uo_imflatbutton within w_outware_sale_mod_price
  398. boolean visible = false
  399. integer x = 2258
  400. integer y = 1276
  401. integer width = 311
  402. integer height = 92
  403. integer taborder = 20
  404. boolean bringtotop = true
  405. string text = "查找"
  406. string normalpicname = "ok.bmp"
  407. integer picsize = 16
  408. end type
  409. event clicked;call super::clicked;
  410. Long rslt = 1
  411. Long i
  412. long ll_printid
  413. Decimal ld_uprice,ld_jgprice, lde_rebate, lde_tax
  414. String arg_msg
  415. dw_1.AcceptText()
  416. uo_inware uo_ware
  417. uo_ware = create uo_inware
  418. uo_ware.commit_transaction = sqlca
  419. i = dw_1.GetNextModified(0 , Primary!)
  420. IF i = 0 THEN
  421. arg_msg = "单价没有修改"
  422. rslt = 0
  423. GOTO ext
  424. END IF
  425. DO WHILE i > 0
  426. ll_printid = dw_1.Object.u_inwaremx_printid[i]
  427. ld_uprice = abs(dw_1.Object.u_inwaremx_uprice[i])
  428. ld_jgprice = 0
  429. lde_rebate = dw_1.Object.u_inwaremx_rebate[i]
  430. lde_tax = dw_1.Object.u_inwaremx_tax[i]
  431. IF uo_ware.mod_price(ins_scid,ins_inwareid,ll_printid,ld_uprice,ld_jgprice,lde_rebate, lde_tax,arg_msg,false) = 0 THEN
  432. arg_msg = "行:"+string(i)+","+arg_msg
  433. rslt = 0
  434. GOTO ext
  435. END IF
  436. i = dw_1.GetNextModified(i, Primary!)
  437. LOOP
  438. ext:
  439. destroy uo_ware
  440. IF rslt = 0 THEN
  441. ROLLBACK;
  442. MessageBox('错误',arg_msg, StopSign!, OK! )
  443. RETURN
  444. ELSE
  445. COMMIT;
  446. MessageBox('提示','修改单价成功!', Information!, OK! )
  447. Close(Parent)
  448. END IF
  449. end event
  450. type cb_1 from commandbutton within w_outware_sale_mod_price
  451. integer x = 59
  452. integer y = 24
  453. integer width = 302
  454. integer height = 100
  455. integer taborder = 30
  456. boolean bringtotop = true
  457. integer textsize = -9
  458. integer weight = 400
  459. fontcharset fontcharset = gb2312charset!
  460. fontpitch fontpitch = variable!
  461. string facename = "宋体"
  462. string text = "选择物料"
  463. end type
  464. event clicked;
  465. IF Not IsValid(W_mtrldef_edit) THEN
  466. s_edit_index_tran s_tranf8 //传递参数使用
  467. //s_tranf8.if_retrieve_all = This.retrieve_all //是否一次retrieve所有行
  468. s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  469. s_tranf8.arg_pkid = 0 //目标定位pkid (备用)
  470. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  471. s_tranf8.if_select_all = True //多选
  472. s_tranf8.b_long = -2 //选产品 --20190401 暂时更改为记录上次选择
  473. s_tranf8.d_long = -1 //仓库
  474. Long ls_j,child_row
  475. child_row = dw_1.GetRow()
  476. IF dw_1.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_1.Object.mtrlcode[dw_1.GetRow()])
  477. OpenWithParm(W_mtrldef_edit,s_tranf8) //调用
  478. s_mtrldef_array s_inscust
  479. s_inscust = Message.PowerObjectParm //接受返回结构
  480. IF UpperBound(s_inscust.mtrlid) > 0 and s_inscust.mtrlid[1] > 0 THEN dw_2.reset()
  481. FOR ls_j = 1 To UpperBound(s_inscust.mtrlid)
  482. IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  483. IF dw_1.GetRow() > 0 THEN
  484. IF dw_1.Object.mtrlid[child_row] <> 0 THEN
  485. child_row = dw_1.InsertRow (0)
  486. ELSE
  487. child_row = dw_1.GetRow()
  488. END IF
  489. ELSE
  490. child_row = dw_1.InsertRow (0)
  491. END IF
  492. dw_1.Object.mtrlid[child_row] = s_inscust.mtrlid[ls_j]
  493. dw_1.Object.mtrlcode[child_row] = s_inscust.mtrlcode[ls_j]
  494. dw_1.Object.mtrlname[child_row] = s_inscust.mtrlname[ls_j]
  495. dw_1.Object.statusflag[child_row] = s_inscust.statusflag[ls_j]
  496. dw_1.Object.woodcodeflag[child_row] = s_inscust.woodcodeflag[ls_j]
  497. dw_1.Object.pcodeflag[child_row] = s_inscust.pcodeflag[ls_j]
  498. end if
  499. next
  500. end if
  501. wf_mod_face()
  502. parent.TriggerEvent('ue_allowedit')
  503. end event
  504. type cb_select from commandbutton within w_outware_sale_mod_price
  505. integer x = 2199
  506. integer y = 32
  507. integer width = 302
  508. integer height = 100
  509. integer taborder = 40
  510. boolean bringtotop = true
  511. integer textsize = -9
  512. integer weight = 400
  513. fontcharset fontcharset = gb2312charset!
  514. fontpitch fontpitch = variable!
  515. string facename = "宋体"
  516. string text = "查找"
  517. end type
  518. event clicked;if dw_1.rowcount()<=0 then return
  519. dw_1.AcceptText()
  520. dw_2.Reset()
  521. s_outware_price s_outp
  522. long i,j,row
  523. long ll_mtrlid
  524. string ll_status,ll_woodcode,ll_pcode,ll_mtrlname,ll_mtrlcode
  525. decimal ll_price,ll_saleqty,ll_rebate,ll_tax,ll_mrate,ll_rate
  526. decimal ll_fprice,ll_enamt,ll_enamt_tax,ll_bsamt,ll_bsamt_tax,ll_ware_enprice,ll_ware_price,ll_ware_fprice,ll_enamt_notax,ll_enprice_notax
  527. datetime bdate,edate
  528. long ls_scid,ls_outwareid,ls_enprice,ls_printid
  529. string ls_outwarecode,arg_msg
  530. bdate = datetime(date(EM_1.TEXT),time(0))
  531. edate = datetime(date(EM_2.TEXT),time('23:59:59'))
  532. for i = 1 to dw_1.rowcount()
  533. ll_mtrlid = dw_1.object.mtrlid[i]
  534. ll_status = dw_1.object.status[i]
  535. ll_woodcode = dw_1.object.woodcode[i]
  536. ll_pcode = dw_1.object.pcode[i]
  537. ll_price = dw_1.object.price[i]//修改后单价
  538. ll_mtrlname = dw_1.object.mtrlname[i]
  539. ll_mtrlcode = dw_1.object.mtrlcode[i]
  540. wf_select(ll_mtrlid)
  541. DECLARE C1 CURSOR FOR
  542. select
  543. u_outware.mrate,
  544. u_outwaremx.scid,
  545. u_outwaremx.outwareid,
  546. u_outware.outwarecode,
  547. u_outwaremx.printid,
  548. u_outwaremx.enprice,
  549. u_outwaremx.saleqty,
  550. u_outwaremx.rebate,
  551. u_outwaremx.tax,
  552. u_outwaremx.rate,
  553. u_outwaremx.fprice,
  554. u_outwaremx.enamt,
  555. u_outwaremx.enamt_tax,
  556. u_outwaremx.bsamt,
  557. u_outwaremx.bsamt_tax,
  558. u_outwaremx.ware_enprice,
  559. u_outwaremx.ware_fprice,
  560. u_outwaremx.ware_price,
  561. u_outwaremx.enprice_notax,
  562. u_outwaremx.status,
  563. u_outwaremx.woodcode,
  564. u_outwaremx.pcode
  565. from u_outware inner join u_outwaremx on u_outware.outwareid = u_outwaremx.outwareid
  566. where u_outwaremx.mtrlid =:ll_mtrlid and
  567. (u_outwaremx.status = :ll_status or :cur_status = 0) and
  568. (u_outwaremx.woodcode =:ll_woodcode or :cur_woodcode = 0) and
  569. (u_outwaremx.pcode = :ll_pcode or :cur_pcode = 0) and
  570. u_outware.outdate >= :bdate and u_outware.outdate<=:edate and
  571. u_outware.flag = 0 and u_outware.secflag = 0;
  572. OPEN C1;
  573. FETCH C1 INTO :ll_mrate,:ls_scid,:ls_outwareid,:ls_outwarecode,:ls_printid,:ls_enprice,:ll_saleqty,:ll_rebate,:ll_tax,:ll_rate,:ll_fprice,:ll_enamt,:ll_enamt_tax,:ll_bsamt,:ll_bsamt_tax,:ll_ware_enprice,:ll_ware_price,:ll_ware_fprice,:ll_enprice_notax,:ll_status,:ll_woodcode,:ll_pcode;
  574. DO WHILE sqlca.SQLCODE=0
  575. j += 1
  576. s_outp.scid[j] = ls_scid
  577. s_outp.mtrlid[j] = ll_mtrlid
  578. s_outp.mtrlcode[j] = ll_mtrlcode
  579. s_outp.mtrlname[j] = ll_mtrlname
  580. s_outp.outwareid[j] = ls_outwareid
  581. s_outp.outwarecode[j] = ls_outwarecode
  582. s_outp.printid[j] = ls_printid
  583. s_outp.enprice[j] = ls_enprice
  584. s_outp.status[j] = ll_status
  585. s_outp.woodcode[j] = ll_woodcode
  586. s_outp.pcode[j] = ll_pcode
  587. s_outp.price[j] =ll_price
  588. s_outp.saleqty[j] =ll_saleqty
  589. s_outp.rebate[j] =ll_rebate
  590. s_outp.tax[j] =ll_tax
  591. s_outp.mrate[j] =ll_mrate
  592. s_outp.rate[j] =ll_rate
  593. s_outp.fprice[j] =ll_fprice
  594. s_outp.enamt[j] =ll_enamt
  595. s_outp.enamt_tax[j] =ll_enamt_tax
  596. s_outp.bsamt[j] =ll_bsamt
  597. s_outp.bsamt_tax[j] =ll_bsamt_tax
  598. s_outp.ware_enprice[j] =ll_ware_enprice
  599. s_outp.ware_price[j] =ll_ware_price
  600. s_outp.ware_fprice[j] =ll_ware_fprice
  601. s_outp.enprice_notax[j] =ll_enprice_notax
  602. FETCH C1 INTO :ll_mrate,:ls_scid,:ls_outwareid,:ls_outwarecode,:ls_printid,:ls_enprice,:ll_saleqty,:ll_rebate,:ll_tax,:ll_rate,:ll_fprice,:ll_enamt,:ll_enamt_tax,:ll_bsamt,:ll_bsamt_tax,:ll_ware_enprice,:ll_ware_price,:ll_ware_fprice,:ll_enprice_notax,:ll_status,:ll_woodcode,:ll_pcode;
  603. LOOP
  604. CLOSE C1;
  605. next
  606. if upperbound(s_outp.outwareid) > 0 then
  607. for i = 1 to upperbound(s_outp.outwareid)
  608. if s_outp.outwareid[i] <=0 then continue
  609. row = dw_2.insertrow(0)
  610. dw_2.object.mtrlid[row] = s_outp.mtrlid[i]
  611. dw_2.object.mtrlname[row] = s_outp.mtrlname[i]
  612. dw_2.object.mtrlcode[row] = s_outp.mtrlcode[i]
  613. dw_2.object.scid[row] = s_outp.scid[i]
  614. dw_2.object.printid[row] = s_outp.printid[i]
  615. dw_2.object.outwareid[row] = s_outp.outwareid[i]
  616. dw_2.object.outwarecode[row] = s_outp.outwarecode[i]
  617. dw_2.object.enprice[row] = s_outp.enprice[i]
  618. dw_2.object.price[row] = s_outp.enprice[i]
  619. dw_2.object.status[row] = s_outp.status[i]
  620. dw_2.object.woodcode[row] = s_outp.woodcode[i]
  621. dw_2.object.pcode[row] = s_outp.pcode[i]
  622. dw_2.object.saleqty[row] = s_outp.saleqty[i]
  623. dw_2.object.rate[row] = s_outp.rate[i]
  624. dw_2.object.tax[row] = s_outp.tax[i]
  625. dw_2.object.mrate[row] = s_outp.mrate[i]
  626. dw_2.object.rebate[row] = s_outp.rebate[i]
  627. dw_2.object.fprice[row] = s_outp.fprice[i]
  628. dw_2.object.enamt[row] = s_outp.enamt[i]
  629. dw_2.object.enamt_tax[row] = s_outp.enamt_tax[i]
  630. dw_2.object.bsamt[row] = s_outp.bsamt[i]
  631. dw_2.object.bsamt_tax[row] = s_outp.bsamt_tax[i]
  632. dw_2.object.ware_enprice[row] = s_outp.ware_enprice[i]
  633. dw_2.object.ware_fprice[row] = s_outp.ware_fprice[i]
  634. dw_2.object.ware_price[row] = s_outp.ware_price[i]
  635. dw_2.object.enamt_notax[row] = dw_2.object.enamt[row] - dw_2.object.enamt_tax[row]
  636. dw_2.object.enprice_notax[row] = s_outp.enprice_notax[i]
  637. dw_2.object.relprice[row] = Round(s_outp.price[i] * s_outp.mrate[i] * s_outp.rebate[i],10)
  638. next
  639. end if
  640. wf_mod_face()
  641. end event
  642. type cb_savemx from commandbutton within w_outware_sale_mod_price
  643. integer x = 2967
  644. integer y = 32
  645. integer width = 302
  646. integer height = 100
  647. integer taborder = 50
  648. boolean bringtotop = true
  649. integer textsize = -9
  650. integer weight = 400
  651. fontcharset fontcharset = gb2312charset!
  652. fontpitch fontpitch = variable!
  653. string facename = "宋体"
  654. string text = "更新"
  655. end type
  656. event clicked;if dw_2.rowcount() <= 0 then return
  657. parent.TriggerEvent('ue_calculate')
  658. wf_mod_face()
  659. long i
  660. long ll_scid,ll_outwareid,ll_printid,ll_mtrlid
  661. string ll_status,ll_woodcode,ll_pcode,ll_opemp
  662. datetime ll_updatetime
  663. decimal ll_enprice,ll_price,ll_enamt,ll_enamt_tax,ll_bsamt,ll_bsamt_tax,ll_oldprice,ll_fprice
  664. decimal ll_ware_enprice,ll_ware_fprice ,ll_ware_price,ll_enamt_notax,ll_enprice_notax,ll_relprice
  665. string arg_msg
  666. dw_1.accepttext()
  667. for i = 1 to dw_1.rowcount()
  668. if dw_1.object.oldprice[i] <> dw_1.object.price[i] then
  669. IF MessageBox('是否继续','修改单价数据已经改变,是否继续更新??',Question!,YesNo!,1 ) = 2 THEN
  670. RETURN
  671. END IF
  672. end if
  673. next
  674. for i = 1 to dw_2.rowcount()
  675. SELECT Top 1 getdate() Into :ll_updatetime From u_user;
  676. ll_scid = dw_2.object.scid[i]
  677. ll_outwareid = dw_2.object.outwareid[i]
  678. ll_printid = dw_2.object.printid[i]
  679. ll_mtrlid = dw_2.object.mtrlid[i]
  680. ll_status = dw_2.object.status[i]
  681. ll_woodcode = dw_2.object.woodcode[i]
  682. ll_pcode = dw_2.object.pcode[i]
  683. ll_enprice = dw_2.object.enprice[i]
  684. ll_opemp = publ_operator
  685. ll_price = dw_2.object.price[i]
  686. ll_enamt = dw_2.object.enamt[i]
  687. ll_enamt_tax = dw_2.object.enamt_tax[i]
  688. ll_bsamt = dw_2.object.bsamt[i]
  689. ll_bsamt_tax = dw_2.object.bsamt_tax[i]
  690. ll_fprice = dw_2.object.fprice[i]
  691. ll_ware_enprice = dw_2.object.ware_enprice[i]
  692. ll_ware_fprice = dw_2.object.ware_fprice[i]
  693. ll_ware_price = dw_2.object.ware_price[i]
  694. ll_ware_fprice = dw_2.object.ware_fprice[i]
  695. ll_ware_price = dw_2.object.ware_price[i]
  696. ll_enamt_notax = dw_2.object.enamt_notax[i]
  697. ll_enprice_notax = dw_2.object.enprice_notax[i]
  698. ll_relprice = dw_2.object.relprice[i]
  699. update u_outwaremx
  700. set enprice = :ll_price,
  701. enamt = :ll_enamt,
  702. enamt_tax = :ll_enamt_tax,
  703. bsamt = :ll_bsamt,
  704. bsamt_tax = :ll_bsamt_tax,
  705. fprice = :ll_fprice,
  706. ware_enprice = :ll_ware_enprice,
  707. ware_fprice = :ll_ware_fprice,
  708. ware_price = :ll_ware_price,
  709. enprice_notax = :ll_enprice_notax,
  710. price = :ll_relprice,
  711. ware_amt = :ll_bsamt
  712. where scid = :ll_scid and
  713. outwareid = :ll_outwareid and
  714. printid = :ll_printid and
  715. mtrlid = :ll_mtrlid and
  716. status = :ll_status and
  717. woodcode = :ll_woodcode and
  718. pcode = :ll_pcode ;
  719. if sqlca.sqlcode = 0 then
  720. INSERT INTO u_outware_mod_price
  721. (scid,
  722. outwareid,
  723. printid,
  724. mtrlid,
  725. status,
  726. woodcode,
  727. pcode,
  728. enprice,
  729. updatetime,
  730. opemp
  731. )
  732. VALUES (
  733. :ll_scid,
  734. :ll_outwareid,
  735. :ll_printid,
  736. :ll_mtrlid,
  737. :ll_status,
  738. :ll_woodcode,
  739. :ll_pcode,
  740. :ll_enprice,
  741. :ll_updatetime,
  742. :ll_opemp
  743. );
  744. if sqlca.sqlcode <> 0 then
  745. arg_msg = '无法插入更新记录'
  746. messagebox('提示',arg_msg)
  747. rollback;
  748. return;
  749. end if
  750. else
  751. arg_msg = '无法更新单价'
  752. messagebox('提示',arg_msg)
  753. rollback;
  754. return;
  755. end if
  756. next
  757. messagebox('提示','更新单价成功')
  758. commit;
  759. wf_mod_face()
  760. end event
  761. type cb_out from commandbutton within w_outware_sale_mod_price
  762. integer x = 3282
  763. integer y = 32
  764. integer width = 302
  765. integer height = 100
  766. integer taborder = 60
  767. boolean bringtotop = true
  768. integer textsize = -9
  769. integer weight = 400
  770. fontcharset fontcharset = gb2312charset!
  771. fontpitch fontpitch = variable!
  772. string facename = "宋体"
  773. string text = "退出"
  774. boolean cancel = true
  775. end type
  776. event clicked;close(parent)
  777. end event
  778. type cb_delmtrl from commandbutton within w_outware_sale_mod_price
  779. integer x = 366
  780. integer y = 24
  781. integer width = 302
  782. integer height = 100
  783. integer taborder = 70
  784. boolean bringtotop = true
  785. integer textsize = -9
  786. integer weight = 400
  787. fontcharset fontcharset = gb2312charset!
  788. fontpitch fontpitch = variable!
  789. string facename = "宋体"
  790. string text = "删除物料"
  791. end type
  792. event clicked;if dw_1.getrow() <=0 then return
  793. long ll_mtrlid
  794. string ll_status,ll_woodcode,ll_pcode
  795. ll_mtrlid = dw_1.object.mtrlid[dw_1.getrow()]
  796. ll_status = dw_1.object.status[dw_1.getrow()]
  797. ll_woodcode = dw_1.object.woodcode[dw_1.getrow()]
  798. ll_pcode = dw_1.object.pcode[dw_1.getrow()]
  799. wf_select(ll_mtrlid)
  800. dw_1.deleterow(dw_1.getrow())
  801. int i
  802. for i = 1 to dw_2.rowcount()
  803. if dw_2.object.mtrlid[i] = ll_mtrlid and (dw_2.object.status[i] = ll_status or cur_pcode = 0) and (dw_2.object.woodcode[i] = ll_woodcode or cur_woodcode = 0) and (dw_2.object.pcode[i] = ll_pcode or cur_pcode = 0) then
  804. dw_2.deleterow(i)
  805. i --
  806. end if
  807. next
  808. wf_mod_face()
  809. end event
  810. type st_3 from statictext within w_outware_sale_mod_price
  811. integer x = 699
  812. integer y = 48
  813. integer width = 201
  814. integer height = 60
  815. boolean bringtotop = true
  816. integer textsize = -9
  817. integer weight = 400
  818. fontcharset fontcharset = gb2312charset!
  819. fontpitch fontpitch = variable!
  820. string facename = "宋体"
  821. long textcolor = 33554432
  822. long backcolor = 134217739
  823. boolean enabled = false
  824. string text = "日期从:"
  825. alignment alignment = right!
  826. boolean focusrectangle = false
  827. end type
  828. type em_1 from editmask within w_outware_sale_mod_price
  829. integer x = 901
  830. integer y = 32
  831. integer width = 407
  832. integer height = 92
  833. integer taborder = 110
  834. boolean bringtotop = true
  835. integer textsize = -9
  836. integer weight = 400
  837. fontcharset fontcharset = gb2312charset!
  838. fontpitch fontpitch = variable!
  839. string facename = "宋体"
  840. long textcolor = 33554432
  841. borderstyle borderstyle = stylelowered!
  842. maskdatatype maskdatatype = datemask!
  843. string mask = "yyyy-mm-dd"
  844. boolean spin = true
  845. end type
  846. event rbuttondown;s_calender_arg s_calender
  847. s_calender.PointerX = THIS.PointerX()
  848. s_calender.PointerY = THIS.PointerY()
  849. s_calender.X = THIS.X
  850. s_calender.Y = THIS.Y
  851. OpenWithParm(w_calendar,s_calender)
  852. THIS.Text = String(id_date_selected)
  853. end event
  854. type pb_em1 from picturebutton within w_outware_sale_mod_price
  855. integer x = 1317
  856. integer y = 32
  857. integer width = 101
  858. integer height = 92
  859. integer taborder = 120
  860. boolean bringtotop = true
  861. integer textsize = -9
  862. integer weight = 400
  863. fontcharset fontcharset = gb2312charset!
  864. fontpitch fontpitch = variable!
  865. string facename = "宋体"
  866. string picturename = "date.BMP"
  867. alignment htextalign = left!
  868. end type
  869. event clicked;em_1.triggerevent(rbuttondown!)
  870. end event
  871. type st_4 from statictext within w_outware_sale_mod_price
  872. integer x = 1431
  873. integer y = 48
  874. integer width = 105
  875. integer height = 60
  876. boolean bringtotop = true
  877. integer textsize = -9
  878. integer weight = 400
  879. fontcharset fontcharset = gb2312charset!
  880. fontpitch fontpitch = variable!
  881. string facename = "宋体"
  882. long textcolor = 33554432
  883. long backcolor = 134217739
  884. boolean enabled = false
  885. string text = "到:"
  886. alignment alignment = right!
  887. boolean focusrectangle = false
  888. end type
  889. type em_2 from editmask within w_outware_sale_mod_price
  890. integer x = 1563
  891. integer y = 36
  892. integer width = 407
  893. integer height = 92
  894. integer taborder = 130
  895. boolean bringtotop = true
  896. integer textsize = -9
  897. integer weight = 400
  898. fontcharset fontcharset = gb2312charset!
  899. fontpitch fontpitch = variable!
  900. string facename = "宋体"
  901. long textcolor = 33554432
  902. borderstyle borderstyle = stylelowered!
  903. maskdatatype maskdatatype = datemask!
  904. string mask = "yyyy-mm-dd"
  905. boolean spin = true
  906. end type
  907. event rbuttondown;s_calender_arg s_calender
  908. s_calender.PointerX = THIS.PointerX()
  909. s_calender.PointerY = THIS.PointerY()
  910. s_calender.X = THIS.X
  911. s_calender.Y = THIS.Y
  912. OpenWithParm(w_calendar,s_calender)
  913. THIS.Text = String(id_date_selected)
  914. end event
  915. type pb_em2 from picturebutton within w_outware_sale_mod_price
  916. integer x = 1979
  917. integer y = 36
  918. integer width = 101
  919. integer height = 92
  920. integer taborder = 140
  921. boolean bringtotop = true
  922. integer textsize = -9
  923. integer weight = 400
  924. fontcharset fontcharset = gb2312charset!
  925. fontpitch fontpitch = variable!
  926. string facename = "宋体"
  927. string picturename = "date.BMP"
  928. alignment htextalign = left!
  929. end type
  930. event clicked;em_2.triggerevent(rbuttondown!)
  931. end event
  932. type pb_2 from picturebutton within w_outware_sale_mod_price
  933. integer x = 2089
  934. integer y = 36
  935. integer width = 101
  936. integer height = 92
  937. integer taborder = 150
  938. boolean bringtotop = true
  939. integer textsize = -9
  940. integer weight = 400
  941. fontcharset fontcharset = gb2312charset!
  942. fontpitch fontpitch = variable!
  943. string facename = "宋体"
  944. string picturename = "date1.BMP"
  945. alignment htextalign = left!
  946. end type
  947. event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  948. string menustr
  949. menustr="Text=本日~tEvent=ue_date1"
  950. menustr = menustr + "|" + "Text=本周~tEvent=ue_date2"
  951. menustr = menustr + "|" + "Text=本月~tEvent=ue_date3"
  952. menustr = menustr + "|" + "Text=上月~tEvent=ue_date4"
  953. if len(trim(menustr))<>0 then
  954. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  955. dmPopupMenu.mf_BuildMenu(This, menustr)
  956. dmPopupMenu.mf_PopMenu()
  957. Destroy dmPopupMenu
  958. end if
  959. end event
  960. type dw_2 from u_dw_rbtnfilter within w_outware_sale_mod_price
  961. integer x = 2642
  962. integer y = 140
  963. integer height = 1420
  964. integer taborder = 20
  965. boolean bringtotop = true
  966. string dataobject = "dw_outware_sale_mod_price_mx"
  967. boolean hscrollbar = true
  968. boolean vscrollbar = true
  969. end type
  970. event clicked;call super::clicked;if row <= 0 then return
  971. this.selectrow(0,false)
  972. this.setrow(row)
  973. this.selectrow(row,true)
  974. end event
  975. type cb_delmx from commandbutton within w_outware_sale_mod_price
  976. integer x = 2661
  977. integer y = 32
  978. integer width = 302
  979. integer height = 100
  980. integer taborder = 60
  981. boolean bringtotop = true
  982. integer textsize = -9
  983. integer weight = 400
  984. fontcharset fontcharset = gb2312charset!
  985. fontpitch fontpitch = variable!
  986. string facename = "宋体"
  987. string text = "删除明细"
  988. end type
  989. event clicked;if dw_2.getrow() <=0 then return
  990. dw_2.deleterow(dw_2.getrow())
  991. wf_mod_face()
  992. end event
  993. type dw_1 from u_dw_rbtnfilter within w_outware_sale_mod_price
  994. event ue_dropdown pbm_dwndropdown
  995. integer y = 140
  996. integer width = 2619
  997. integer height = 1540
  998. integer taborder = 20
  999. boolean bringtotop = true
  1000. string dataobject = "dw_outware_sale_mod_price"
  1001. boolean hscrollbar = true
  1002. boolean vscrollbar = true
  1003. end type
  1004. event ue_dropdown;String ls_col_pz,ls_col_mtrlid
  1005. String ls_pz_ch
  1006. String ls_col_value
  1007. String ls_data_type
  1008. Long ll_row,ll_mtrlid
  1009. s_pzwin_open arg_s_win
  1010. ll_row = This.GetRow()
  1011. IF ll_row > 0 THEN
  1012. ls_col_mtrlid = This.Describe("#1.Name")
  1013. //IF Not Pos(Lower(ls_col_mtrlid),'mtrlid') > 0 THEN RETURN
  1014. ll_mtrlid = this.object.mtrlid[ll_row]
  1015. ls_col_pz = This.GetColumnName( )
  1016. ls_data_type = this.Describe(ls_col_pz+".ColType")
  1017. IF Pos(Lower(ls_data_type),"char") > 0 THEN
  1018. ls_col_value = This.GetItemString(ll_row,ls_col_pz)
  1019. END IF
  1020. arg_s_win.arg_x = This.X + This.PointerX() + Parent.X
  1021. arg_s_win.arg_y = This.Y + This.PointerY() + Parent.Y
  1022. arg_s_win.arg_col = ls_col_pz
  1023. arg_s_win.arg_mtrlid = ll_mtrlid
  1024. arg_s_win.arg_col_value = ls_col_value
  1025. ls_pz_ch = f_mtrl_pz(arg_s_win)
  1026. IF isnull(ls_pz_ch) THEN RETURN
  1027. This.SetItem(ll_row,ls_col_pz,ls_pz_ch)
  1028. END IF
  1029. return 1
  1030. end event
  1031. event clicked;call super::clicked;if row <= 0 then return
  1032. this.selectrow(0,false)
  1033. this.setrow(row)
  1034. this.selectrow(row,true)
  1035. end event
  1036. event itemfocuschanged;call super::itemfocuschanged;dw_1.accepttext()
  1037. end event
  1038. event doubleclicked;call super::doubleclicked; if dwo.name = 'status' or dwo.name = 'woodcode' or dwo.name = 'pcode' then
  1039. string name
  1040. name =dwo.name
  1041. PARENT.trigger event ue_view_status(row,name)
  1042. end if
  1043. end event
  1044. type cb_modprice from commandbutton within w_outware_sale_mod_price
  1045. boolean visible = false
  1046. integer x = 2656
  1047. integer y = 144
  1048. integer width = 302
  1049. integer height = 100
  1050. integer taborder = 60
  1051. boolean bringtotop = true
  1052. integer textsize = -9
  1053. integer weight = 400
  1054. fontcharset fontcharset = gb2312charset!
  1055. fontpitch fontpitch = variable!
  1056. string facename = "宋体"
  1057. string text = "修改单价"
  1058. end type
  1059. event clicked;if dw_2.getrow() <=0 then return
  1060. if dw_1.getrow() <=0 then return
  1061. parent.TriggerEvent('ue_calculate')
  1062. wf_mod_face()
  1063. end event