w_rp_money_xs_fy.srw 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. $PBExportHeader$w_rp_money_xs_fy.srw
  2. forward
  3. global type w_rp_money_xs_fy from w_publ_easyq
  4. end type
  5. end forward
  6. global type w_rp_money_xs_fy from w_publ_easyq
  7. string title = "分部核算表"
  8. end type
  9. global w_rp_money_xs_fy w_rp_money_xs_fy
  10. type variables
  11. long cur_itemid[]
  12. string cur_columnname[]
  13. long cur_itemcnt
  14. end variables
  15. forward prototypes
  16. public subroutine wf_retr_item ()
  17. public subroutine wf_retr_itemmx ()
  18. end prototypes
  19. public subroutine wf_retr_item ();String ls_item = ''
  20. Long ls_costsid
  21. Int i = 1
  22. Int li_itemcnt = 40
  23. dw_1.SetRedraw(FALSE)
  24. datastore ds
  25. ds = CREATE datastore
  26. ds.DataObject = "ds_itemdef"
  27. ds.SetTransObject(sqlca)
  28. cur_itemcnt = ds.Retrieve()
  29. if cur_itemcnt > li_itemcnt then
  30. messagebox("系统提示","目前报表只支持最多"+string(li_itemcnt)+"个项目")
  31. cur_itemcnt = li_itemcnt
  32. end if
  33. DO WHILE i <= li_itemcnt
  34. dw_1.Modify("item"+String(i)+"_t.visible=true")
  35. dw_1.Modify("item"+String(i)+".visible=true")
  36. i++
  37. LOOP
  38. FOR i = 1 TO cur_itemcnt
  39. cur_itemid[i] = ds.Object.itemid[i]
  40. ls_item = ds.Object.itemname[i]
  41. cur_columnname[i] = "item"+String(i)
  42. dw_1.Modify("item"+String(i)+"_t.Text='"+ls_item+"'")
  43. NEXT
  44. DO WHILE i <= li_itemcnt
  45. dw_1.Modify("item"+String(i)+"_t.visible=false")
  46. dw_1.Modify("item"+String(i)+".visible=false")
  47. i++
  48. LOOP
  49. //wf_retr_itemmx()
  50. dw_1.SetRedraw(TRUE)
  51. end subroutine
  52. public subroutine wf_retr_itemmx ();Long i,j,rslt = 1
  53. Long ls_rowcount
  54. Long ll_itemid,ll_scid
  55. Decimal ld_temp_amt
  56. DateTime firstdate,enddate
  57. firstdate = DateTime(Date(em_1.Text),Time(0))
  58. enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  59. ls_rowcount = dw_1.RowCount()
  60. Open(w_sys_wait_jdt)
  61. w_sys_wait_jdt.wf_accepttol(ls_rowcount)
  62. FOR i = 1 TO ls_rowcount
  63. w_sys_wait_jdt.wf_inc(i)
  64. w_sys_wait_jdt.wf_set_msg('正在处理中....')
  65. ll_scid = dw_1.Object.scid[i]
  66. FOR j = 1 TO cur_itemcnt
  67. ll_itemid = cur_itemid[j]
  68. SELECT sum(u_income_expenses.amt * u_itemdef.itemflag)
  69. INTO :ld_temp_amt
  70. FROM u_income_expenses
  71. inner join u_income_expenses_mx on u_income_expenses_mx.billid=u_income_expenses.billid
  72. INNER JOIN
  73. u_itemdef ON u_income_expenses_mx.itemid = u_itemdef.itemid
  74. WHERE (u_income_expenses.flag = 1) AND
  75. (u_income_expenses.scid = :ll_scid) AND
  76. (u_itemdef.itemid = :ll_itemid) and
  77. u_income_expenses.outdate >= :firstdate and
  78. u_income_expenses.outdate <= :enddate;
  79. IF SQLCA.SQLCode <> 0 THEN
  80. ld_temp_amt = 0
  81. END IF
  82. //(u_income_expenses.secflag = 1) AND
  83. IF IsNull(ld_temp_amt) THEN ld_temp_amt = 0
  84. dw_1.SetItem(i,"item"+String(j),ld_temp_amt)
  85. NEXT
  86. NEXT
  87. Close(w_sys_wait_jdt)
  88. dw_1.AcceptText()
  89. end subroutine
  90. on w_rp_money_xs_fy.create
  91. call super::create
  92. end on
  93. on w_rp_money_xs_fy.destroy
  94. call super::destroy
  95. end on
  96. event open;call super::open;wf_retr_item()
  97. IF cbx_loginretr.Checked THEN
  98. cb_1.TriggerEvent(Clicked!)
  99. END IF
  100. end event
  101. type cb_func from w_publ_easyq`cb_func within w_rp_money_xs_fy
  102. end type
  103. type cb_exit from w_publ_easyq`cb_exit within w_rp_money_xs_fy
  104. end type
  105. type cb_2 from w_publ_easyq`cb_2 within w_rp_money_xs_fy
  106. end type
  107. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_money_xs_fy
  108. end type
  109. type cb_1 from w_publ_easyq`cb_1 within w_rp_money_xs_fy
  110. end type
  111. event cb_1::clicked;DateTime firstdate,enddate
  112. firstdate = DateTime(Date(em_1.Text),Time(0))
  113. enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  114. DELETE FROM u_parm_pay Where id = 2 ;
  115. IF sqlca.SQLCode <> 0 THEN
  116. MessageBox('错误','数据库操作失败!'+sqlca.SQLErrText,stopsign!,ok!)
  117. ROLLBACK;
  118. RETURN
  119. END IF
  120. INSERT INTO u_parm_pay (firstdate,enddate,id)
  121. Values (:firstdate,:enddate,2);
  122. IF sqlca.SQLCode <> 0 THEN
  123. MessageBox('错误','数据库操作失败!'+sqlca.SQLErrText,stopsign!,ok!)
  124. ROLLBACK;
  125. RETURN
  126. END IF
  127. COMMIT;
  128. dw_1.Retrieve(firstdate,enddate)
  129. wf_retr_itemmx()
  130. //dw_1.Object.dt_ar.Text = "日期范围: "+String(Date(firstdate))+" 到 "+em_2.Text
  131. end event
  132. type st_3 from w_publ_easyq`st_3 within w_rp_money_xs_fy
  133. end type
  134. type st_4 from w_publ_easyq`st_4 within w_rp_money_xs_fy
  135. end type
  136. type em_1 from w_publ_easyq`em_1 within w_rp_money_xs_fy
  137. end type
  138. type em_2 from w_publ_easyq`em_2 within w_rp_money_xs_fy
  139. end type
  140. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_money_xs_fy
  141. end type
  142. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_money_xs_fy
  143. end type
  144. type dw_1 from w_publ_easyq`dw_1 within w_rp_money_xs_fy
  145. integer y = 304
  146. string dataobject = "dw_rp_money_xs_fy"
  147. end type
  148. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_money_xs_fy
  149. end type
  150. type sle_cust from w_publ_easyq`sle_cust within w_rp_money_xs_fy
  151. end type
  152. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_money_xs_fy
  153. end type
  154. type st_cust from w_publ_easyq`st_cust within w_rp_money_xs_fy
  155. end type
  156. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_money_xs_fy
  157. boolean visible = true
  158. end type
  159. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_money_xs_fy
  160. end type
  161. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_money_xs_fy
  162. end type
  163. type pb_2 from w_publ_easyq`pb_2 within w_rp_money_xs_fy
  164. end type
  165. type cb_help from w_publ_easyq`cb_help within w_rp_money_xs_fy
  166. end type
  167. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_money_xs_fy
  168. end type
  169. type gb_1 from w_publ_easyq`gb_1 within w_rp_money_xs_fy
  170. end type
  171. type ln_bar from w_publ_easyq`ln_bar within w_rp_money_xs_fy
  172. end type
  173. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_money_xs_fy
  174. end type
  175. type r_bar from w_publ_easyq`r_bar within w_rp_money_xs_fy
  176. end type
  177. type ln_1 from w_publ_easyq`ln_1 within w_rp_money_xs_fy
  178. end type
  179. type ln_2 from w_publ_easyq`ln_2 within w_rp_money_xs_fy
  180. end type
  181. type ln_3 from w_publ_easyq`ln_3 within w_rp_money_xs_fy
  182. boolean visible = false
  183. end type
  184. type ln_4 from w_publ_easyq`ln_4 within w_rp_money_xs_fy
  185. boolean visible = false
  186. end type