w_rp_sale_mx.srw 23 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. $PBExportHeader$w_rp_sale_mx.srw
  2. forward
  3. global type w_rp_sale_mx from w_publ_easyq
  4. end type
  5. type ddlb_1 from uo_ddlb_storageid within w_rp_sale_mx
  6. end type
  7. type st_1 from statictext within w_rp_sale_mx
  8. end type
  9. type st_2 from statictext within w_rp_sale_mx
  10. end type
  11. type ddlb_scid from uo_ddlb_scid within w_rp_sale_mx
  12. end type
  13. type st_5 from statictext within w_rp_sale_mx
  14. end type
  15. type ddlb_status from dropdownlistbox within w_rp_sale_mx
  16. end type
  17. type ddlb_2 from dropdownlistbox within w_rp_sale_mx
  18. end type
  19. type cb_other from uo_imflatbutton within w_rp_sale_mx
  20. end type
  21. end forward
  22. global type w_rp_sale_mx from w_publ_easyq
  23. integer width = 4475
  24. string title = "销售明细表"
  25. event ue_retrieve_fifo_cbmx ( )
  26. ddlb_1 ddlb_1
  27. st_1 st_1
  28. st_2 st_2
  29. ddlb_scid ddlb_scid
  30. st_5 st_5
  31. ddlb_status ddlb_status
  32. ddlb_2 ddlb_2
  33. cb_other cb_other
  34. end type
  35. global w_rp_sale_mx w_rp_sale_mx
  36. type variables
  37. Long cur_storageid_arr[]
  38. long cur_scid_arr[]
  39. Long cur_flag = -1 //-1:全部,0仓库未审,1仓库已审核
  40. Long cur_secflag = -1 //-1:全部,0财务未审
  41. long cur_priceflag= -1 //-1:全部,0未确认
  42. long cur_show=0
  43. long cur_scid
  44. end variables
  45. forward prototypes
  46. public subroutine wf_hidecol ()
  47. public subroutine wf_init_dw1 ()
  48. public function integer wf_face ()
  49. public subroutine wf_retrieve_cbmx ()
  50. public subroutine wf_retrieve_allmtrlware ()
  51. public subroutine wf_retrieve_allmtrlware_mx ()
  52. public subroutine wf_insert_1 ()
  53. end prototypes
  54. event ue_retrieve_fifo_cbmx();
  55. String ls_mtrlcode,ls_mtrlname
  56. Long ll_row
  57. Long ll_scid
  58. Long ll_outwareid
  59. Long ll_printid
  60. Long ll_mtrlwareid
  61. Decimal dec_uqty
  62. TRY
  63. IF UpperBound(cur_storageid_arr) > 0 THEN
  64. Long li_if_fifo = 0
  65. SELECT if_fifo
  66. INTO :li_if_fifo
  67. FROM u_storage
  68. Where storageid = :cur_storageid_arr[1] Using sqlca;
  69. IF li_if_fifo = 0 THEN
  70. cb_other.Enabled = False
  71. ELSE
  72. cb_other.Enabled = True
  73. END IF
  74. END IF
  75. ll_row = dw_1.GetRow()
  76. IF ll_row <= 0 THEN
  77. RETURN
  78. END IF
  79. ll_scid = dw_1.Object.u_outware_scid[ll_row]
  80. ll_outwareid = dw_1.Object.u_outware_outwareid[ll_row]
  81. ll_printid = dw_1.Object.printid[ll_row]
  82. ll_mtrlwareid = dw_1.Object.mtrlwareid[ll_row]
  83. dec_uqty = dw_1.Object.u_outwaremx_uqty[ll_row]
  84. ls_mtrlname = dw_1.Object.u_mtrldef_mtrlname[ll_row]
  85. IF IsValid(w_fifo_mtrlware_cb) THEN
  86. w_fifo_mtrlware_cb.WindowState = Normal!
  87. w_fifo_mtrlware_cb.cur_scid = ll_scid
  88. w_fifo_mtrlware_cb.cur_outwareid = ll_outwareid
  89. w_fifo_mtrlware_cb.cur_printid = ll_printid
  90. w_fifo_mtrlware_cb.cur_mtrlwareid = ll_mtrlwareid
  91. w_fifo_mtrlware_cb.cur_dec_uqty = dec_uqty
  92. w_fifo_mtrlware_cb.cur_mtrlname = ls_mtrlname
  93. w_fifo_mtrlware_cb.wf_retrieve_cbmx()
  94. w_fifo_mtrlware_cb.wf_retrieve_allmtrlware()
  95. w_fifo_mtrlware_cb.wf_retrieve_allmtrlware_mx()
  96. END IF
  97. Catch (runtimeerror er)
  98. END TRY
  99. end event
  100. public subroutine wf_hidecol ();s_hide_col s_col1,s_col2,s_col3,s_null
  101. s_col1.col_1 = 'u_outwaremx_costamt'
  102. s_col1.col_2 = 'cost'
  103. f_hide_col(490,dw_1,s_col1)
  104. s_col2.col_1 = 'gfamt'
  105. s_col2.col_2 = 'gpamt'
  106. s_col2.col_3 = 'gpr'
  107. s_col2.col_4 = 'gpamt_notax'
  108. s_col2.col_5 = 'gpr_notax'
  109. f_hide_col(843,dw_1,s_col2)
  110. s_col3.col_1 = 'u_outwaremx_enprice'
  111. s_col3.col_2 = 'enamt'
  112. s_col3.col_3 = 'fprice'
  113. s_col3.col_4 = 'famt'
  114. s_col3.col_5 = 'rebate'
  115. s_col3.col_6 = 'u_outwaremx_dftsaleprice'
  116. s_col3.col_7 = 'u_outwaremx_price'
  117. s_col3.col_8 = 'u_outwaremx_ware_fprice'
  118. s_col3.col_9 = 'ware_amt'
  119. s_col3.col_10 = 'u_outware_otheramt'
  120. f_hide_col(122,dw_1,s_col3)
  121. s_col3 = s_null
  122. s_col3.col_1 = 'famt_norebate'
  123. s_col3.col_2 = 'famt_rebate'
  124. f_hide_col(122,dw_1,s_col3)
  125. s_col3 = s_null
  126. s_col3.col_1 = 'newprice'
  127. f_hide_col(122,dw_1,s_col3)
  128. s_hide_col s_col_mtrlsectype
  129. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  130. f_hide_col(1308,dw_1,s_col_mtrlsectype)
  131. s_hide_col s_col_zxmtrlmode
  132. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  133. f_hide_col(1309,dw_1,s_col_zxmtrlmode)
  134. s_col3 = s_null
  135. s_col3.col_1 = 'u_outwaremx_costamt'
  136. s_col3.col_2 = 'cost'
  137. s_col3.col_3 = 'cost_notax'
  138. s_col3.col_4 = 'costamt_notax'
  139. f_hide_col(123,dw_1,s_col3)
  140. s_hide_col s_col_plan
  141. s_col_plan.col_1 = 'planprice'
  142. s_col_plan.col_2 = 'enamt_plan'
  143. s_col_plan.col_3 = 'gpamt_plan'
  144. f_hide_col(1451,dw_1,s_col_plan)
  145. end subroutine
  146. public subroutine wf_init_dw1 ();//IF sys_version = 802001 THEN
  147. // dw_1.DataObject = 'dw_rp_sale_mx_b'
  148. //ELSE
  149. // dw_1.DataObject = 'dw_rp_sale_mx' //[]
  150. //END IF
  151. //st_6.visible = false
  152. end subroutine
  153. public function integer wf_face ();
  154. IF cur_show = 0 THEN
  155. dw_1.Width = This.Width - dw_1.X - 40
  156. dw_1.Height = This.Height - dw_1.Y - 150
  157. END IF
  158. //IF cur_show = 1 THEN
  159. // dw_1.Width = This.Width - dw_1.X - 40
  160. // dw_1.Height = (This.Height - dw_1.Y - 150) / 5 *3
  161. //
  162. // dw_2.width=(This.Width - dw_1.X - 40) / 3 - 50
  163. // dw_2.y=dw_1.y + dw_1.Height + 20
  164. // dw_2.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  165. //
  166. // dw_3.x=dw_2.x + dw_2.width + 50
  167. // dw_3.width=(This.Width - dw_1.X - 40) / 3 - 50
  168. // dw_3.y=dw_1.y + dw_1.Height + 20
  169. // dw_3.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  170. //
  171. // dw_4.x=dw_3.x + dw_3.width + 50
  172. // dw_4.width=(This.Width - dw_1.X - 40) / 3 - 50
  173. // dw_4.y=dw_1.y + dw_1.Height + 20
  174. // dw_4.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  175. //
  176. //
  177. //end if
  178. return 1
  179. end function
  180. public subroutine wf_retrieve_cbmx ();////
  181. //
  182. //
  183. //Long ll_row
  184. //Long ll_scid,ll_outwareid,ll_printid
  185. //Decimal dec_uqty
  186. //
  187. //dw_2.Reset()
  188. //IF cur_show = 0 THEN RETURN
  189. //
  190. //ll_row = dw_1.GetRow()
  191. //IF ll_row = 0 THEN RETURN
  192. //
  193. //
  194. //ll_scid = dw_1.Object.u_outware_scid[ll_row]
  195. //ll_outwareid = dw_1.Object.u_outware_outwareid[ll_row]
  196. //ll_printid = dw_1.Object.printid[ll_row]
  197. //dec_uqty = dw_1.Object.u_outwaremx_uqty[ll_row]
  198. //
  199. //
  200. //IF dec_uqty < 0 THEN
  201. // dw_2.Title = '选中行 成本组成明细' + ' ' + '负数不算出仓成本!!'
  202. // RETURN
  203. //ELSE
  204. // dw_2.Title = '选中行 成本组成明细'
  205. //END IF
  206. //
  207. //dw_2.Retrieve(ll_scid,ll_outwareid,ll_printid)
  208. //
  209. //
  210. //cur_scid=ll_scid
  211. //
  212. //
  213. //
  214. end subroutine
  215. public subroutine wf_retrieve_allmtrlware ();////
  216. //
  217. //
  218. //Long ll_row
  219. //Long ll_scid,ll_mtrlwareid
  220. //Decimal dec_uqty
  221. //
  222. //dw_3.Reset()
  223. //IF cur_show = 0 THEN RETURN
  224. //
  225. //ll_row = dw_1.GetRow()
  226. //IF ll_row = 0 THEN RETURN
  227. //
  228. //
  229. //ll_scid = dw_1.Object.u_outware_scid[ll_row]
  230. //ll_mtrlwareid = dw_1.Object.mtrlwareid[ll_row]
  231. //dec_uqty = dw_1.Object.u_outwaremx_uqty[ll_row]
  232. //
  233. //
  234. //IF dec_uqty < 0 THEN
  235. // dw_3.Title = '选中行 库存所有进仓明细' + ' ' + '负数不算出仓成本!!'
  236. // RETURN
  237. //ELSE
  238. // dw_3.Title = '选中行 库存所有进仓明细'
  239. //END IF
  240. //
  241. //dw_3.Retrieve(ll_scid,ll_mtrlwareid)
  242. //
  243. //
  244. //
  245. //
  246. //
  247. //
  248. end subroutine
  249. public subroutine wf_retrieve_allmtrlware_mx ();////
  250. //
  251. //
  252. //Long ll_row
  253. //Long ll_scid,ll_mtrlwaremxid
  254. //Decimal dec_uqty
  255. //
  256. //dw_4.Reset()
  257. //IF cur_show = 0 THEN RETURN
  258. //
  259. //ll_row = dw_3.GetRow()
  260. //IF ll_row = 0 THEN RETURN
  261. //
  262. //
  263. //ll_mtrlwaremxid = dw_3.Object.mtrlwaremxid[ll_row]
  264. //
  265. //
  266. //
  267. //
  268. //dw_4.Retrieve(ll_mtrlwaremxid)
  269. //
  270. //
  271. //
  272. //
  273. //
  274. //
  275. end subroutine
  276. public subroutine wf_insert_1 ();Long i,j,ll_ds_cnt,itemid[]
  277. String ls_s,Name[],ls_m
  278. Long col = 30
  279. String ls_modify
  280. String ls_outwarecode_arr[]
  281. Long ll_mxbt,ll_i
  282. Long ll_ddd_cnt
  283. Long z
  284. String ls_outwarecode
  285. String tp_name1,tp_mxdscrp,tp_itype
  286. Long tp_itemid
  287. Decimal ld_amt,ld_billamt,ld_otheramt,ld_amt_real
  288. Decimal ld_bill_amt,ld_costamt,ld_gpamt
  289. //设置标题
  290. String ls_temp = ''
  291. String ls_long = ''
  292. dw_1.SetRedraw(False)
  293. datastore ds
  294. ds = Create datastore
  295. ds.DataObject = "ds_outware_item_list"
  296. ds.SetTransObject(sqlca)
  297. datastore ds_amt
  298. ds_amt = Create datastore
  299. ds_amt.DataObject = "ddd_outware_item_amt_mxdscrp"
  300. ds_amt.SetTransObject(sqlca)
  301. For ll_i = 1 To dw_1.RowCount()
  302. ll_mxbt++
  303. ls_outwarecode_arr[ll_mxbt] = dw_1.Object.u_outware_outwarecode[ll_i]
  304. Next
  305. If ll_mxbt = 0 Then
  306. ll_mxbt++
  307. ls_outwarecode_arr[ll_mxbt] = ''
  308. End If
  309. ll_ds_cnt = ds.Retrieve(ls_outwarecode_arr)
  310. If ll_ds_cnt > col Then
  311. ll_ds_cnt = col
  312. End If
  313. For i = 1 To ll_ds_cnt
  314. itemid[i] = Long(ds.Object.u_itemdef_itemid[i])
  315. Name[i] = String(ds.Object.u_itemdef_itemname[i])
  316. Next
  317. For j = 1 To col
  318. ls_s = "item"+String(j)
  319. dw_1.Modify(ls_s + '.Visible = 1')
  320. dw_1.Modify(ls_s+".format=~"#,##0.##~~tIF("+ls_s+"=0,'#','#,##0.##')~"")
  321. Next
  322. For j = 1 To col
  323. ls_m = "mxdscrp"+String(j)
  324. dw_1.Modify(ls_m + '.Visible = 1')
  325. Next
  326. For j = 1 To col
  327. ls_m = "itype"+String(j)
  328. dw_1.Modify(ls_m + '.Visible = 1')
  329. Next
  330. For j = ll_ds_cnt + 1 To col
  331. ls_modify = ''
  332. ls_s = "item" + String(j)
  333. dw_1.Modify(ls_s + '.Visible = 0')
  334. ls_modify = ls_modify + "destroy " + ls_s + '_t ~n ' + ls_s + '.visible=0 ~n '
  335. dw_1.Modify(ls_modify)
  336. Next
  337. For j = ll_ds_cnt + 1 To col
  338. ls_modify = ''
  339. ls_m = "mxdscrp" + String(j)
  340. dw_1.Modify(ls_m + '.Visible = 0')
  341. ls_modify = ls_modify + "destroy " + ls_m + '_t ~n ' + ls_m + '.visible=0 ~n '
  342. dw_1.Modify(ls_modify)
  343. Next
  344. For j = ll_ds_cnt + 1 To col
  345. ls_modify = ''
  346. ls_m = "itype" + String(j)
  347. dw_1.Modify(ls_m + '.Visible = 0')
  348. ls_modify = ls_modify + "destroy " + ls_m + '_t ~n ' + ls_m + '.visible=0 ~n '
  349. dw_1.Modify(ls_modify)
  350. Next
  351. For j = 1 To ll_ds_cnt
  352. ls_long = String(Long(Len( Name[j]) / 4) * 400 )
  353. If Long(ls_long) < 400 Then ls_long = '400'
  354. ls_temp = 'item' + String(j)
  355. dw_1.Modify(ls_temp + '.width = ' + ls_long)
  356. dw_1.Modify(ls_temp +"_t.text = '" + Name[j]+ "'")
  357. Next
  358. For j = 1 To ll_ds_cnt
  359. ls_temp = 'mxdscrp' + String(j)
  360. dw_1.Modify(ls_temp +"_t.text = '" + Name[j]+ "备注'")
  361. Next
  362. For j = 1 To ll_ds_cnt
  363. ls_temp = 'itype' + String(j)
  364. dw_1.Modify(ls_temp +"_t.text = '" + Name[j]+ "方向'")
  365. Next
  366. //插入数据
  367. If dw_1.RowCount() <= 0 Then Goto ext
  368. ll_ddd_cnt = ds_amt.Retrieve(ls_outwarecode_arr)
  369. Open(w_sys_wait_jdt) //初始化进度条
  370. w_sys_wait_jdt.Show()
  371. w_sys_wait_jdt.wf_accepttol(dw_1.RowCount())
  372. For z = 1 To dw_1.RowCount()
  373. ls_outwarecode = dw_1.Object.u_outware_outwarecode[z]
  374. ld_billamt = dw_1.Object.billamt[z]
  375. ld_otheramt = dw_1.Object.u_outware_otheramt[z]
  376. ld_costamt = dw_1.Object.costamt[z]
  377. ld_amt = 0
  378. ld_amt_real = 0
  379. w_sys_wait_jdt.st_msg.Text = ls_outwarecode + " 正在查询数据..." //进度信息
  380. For i = 1 To ll_ds_cnt
  381. tp_itemid = itemid[i]
  382. tp_name1 = 'item'+String(i)
  383. tp_mxdscrp = 'mxdscrp'+String(i)
  384. tp_itype = 'itype' + String(i)
  385. For j = 1 To ll_ddd_cnt
  386. If tp_itemid = ds_amt.Object.u_itemdef_itemid[j] And ls_outwarecode = ds_amt.Object.outwarecode[j] Then
  387. dw_1.SetItem(z,tp_name1,ds_amt.Object.amt_real[j])
  388. dw_1.SetItem(z,tp_mxdscrp,ds_amt.Object.mxdscrp[j])
  389. ld_amt = ld_amt + ds_amt.Object.amt[j]
  390. ld_amt_real = ld_amt_real + ds_amt.Object.amt_real[j]
  391. If Not IsNull(ds_amt.Object.u_outware_itemmx_itype[j]) Then
  392. Choose case ds_amt.Object.u_outware_itemmx_itype[j]
  393. case 1
  394. dw_1.SetItem(z,tp_itype,'增项')
  395. case 0
  396. dw_1.SetItem(z,tp_itype,'平项')
  397. case -1
  398. dw_1.SetItem(z,tp_itype,'减项')
  399. end choose
  400. End If
  401. End If
  402. Next
  403. Next
  404. ld_bill_amt = ld_billamt - ld_otheramt + ld_amt
  405. dw_1.Object.bill_amt[z] = ld_bill_amt
  406. ld_gpamt = ld_bill_amt - ld_costamt + ld_amt_real
  407. dw_1.Object.gpamt[z] = ld_gpamt
  408. dw_1.Object.itemamt_real[z] = ld_amt_real
  409. w_sys_wait_jdt.wf_inc(z)
  410. Yield()
  411. Next
  412. Close(w_sys_wait_jdt)
  413. ext:
  414. Destroy ds
  415. Destroy ds_amt
  416. dw_1.SetRedraw(True)
  417. end subroutine
  418. on w_rp_sale_mx.create
  419. int iCurrent
  420. call super::create
  421. this.ddlb_1=create ddlb_1
  422. this.st_1=create st_1
  423. this.st_2=create st_2
  424. this.ddlb_scid=create ddlb_scid
  425. this.st_5=create st_5
  426. this.ddlb_status=create ddlb_status
  427. this.ddlb_2=create ddlb_2
  428. this.cb_other=create cb_other
  429. iCurrent=UpperBound(this.Control)
  430. this.Control[iCurrent+1]=this.ddlb_1
  431. this.Control[iCurrent+2]=this.st_1
  432. this.Control[iCurrent+3]=this.st_2
  433. this.Control[iCurrent+4]=this.ddlb_scid
  434. this.Control[iCurrent+5]=this.st_5
  435. this.Control[iCurrent+6]=this.ddlb_status
  436. this.Control[iCurrent+7]=this.ddlb_2
  437. this.Control[iCurrent+8]=this.cb_other
  438. end on
  439. on w_rp_sale_mx.destroy
  440. call super::destroy
  441. destroy(this.ddlb_1)
  442. destroy(this.st_1)
  443. destroy(this.st_2)
  444. destroy(this.ddlb_scid)
  445. destroy(this.st_5)
  446. destroy(this.ddlb_status)
  447. destroy(this.ddlb_2)
  448. destroy(this.cb_other)
  449. end on
  450. event resize;ln_bar.EndX = This.Width
  451. ln_bar2.EndX = This.Width
  452. ln_1.EndX = This.Width
  453. ln_2.EndX = This.Width
  454. ln_3.EndX = This.Width
  455. ln_4.EndX = This.Width
  456. r_bar.Width = This.Width
  457. IF cur_show = 0 THEN
  458. dw_1.Width = This.Width - dw_1.X - 40
  459. dw_1.Height = This.Height - dw_1.Y - 150
  460. END IF
  461. //IF cur_show = 1 THEN
  462. // dw_1.Width = This.Width - dw_1.X - 40
  463. // dw_1.Height = (This.Height - dw_1.Y - 150) / 5 *3
  464. //
  465. // dw_2.width=(This.Width - dw_1.X - 40) / 3 - 50
  466. // dw_2.y=dw_1.y + dw_1.Height + 20
  467. // dw_2.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  468. //
  469. // dw_3.x=dw_2.x + dw_2.width + 50
  470. // dw_3.width=(This.Width - dw_1.X - 40) / 3 - 50
  471. // dw_3.y=dw_1.y + dw_1.Height + 20
  472. // dw_3.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  473. //
  474. // dw_4.x=dw_3.x + dw_3.width + 50
  475. // dw_4.width=(This.Width - dw_1.X - 40) / 3 - 50
  476. // dw_4.y=dw_1.y + dw_1.Height + 20
  477. // dw_4.Height = (This.Height - dw_1.Y - 150) / 5 *2 - 50
  478. //
  479. //
  480. //end if
  481. //
  482. end event
  483. type cb_func from w_publ_easyq`cb_func within w_rp_sale_mx
  484. end type
  485. type cb_exit from w_publ_easyq`cb_exit within w_rp_sale_mx
  486. integer x = 1504
  487. integer y = 4
  488. end type
  489. type cb_2 from w_publ_easyq`cb_2 within w_rp_sale_mx
  490. integer x = 1202
  491. integer y = 4
  492. boolean bringtotop = true
  493. end type
  494. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_sale_mx
  495. boolean bringtotop = true
  496. end type
  497. type cb_1 from w_publ_easyq`cb_1 within w_rp_sale_mx
  498. boolean bringtotop = true
  499. end type
  500. event cb_1::clicked;DateTime first_date,end_date
  501. first_date = DateTime(Date(em_1.Text),Time(0))
  502. end_date = DateTime(Date(em_2.Text),Time('23:59:59'))
  503. If first_date < sys_showsaledata_mindt Then first_date = sys_showsaledata_mindt
  504. Int li_option_outrep,li_option_opemp
  505. String ls_option_opemp
  506. If sys_power_issuper Then
  507. li_option_outrep = 0
  508. Else
  509. li_option_outrep = sys_option_outrep
  510. End If
  511. If sys_power_issuper Then
  512. li_option_opemp = 0
  513. // ls_option_opemp = publ_operator
  514. Else
  515. li_option_opemp = sys_option_opemp_sale
  516. ls_option_opemp = publ_operator
  517. End If
  518. If dw_1.DataObject = 'dw_rp_sale_mx_fh_xm' Then
  519. dw_1.uf_save_profile_layout()
  520. dw_1.DataObject = 'dw_rp_sale_mx_fh_xm'
  521. dw_1.uf_read_profile_layout()
  522. f_title_change(dw_1)
  523. dw_1.SetTransObject(sqlca)
  524. dw_1.Retrieve(cur_scid_arr,first_date,end_date,cur_flag,cur_secflag,cur_storageid_arr,sys_areaid, sys_user_outrep, li_option_outrep,cur_priceflag,ls_option_opemp,li_option_opemp)
  525. wf_insert_1()
  526. Else
  527. dw_1.Retrieve(cur_scid_arr,first_date,end_date,cur_flag,cur_secflag,cur_storageid_arr,sys_areaid, sys_user_outrep, li_option_outrep,cur_priceflag,ls_option_opemp,li_option_opemp)
  528. End If
  529. wf_hidecol()
  530. end event
  531. type st_3 from w_publ_easyq`st_3 within w_rp_sale_mx
  532. integer x = 2048
  533. end type
  534. type st_4 from w_publ_easyq`st_4 within w_rp_sale_mx
  535. integer x = 2766
  536. end type
  537. type em_1 from w_publ_easyq`em_1 within w_rp_sale_mx
  538. integer x = 2267
  539. integer taborder = 130
  540. end type
  541. type em_2 from w_publ_easyq`em_2 within w_rp_sale_mx
  542. integer x = 2857
  543. integer taborder = 140
  544. end type
  545. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_sale_mx
  546. integer x = 2016
  547. end type
  548. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_sale_mx
  549. integer x = 1806
  550. integer y = 16
  551. end type
  552. type dw_1 from w_publ_easyq`dw_1 within w_rp_sale_mx
  553. integer y = 300
  554. integer width = 3173
  555. integer height = 1660
  556. string dataobject = "dw_rp_sale_mx"
  557. end type
  558. event dw_1::doubleclicked;call super::doubleclicked;IF row > 0 THEN
  559. String ls_code
  560. Long ll_scid
  561. ll_scid = THIS.Object.u_outware_scid[row]
  562. ls_code = THIS.Object.u_outware_outwarecode[row]
  563. f_open_win(ll_scid,ls_code)
  564. END IF
  565. //messagebox('1','sss1')
  566. end event
  567. event dw_1::getfocus;call super::getfocus;this.Modify ("DataWindow.selected.mouse=yes")
  568. end event
  569. event dw_1::rowfocuschanged;call super::rowfocuschanged;wf_retrieve_cbmx()
  570. wf_retrieve_allmtrlware()
  571. Parent.TriggerEvent('ue_retrieve_fifo_cbmx')
  572. end event
  573. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_sale_mx
  574. end type
  575. type sle_cust from w_publ_easyq`sle_cust within w_rp_sale_mx
  576. end type
  577. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_sale_mx
  578. end type
  579. type st_cust from w_publ_easyq`st_cust within w_rp_sale_mx
  580. end type
  581. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_sale_mx
  582. boolean visible = true
  583. integer x = 1806
  584. integer y = 108
  585. end type
  586. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_sale_mx
  587. integer x = 2683
  588. end type
  589. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_sale_mx
  590. integer x = 3269
  591. end type
  592. type pb_2 from w_publ_easyq`pb_2 within w_rp_sale_mx
  593. integer x = 3378
  594. end type
  595. type cb_help from w_publ_easyq`cb_help within w_rp_sale_mx
  596. integer x = 1353
  597. integer y = 4
  598. end type
  599. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_sale_mx
  600. end type
  601. type gb_1 from w_publ_easyq`gb_1 within w_rp_sale_mx
  602. end type
  603. type ln_bar from w_publ_easyq`ln_bar within w_rp_sale_mx
  604. end type
  605. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_sale_mx
  606. end type
  607. type r_bar from w_publ_easyq`r_bar within w_rp_sale_mx
  608. end type
  609. type ln_1 from w_publ_easyq`ln_1 within w_rp_sale_mx
  610. end type
  611. type ln_2 from w_publ_easyq`ln_2 within w_rp_sale_mx
  612. end type
  613. type ln_3 from w_publ_easyq`ln_3 within w_rp_sale_mx
  614. end type
  615. type ln_4 from w_publ_easyq`ln_4 within w_rp_sale_mx
  616. end type
  617. type ddlb_1 from uo_ddlb_storageid within w_rp_sale_mx
  618. integer x = 795
  619. integer y = 204
  620. integer width = 681
  621. integer height = 1108
  622. integer taborder = 140
  623. boolean bringtotop = true
  624. end type
  625. event constructor;call super::constructor;cur_storageid_arr = this.uo_storageid_arr
  626. Parent.TriggerEvent('ue_retrieve_fifo_cbmx')
  627. end event
  628. event selectionchanged;call super::selectionchanged;cur_storageid_arr = this.uo_storageid_arr
  629. Parent.TriggerEvent('ue_retrieve_fifo_cbmx')
  630. end event
  631. type st_1 from statictext within w_rp_sale_mx
  632. integer x = 635
  633. integer y = 208
  634. integer width = 146
  635. integer height = 48
  636. boolean bringtotop = true
  637. integer textsize = -9
  638. integer weight = 400
  639. fontcharset fontcharset = gb2312charset!
  640. fontpitch fontpitch = variable!
  641. string facename = "宋体"
  642. long textcolor = 33554432
  643. long backcolor = 134217739
  644. string text = "仓库"
  645. alignment alignment = right!
  646. boolean focusrectangle = false
  647. end type
  648. type st_2 from statictext within w_rp_sale_mx
  649. integer x = 1495
  650. integer y = 212
  651. integer width = 128
  652. integer height = 48
  653. boolean bringtotop = true
  654. integer textsize = -9
  655. integer weight = 400
  656. fontcharset fontcharset = gb2312charset!
  657. fontpitch fontpitch = variable!
  658. string facename = "宋体"
  659. long textcolor = 33554432
  660. long backcolor = 134217739
  661. string text = "状态"
  662. alignment alignment = right!
  663. boolean focusrectangle = false
  664. end type
  665. type ddlb_scid from uo_ddlb_scid within w_rp_sale_mx
  666. integer x = 142
  667. integer y = 204
  668. integer width = 480
  669. integer height = 620
  670. integer taborder = 130
  671. boolean bringtotop = true
  672. end type
  673. event constructor;call super::constructor;cur_scid_arr = THIS.uo_scid_arr
  674. end event
  675. event selectionchanged;call super::selectionchanged;
  676. cur_scid_arr = THIS.uo_scid_arr
  677. cb_1.triggerevent(clicked!)
  678. end event
  679. type st_5 from statictext within w_rp_sale_mx
  680. integer x = 5
  681. integer y = 208
  682. integer width = 128
  683. integer height = 48
  684. boolean bringtotop = true
  685. integer textsize = -9
  686. integer weight = 400
  687. fontcharset fontcharset = gb2312charset!
  688. fontpitch fontpitch = variable!
  689. string facename = "宋体"
  690. long textcolor = 33554432
  691. long backcolor = 134217739
  692. string text = "分部"
  693. alignment alignment = right!
  694. boolean focusrectangle = false
  695. end type
  696. type ddlb_status from dropdownlistbox within w_rp_sale_mx
  697. integer x = 1641
  698. integer y = 204
  699. integer width = 389
  700. integer height = 556
  701. integer taborder = 90
  702. boolean bringtotop = true
  703. integer textsize = -9
  704. integer weight = 400
  705. fontcharset fontcharset = gb2312charset!
  706. fontpitch fontpitch = variable!
  707. string facename = "宋体"
  708. long textcolor = 33554432
  709. string text = "[全部]"
  710. boolean sorted = false
  711. string item[] = {"[全部]","待确认","待仓库审","待财务审","审核完毕"}
  712. borderstyle borderstyle = stylelowered!
  713. end type
  714. event selectionchanged;IF this.text = "[全部]" THEN
  715. cur_flag = -1
  716. cur_secflag = -1
  717. cur_priceflag = -1
  718. ELSEIF this.text = "待确认" THEN
  719. cur_flag = -1
  720. cur_secflag = -1
  721. cur_priceflag = 0
  722. ELSEIF this.text = "待仓库审" THEN
  723. cur_flag = 0
  724. cur_secflag = -1
  725. cur_priceflag = -1
  726. ELSEIF this.text = "待财务审" THEN
  727. cur_flag = 1
  728. cur_secflag = 0
  729. cur_priceflag = -1
  730. ELSEIF this.text = "审核完毕" THEN
  731. cur_flag = 1
  732. cur_secflag = 1
  733. cur_priceflag = -1
  734. END IF
  735. cb_1.triggerevent(clicked!)
  736. end event
  737. type ddlb_2 from dropdownlistbox within w_rp_sale_mx
  738. integer x = 2647
  739. integer y = 80
  740. integer width = 736
  741. integer height = 756
  742. integer taborder = 120
  743. boolean bringtotop = true
  744. integer textsize = -9
  745. integer weight = 400
  746. fontcharset fontcharset = gb2312charset!
  747. fontpitch fontpitch = variable!
  748. string facename = "宋体"
  749. long textcolor = 33554432
  750. string text = "明细表"
  751. boolean sorted = false
  752. string item[] = {"明细表","结算方式","明细表不合并","明细表(含单据小计)","销售发货汇总表(含项目)"}
  753. borderstyle borderstyle = stylelowered!
  754. end type
  755. event selectionchanged;dw_1.uf_save_profile_layout()
  756. If This.Text = '明细表' Then
  757. dw_1.DataObject = 'dw_rp_sale_mx'
  758. ElseIf This.Text = '结算方式' Then
  759. dw_1.DataObject = 'dw_rp_sale_mx_bank'
  760. ElseIf This.Text = '明细表不合并' Then
  761. dw_1.DataObject = 'dw_rp_sale_mx_bhb'
  762. ElseIf This.Text = '明细表(含单据小计)' Then
  763. dw_1.DataObject = 'dw_rp_sale_mx_djxj'
  764. ElseIf This.Text = '销售发货汇总表(含项目)' Then
  765. dw_1.DataObject = 'dw_rp_sale_mx_fh_xm'
  766. End If
  767. wf_replacedw()
  768. If This.Text = '销售发货汇总表(含项目)' Then
  769. If cbx_loginretr.Checked Then
  770. cb_1.TriggerEvent(Clicked!)
  771. End If
  772. Else
  773. cb_1.TriggerEvent(Clicked!)
  774. End If
  775. end event
  776. type cb_other from uo_imflatbutton within w_rp_sale_mx
  777. integer x = 818
  778. integer width = 384
  779. integer height = 164
  780. integer taborder = 140
  781. boolean bringtotop = true
  782. string text = "成本组成明细"
  783. string normalpicname = "imexport.BMP"
  784. integer picsize = 16
  785. toolbaralignment pic_align = alignattop!
  786. boolean border = false
  787. end type
  788. event clicked;call super::clicked;
  789. s_edit_index_tran s_ch_tran //传递参数使用
  790. long ll_row
  791. long ll_scid
  792. long ll_outwareid
  793. long ll_printid
  794. long ll_mtrlwareid
  795. decimal dec_uqty
  796. string ls_mtrlname
  797. ll_row = dw_1.GetRow()
  798. IF ll_row = 0 THEN RETURN
  799. ll_scid = dw_1.Object.u_outware_scid[ll_row]
  800. ll_outwareid = dw_1.Object.u_outware_outwareid[ll_row]
  801. ll_printid = dw_1.Object.printid[ll_row]
  802. ll_mtrlwareid= dw_1.Object.mtrlwareid[ll_row]
  803. dec_uqty = dw_1.Object.u_outwaremx_uqty[ll_row]
  804. ls_mtrlname= dw_1.Object.u_mtrldef_mtrlname[ll_row]
  805. s_ch_tran.b_long=ll_scid //cur_scid
  806. s_ch_tran.c_long=ll_outwareid //cur_outwareid
  807. s_ch_tran.d_long=ll_printid //cur_printid
  808. s_ch_tran.e_long=ll_mtrlwareid //cur_mtrlwareid
  809. s_ch_tran.b_decimal=dec_uqty //cur_dec_uqty
  810. s_ch_tran.b_string=ls_mtrlname //cur_mtrlname
  811. IF IsValid(w_fifo_mtrlware_cb) THEN
  812. w_fifo_mtrlware_cb.WindowState = Normal!
  813. w_fifo_mtrlware_cb.cur_scid =ll_scid
  814. w_fifo_mtrlware_cb.cur_outwareid =ll_outwareid
  815. w_fifo_mtrlware_cb.cur_printid = ll_printid
  816. w_fifo_mtrlware_cb.cur_mtrlwareid = ll_mtrlwareid
  817. w_fifo_mtrlware_cb.cur_dec_uqty = dec_uqty
  818. w_fifo_mtrlware_cb.cur_mtrlname = ls_mtrlname
  819. w_fifo_mtrlware_cb.wf_retrieve_cbmx()
  820. ELSE
  821. OpenWithParm(w_fifo_mtrlware_cb,s_ch_tran)
  822. END IF
  823. end event