w_rp_sale_mx.srw 23 KB

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