w_rp_aging.srw 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774
  1. $PBExportHeader$w_rp_aging.srw
  2. forward
  3. global type w_rp_aging from w_publ_easyq
  4. end type
  5. type tv_1 from uo_tv_cusarea within w_rp_aging
  6. end type
  7. type ddlb_1 from uo_ddlb_moneyid within w_rp_aging
  8. end type
  9. type st_1 from statictext within w_rp_aging
  10. end type
  11. type cbx_ifmsttake from checkbox within w_rp_aging
  12. end type
  13. type cbx_type from checkbox within w_rp_aging
  14. end type
  15. type st_2 from statictext within w_rp_aging
  16. end type
  17. type ddlb_scid from uo_ddlb_scid within w_rp_aging
  18. end type
  19. type st_5 from statictext within w_rp_aging
  20. end type
  21. type cb_edit from uo_imflatbutton within w_rp_aging
  22. end type
  23. type cb_3 from uo_imflatbutton within w_rp_aging
  24. end type
  25. type rb_1 from radiobutton within w_rp_aging
  26. end type
  27. type rb_2 from radiobutton within w_rp_aging
  28. end type
  29. type dw_spttype from u_dw_rbtnfilter within w_rp_aging
  30. end type
  31. type cbx_1 from checkbox within w_rp_aging
  32. end type
  33. type s_bmstpay_wf from structure within w_rp_aging
  34. end type
  35. type s_bmsttake_ws from structure within w_rp_aging
  36. end type
  37. type s_bmsttake_ws_all from structure within w_rp_aging
  38. end type
  39. end forward
  40. type s_Bmstpay_wf from structure
  41. long payid
  42. decimal oriamt
  43. decimal payamt
  44. decimal wfamt
  45. end type
  46. type s_bmsttake_ws from structure
  47. long takeid
  48. decimal oriamt
  49. decimal takeamt
  50. decimal wsamt
  51. end type
  52. type s_bmsttake_ws_all from structure
  53. long cusid
  54. long scid
  55. long moneyid
  56. datetime takedate
  57. long takeid
  58. decimal oriamt
  59. decimal takeamt
  60. decimal wsamt
  61. end type
  62. global type w_rp_aging from w_publ_easyq
  63. integer x = 9
  64. integer y = 12
  65. string title = "账龄分析表"
  66. tv_1 tv_1
  67. ddlb_1 ddlb_1
  68. st_1 st_1
  69. cbx_ifmsttake cbx_ifmsttake
  70. cbx_type cbx_type
  71. st_2 st_2
  72. ddlb_scid ddlb_scid
  73. st_5 st_5
  74. cb_edit cb_edit
  75. cb_3 cb_3
  76. rb_1 rb_1
  77. rb_2 rb_2
  78. dw_spttype dw_spttype
  79. cbx_1 cbx_1
  80. end type
  81. global w_rp_aging w_rp_aging
  82. type variables
  83. private:
  84. s_bmsttake_ws ss_bmsttake_ws[]
  85. s_bmsttake_ws_all ss_bmsttake_ws_all[]
  86. s_Bmstpay_wf ss_Bmstpay_wf[]
  87. public:
  88. String ls_areaname = ''
  89. Long cur_moneyid = -1
  90. string ls_aging[]
  91. long cur_scid_arr1[],cur_scid =100
  92. long s_days,e_days
  93. datetime dd_enddate
  94. long ins_spttypeid
  95. end variables
  96. forward prototypes
  97. public subroutine wf_read_aging ()
  98. public subroutine wf_kf_days (string arg_str)
  99. public function decimal f_getys1 (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
  100. public function decimal f_getys (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
  101. public function decimal f_getys3 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
  102. public function decimal f_getys4 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
  103. public subroutine wf_init ()
  104. end prototypes
  105. public subroutine wf_read_aging ();//游标读收费项目
  106. integer i
  107. DECLARE read_aging CURSOR FOR
  108. SELECT u_money_aging.name
  109. FROM u_money_aging ;
  110. OPEN read_aging;
  111. i++
  112. FETCH read_aging INTO :ls_aging[i];
  113. DO WHILE sqlca.SQLCode = 0
  114. i++
  115. FETCH read_aging INTO :ls_aging[i];
  116. LOOP
  117. CLOSE read_aging;
  118. end subroutine
  119. public subroutine wf_kf_days (string arg_str);arg_str = Trim(arg_str)
  120. Integer ll_s,ll_e
  121. s_days = 0
  122. e_days = 0
  123. ll_s = Pos(arg_str,"至")
  124. s_days = Long(Left(arg_str,ll_s - 1))
  125. e_days = Long(Mid(arg_str,ll_s + 1,Len(arg_str) - ll_s -1))
  126. IF s_days = 0 or e_days= 0 THEN
  127. MessageBox("错误","分拆日期出错")
  128. END IF
  129. end subroutine
  130. public function decimal f_getys1 (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1,temamt
  131. //游标读收费项目
  132. Long i,j,k
  133. //FOR j = 1 To UpperBound(ss_bmsttake_ws)
  134. // ss_bmsttake_ws[j].takeid = 0
  135. // ss_bmsttake_ws[j].oriamt = 0
  136. // ss_bmsttake_ws[j].takeamt = 0
  137. // ss_bmsttake_ws[j].wsamt = 0
  138. //NEXT
  139. //DECLARE read_u_Bmsttake CURSOR FOR
  140. // SELECT u_Bmsttake.takeid,u_Bmsttake.oriamt,u_Bmsttake.takeamt,(msttakeamt - takeamt) as wsamt
  141. // FROM u_Bmsttake
  142. // WHERE
  143. // ( u_Bmsttake.cusid = :arg_custid) AND
  144. // ( u_Bmsttake.scid = :arg_scid ) AND
  145. // ( u_Bmsttake.moneyid = :arg_moneyid) AND
  146. // ( u_Bmsttake.takedate >= :arg_star ) AND
  147. // ( u_Bmsttake.takedate <= :arg_end) AND
  148. // (msttakeamt - takeamt<> 0);
  149. //// ((u_Bmsttake.oriamt = u_Bmsttake.msttakeamt) Or (msttakeamt - takeamt <> 0)) ;
  150. //// ((u_Bmsttake.oriamt > 0) Or (u_Bmsttake.oriamt < 0 And accountsid = 0));
  151. //
  152. //OPEN read_u_Bmsttake;
  153. //i++
  154. //FETCH read_u_Bmsttake Into :ss_bmsttake_ws[i].takeid,:ss_bmsttake_ws[i].oriamt,:ss_bmsttake_ws[i].takeamt,:ss_bmsttake_ws[i].wsamt;
  155. //
  156. //DO WHILE sqlca.SQLCode = 0
  157. // i++
  158. // FETCH read_u_Bmsttake Into :ss_bmsttake_ws[i].takeid,:ss_bmsttake_ws[i].oriamt,:ss_bmsttake_ws[i].takeamt,:ss_bmsttake_ws[i].wsamt;
  159. //LOOP
  160. //CLOSE read_u_Bmsttake;
  161. //
  162. //
  163. //IF arg_custid = 14 THEN
  164. // Long aaa
  165. // aaa = 1
  166. //END IF
  167. //messagebox("",string(UpperBound(ss_bmsttake_ws)))
  168. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  169. ss_bmsttake_ws[j].takeid = 0
  170. ss_bmsttake_ws[j].oriamt = 0
  171. ss_bmsttake_ws[j].takeamt = 0
  172. ss_bmsttake_ws[j].wsamt = 0
  173. NEXT
  174. k = 0
  175. FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
  176. IF ss_bmsttake_ws_all[j].cusid = arg_custid And &
  177. ss_bmsttake_ws_all[j].scid = arg_scid And &
  178. ss_bmsttake_ws_all[j].takedate >= arg_star And &
  179. ss_bmsttake_ws_all[j].takedate <= arg_end THEN
  180. k++
  181. ss_bmsttake_ws[k].takeid=ss_bmsttake_ws_all[j].takeid
  182. ss_bmsttake_ws[k].oriamt=ss_bmsttake_ws_all[j].oriamt
  183. ss_bmsttake_ws[k].takeamt=ss_bmsttake_ws_all[j].takeamt
  184. ss_bmsttake_ws[k].wsamt=ss_bmsttake_ws_all[j].wsamt
  185. END IF
  186. NEXT
  187. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  188. IF ss_bmsttake_ws[j].takeid > 0 THEN
  189. // IF ss_bmsttake_ws[j].takeamt <> 0 THEN
  190. IF ss_bmsttake_ws[j].oriamt > 0 THEN
  191. SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And takedate > :dd_enddate And listno > 0;
  192. ELSE
  193. SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And opdate > :dd_enddate And listno > 0;
  194. END IF
  195. IF IsNull(temamt) THEN temamt = 0
  196. ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].wsamt + temamt
  197. // ELSE
  198. // ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].oriamt
  199. //
  200. // END IF
  201. END IF
  202. NEXT
  203. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  204. IF ss_bmsttake_ws[j].takeid > 0 THEN
  205. amt = amt + ss_bmsttake_ws[j].wsamt
  206. END IF
  207. NEXT
  208. RETURN amt
  209. //
  210. //SELECT
  211. // isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收'
  212. //Into :amt
  213. //From u_Bmsttake Left Outer join u_accounts On
  214. //u_Bmsttake.accountsid = u_accounts.accountsid
  215. //Left Outer join u_itemdef On
  216. //u_Bmsttake.itemid = u_itemdef.itemid
  217. //Left Outer join cw_banktype On
  218. //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
  219. //u_scdef
  220. //Where
  221. //( u_Bmsttake.cusid = :arg_custid) And
  222. //( u_Bmsttake.scid = :arg_scid ) And
  223. //( u_Bmsttake.moneyid = :arg_moneyid) And
  224. //( u_Bmsttake.takedate >= :arg_star ) And
  225. //( u_Bmsttake.takedate < :arg_end) ;
  226. //
  227. ////////////////////////////////////
  228. //// SELECT
  229. //// isnull(sum(abs( u_Bmsttake.oriamt)),0)
  230. //// into :amt1
  231. //// FROM U_Bmsttake left outer join u_accounts on
  232. //// U_Bmsttake.accountsid = u_accounts.accountsid
  233. //// left outer join u_itemdef on
  234. //// U_Bmsttake.itemid = u_itemdef.itemid
  235. //// left outer join cw_banktype on
  236. //// U_Bmsttake.banktypeid = cw_banktype.banktypeid,
  237. //// u_scdef
  238. //// Where
  239. //// ( u_Bmsttake.cusid = :arg_custid) And
  240. ////( u_Bmsttake.scid = :arg_scid ) And
  241. ////( u_Bmsttake.moneyid = :arg_moneyid) And
  242. ////( u_Bmsttake.takedate > :arg_end ) And
  243. //// (u_Bmsttake.finishflag=1) and
  244. //// (u_Bmsttake.oriamt <0);
  245. //amt=amt+ amt1
  246. end function
  247. public function decimal f_getys (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);//Decimal amt,amt1
  248. //
  249. //SELECT
  250. //IsNull(sum(u_Bmsttake.oriamt),0)
  251. //Into :amt
  252. //From u_Bmsttake Left Outer join u_accounts On
  253. //u_Bmsttake.accountsid = u_accounts.accountsid
  254. //Left Outer join u_itemdef On
  255. //u_Bmsttake.itemid = u_itemdef.itemid
  256. //Left Outer join cw_banktype On
  257. //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
  258. //u_scdef
  259. //Where
  260. //( u_Bmsttake.cusid = :arg_custid) And
  261. //( u_Bmsttake.scid = :arg_scid ) And
  262. //( u_Bmsttake.moneyid = :arg_moneyid) And
  263. //( u_Bmsttake.takedate >= :arg_star ) And
  264. //( u_Bmsttake.takedate < :arg_end) ;
  265. //
  266. //RETURN amt
  267. Decimal amt,amt1,temamt
  268. //游标读收费项目
  269. Long i,j,k
  270. //FOR j = 1 To UpperBound(ss_bmsttake_ws)
  271. // ss_bmsttake_ws[j].takeid = 0
  272. // ss_bmsttake_ws[j].oriamt = 0
  273. // ss_bmsttake_ws[j].takeamt = 0
  274. // ss_bmsttake_ws[j].wsamt = 0
  275. //NEXT
  276. //DECLARE read_u_Bmsttake CURSOR FOR
  277. // SELECT u_Bmsttake.takeid,u_Bmsttake.oriamt,u_Bmsttake.takeamt,(msttakeamt - takeamt) as wsamt
  278. // FROM u_Bmsttake
  279. // WHERE
  280. // ( u_Bmsttake.cusid = :arg_custid) AND
  281. // ( u_Bmsttake.scid = :arg_scid ) AND
  282. // ( u_Bmsttake.moneyid = :arg_moneyid) AND
  283. // ( u_Bmsttake.takedate >= :arg_star ) AND
  284. // ( u_Bmsttake.takedate <= :arg_end) AND
  285. // (msttakeamt - takeamt<> 0);
  286. //// ((u_Bmsttake.oriamt = u_Bmsttake.msttakeamt) Or (msttakeamt - takeamt <> 0)) ;
  287. //// ((u_Bmsttake.oriamt > 0) Or (u_Bmsttake.oriamt < 0 And accountsid = 0));
  288. //
  289. //OPEN read_u_Bmsttake;
  290. //i++
  291. //FETCH read_u_Bmsttake Into :ss_bmsttake_ws[i].takeid,:ss_bmsttake_ws[i].oriamt,:ss_bmsttake_ws[i].takeamt,:ss_bmsttake_ws[i].wsamt;
  292. //
  293. //DO WHILE sqlca.SQLCode = 0
  294. // i++
  295. // FETCH read_u_Bmsttake Into :ss_bmsttake_ws[i].takeid,:ss_bmsttake_ws[i].oriamt,:ss_bmsttake_ws[i].takeamt,:ss_bmsttake_ws[i].wsamt;
  296. //LOOP
  297. //CLOSE read_u_Bmsttake;
  298. //
  299. //
  300. //IF arg_custid = 14 THEN
  301. // Long aaa
  302. // aaa = 1
  303. //END IF
  304. //messagebox("",string(UpperBound(ss_bmsttake_ws)))
  305. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  306. ss_bmsttake_ws[j].takeid = 0
  307. ss_bmsttake_ws[j].oriamt = 0
  308. ss_bmsttake_ws[j].takeamt = 0
  309. ss_bmsttake_ws[j].wsamt = 0
  310. NEXT
  311. k = 0
  312. FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
  313. IF ss_bmsttake_ws_all[j].cusid = arg_custid And &
  314. ss_bmsttake_ws_all[j].scid = arg_scid And &
  315. ss_bmsttake_ws_all[j].takedate >= arg_star And &
  316. ss_bmsttake_ws_all[j].takedate <= arg_end THEN
  317. k++
  318. ss_bmsttake_ws[k].takeid=ss_bmsttake_ws_all[j].takeid
  319. ss_bmsttake_ws[k].oriamt=ss_bmsttake_ws_all[j].oriamt
  320. ss_bmsttake_ws[k].takeamt=ss_bmsttake_ws_all[j].takeamt
  321. ss_bmsttake_ws[k].wsamt=ss_bmsttake_ws_all[j].wsamt
  322. END IF
  323. NEXT
  324. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  325. IF ss_bmsttake_ws[j].takeid > 0 THEN
  326. IF ss_bmsttake_ws[j].takeamt <> 0 THEN
  327. IF ss_bmsttake_ws[j].oriamt > 0 THEN
  328. SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And takedate > :dd_enddate And listno > 0;
  329. ELSE
  330. SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And opdate > :dd_enddate And listno > 0;
  331. END IF
  332. IF IsNull(temamt) THEN temamt = 0
  333. ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].wsamt + temamt
  334. ELSE
  335. ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].oriamt
  336. END IF
  337. END IF
  338. NEXT
  339. FOR j = 1 To UpperBound(ss_bmsttake_ws)
  340. IF ss_bmsttake_ws[j].takeid > 0 THEN
  341. amt = amt + ss_bmsttake_ws[j].wsamt
  342. END IF
  343. NEXT
  344. RETURN amt
  345. //
  346. //SELECT
  347. // isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收'
  348. //Into :amt
  349. //From u_Bmsttake Left Outer join u_accounts On
  350. //u_Bmsttake.accountsid = u_accounts.accountsid
  351. //Left Outer join u_itemdef On
  352. //u_Bmsttake.itemid = u_itemdef.itemid
  353. //Left Outer join cw_banktype On
  354. //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
  355. //u_scdef
  356. //Where
  357. //( u_Bmsttake.cusid = :arg_custid) And
  358. //( u_Bmsttake.scid = :arg_scid ) And
  359. //( u_Bmsttake.moneyid = :arg_moneyid) And
  360. //( u_Bmsttake.takedate >= :arg_star ) And
  361. //( u_Bmsttake.takedate < :arg_end) ;
  362. //
  363. ////////////////////////////////////
  364. //// SELECT
  365. //// isnull(sum(abs( u_Bmsttake.oriamt)),0)
  366. //// into :amt1
  367. //// FROM U_Bmsttake left outer join u_accounts on
  368. //// U_Bmsttake.accountsid = u_accounts.accountsid
  369. //// left outer join u_itemdef on
  370. //// U_Bmsttake.itemid = u_itemdef.itemid
  371. //// left outer join cw_banktype on
  372. //// U_Bmsttake.banktypeid = cw_banktype.banktypeid,
  373. //// u_scdef
  374. //// Where
  375. //// ( u_Bmsttake.cusid = :arg_custid) And
  376. ////( u_Bmsttake.scid = :arg_scid ) And
  377. ////( u_Bmsttake.moneyid = :arg_moneyid) And
  378. ////( u_Bmsttake.takedate > :arg_end ) And
  379. //// (u_Bmsttake.finishflag=1) and
  380. //// (u_Bmsttake.oriamt <0);
  381. //amt=amt+ amt1
  382. end function
  383. public function decimal f_getys3 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1
  384. SELECT
  385. IsNull(sum(u_Bmstpay.oriamt),0)
  386. Into :amt
  387. From u_Bmstpay Left Outer join u_accounts On
  388. u_Bmstpay.accountsid = u_accounts.accountsid
  389. Left Outer join u_itemdef On
  390. u_Bmstpay.itemid = u_itemdef.itemid
  391. Left Outer join cw_banktype On
  392. u_Bmstpay.banktypeid = cw_banktype.banktypeid,
  393. u_scdef
  394. Where
  395. ( u_Bmstpay.sptid = :arg_sptid) And
  396. ( u_Bmstpay.scid = :arg_scid ) And
  397. ( u_Bmstpay.moneyid = :arg_moneyid) And
  398. ( u_Bmstpay.paydate >= :arg_star ) And
  399. ( u_Bmstpay.paydate < :arg_end) ;
  400. RETURN amt
  401. end function
  402. public function decimal f_getys4 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1,temamt
  403. //游标读收费项目
  404. Integer i,j
  405. FOR j = 1 To UpperBound(ss_Bmstpay_wf)
  406. ss_Bmstpay_wf[j].payid = 0
  407. ss_Bmstpay_wf[j].oriamt = 0
  408. ss_Bmstpay_wf[j].payamt = 0
  409. ss_Bmstpay_wf[j].wfamt = 0
  410. NEXT
  411. DECLARE read_u_Bmstpay CURSOR FOR
  412. SELECT payid,oriamt,payamt
  413. FROM u_Bmstpay
  414. WHERE
  415. ( u_Bmstpay.sptid = :arg_sptid) AND
  416. ( u_Bmstpay.scid = :arg_scid ) AND
  417. ( u_Bmstpay.moneyid = :arg_moneyid) AND
  418. ( u_Bmstpay.paydate >= :arg_star ) AND
  419. ( u_Bmstpay.paydate <= :arg_end) AND
  420. ( Mstpayamt - payamt<> 0);
  421. //(u_Bmstpay.oriamt = u_Bmstpay.Mstpayamt);
  422. OPEN read_u_Bmstpay;
  423. i++
  424. FETCH read_u_Bmstpay Into :ss_Bmstpay_wf[i].payid,:ss_Bmstpay_wf[i].oriamt,:ss_Bmstpay_wf[i].payamt;
  425. DO WHILE sqlca.SQLCode = 0
  426. i++
  427. FETCH read_u_Bmstpay Into :ss_Bmstpay_wf[i].payid,:ss_Bmstpay_wf[i].oriamt,:ss_Bmstpay_wf[i].payamt;
  428. LOOP
  429. CLOSE read_u_Bmstpay;
  430. FOR j = 1 To UpperBound(ss_Bmstpay_wf)
  431. IF ss_Bmstpay_wf[j].payid > 0 THEN
  432. // IF ss_Bmstpay_wf[j].payamt <> 0 THEN
  433. IF ss_Bmstpay_wf[j].oriamt > 0 THEN
  434. SELECT sum(payamt) Into :temamt From u_Bmstpaymx Where payid = :ss_Bmstpay_wf[j].payid And paydate > :dd_enddate And listno > 0;
  435. ELSE
  436. SELECT sum(payamt) Into :temamt From u_Bmstpaymx Where payid = :ss_Bmstpay_wf[j].payid And opdate > :dd_enddate And listno > 0;
  437. END IF
  438. IF IsNull(temamt) THEN temamt = 0
  439. ss_Bmstpay_wf[j].wfamt = ss_Bmstpay_wf[j].oriamt - ss_Bmstpay_wf[j].payamt + temamt
  440. // ELSE
  441. // ss_Bmstpay_wf[j].wfamt = ss_Bmstpay_wf[j].oriamt
  442. //
  443. // END IF
  444. END IF
  445. NEXT
  446. FOR j = 1 To UpperBound(ss_Bmstpay_wf)
  447. IF ss_Bmstpay_wf[j].payid > 0 THEN
  448. amt = amt + ss_Bmstpay_wf[j].wfamt
  449. END IF
  450. NEXT
  451. RETURN amt
  452. end function
  453. public subroutine wf_init ();open(w_sys_wait)
  454. Decimal amt,amt1,temamt
  455. //游标读收费项目
  456. long i,j
  457. FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
  458. ss_bmsttake_ws_all[j].cusid = 0
  459. ss_bmsttake_ws_all[j].scid = 0
  460. ss_bmsttake_ws_all[j].moneyid = 0
  461. ss_bmsttake_ws_all[j].takeid = 0
  462. ss_bmsttake_ws_all[j].oriamt = 0
  463. ss_bmsttake_ws_all[j].takeamt = 0
  464. ss_bmsttake_ws_all[j].wsamt = 0
  465. NEXT
  466. DECLARE read_u_Bmsttake_all CURSOR FOR
  467. SELECT u_Bmsttake.cusid, u_Bmsttake.scid,u_Bmsttake.moneyid,u_Bmsttake.takedate,u_Bmsttake.takeid,u_Bmsttake.oriamt,u_Bmsttake.takeamt,(msttakeamt - takeamt) as wsamt
  468. FROM u_Bmsttake where (msttakeamt - takeamt<> 0);
  469. OPEN read_u_Bmsttake_all;
  470. i++
  471. FETCH read_u_Bmsttake_all Into :ss_bmsttake_ws_all[i].cusid,:ss_bmsttake_ws_all[i].scid,:ss_bmsttake_ws_all[i].moneyid,:ss_bmsttake_ws_all[i].takedate,:ss_bmsttake_ws_all[i].takeid,:ss_bmsttake_ws_all[i].oriamt,:ss_bmsttake_ws_all[i].takeamt,:ss_bmsttake_ws_all[i].wsamt;
  472. DO WHILE sqlca.SQLCode = 0
  473. i++
  474. FETCH read_u_Bmsttake_all Into :ss_bmsttake_ws_all[i].cusid,:ss_bmsttake_ws_all[i].scid,:ss_bmsttake_ws_all[i].moneyid,:ss_bmsttake_ws_all[i].takedate,:ss_bmsttake_ws_all[i].takeid,:ss_bmsttake_ws_all[i].oriamt,:ss_bmsttake_ws_all[i].takeamt,:ss_bmsttake_ws_all[i].wsamt;
  475. LOOP
  476. CLOSE read_u_Bmsttake_all;
  477. close(w_sys_wait)
  478. end subroutine
  479. on w_rp_aging.create
  480. int iCurrent
  481. call super::create
  482. this.tv_1=create tv_1
  483. this.ddlb_1=create ddlb_1
  484. this.st_1=create st_1
  485. this.cbx_ifmsttake=create cbx_ifmsttake
  486. this.cbx_type=create cbx_type
  487. this.st_2=create st_2
  488. this.ddlb_scid=create ddlb_scid
  489. this.st_5=create st_5
  490. this.cb_edit=create cb_edit
  491. this.cb_3=create cb_3
  492. this.rb_1=create rb_1
  493. this.rb_2=create rb_2
  494. this.dw_spttype=create dw_spttype
  495. this.cbx_1=create cbx_1
  496. iCurrent=UpperBound(this.Control)
  497. this.Control[iCurrent+1]=this.tv_1
  498. this.Control[iCurrent+2]=this.ddlb_1
  499. this.Control[iCurrent+3]=this.st_1
  500. this.Control[iCurrent+4]=this.cbx_ifmsttake
  501. this.Control[iCurrent+5]=this.cbx_type
  502. this.Control[iCurrent+6]=this.st_2
  503. this.Control[iCurrent+7]=this.ddlb_scid
  504. this.Control[iCurrent+8]=this.st_5
  505. this.Control[iCurrent+9]=this.cb_edit
  506. this.Control[iCurrent+10]=this.cb_3
  507. this.Control[iCurrent+11]=this.rb_1
  508. this.Control[iCurrent+12]=this.rb_2
  509. this.Control[iCurrent+13]=this.dw_spttype
  510. this.Control[iCurrent+14]=this.cbx_1
  511. end on
  512. on w_rp_aging.destroy
  513. call super::destroy
  514. destroy(this.tv_1)
  515. destroy(this.ddlb_1)
  516. destroy(this.st_1)
  517. destroy(this.cbx_ifmsttake)
  518. destroy(this.cbx_type)
  519. destroy(this.st_2)
  520. destroy(this.ddlb_scid)
  521. destroy(this.st_5)
  522. destroy(this.cb_edit)
  523. destroy(this.cb_3)
  524. destroy(this.rb_1)
  525. destroy(this.rb_2)
  526. destroy(this.dw_spttype)
  527. destroy(this.cbx_1)
  528. end on
  529. event open;call super::open;em_1.Text = String(Today(),'yyyy-mm')+'-01'
  530. wf_init()
  531. //Int ifcusgroup
  532. //ifcusgroup = Integer(f_ProfileString (sys_empid,'dw_rp_musttake_balc_scid_fenyue', "ifcusgroup", '0'))
  533. IF rb_1.Checked = True THEN
  534. dw_1.DataObject = 'dw_rp_musttake_balc_scid_fenyue'
  535. tv_1.Visible = True
  536. dw_spttype.Visible = False
  537. dw_1.SetTransObject(sqlca)
  538. ELSE
  539. dw_1.DataObject = 'dw_rp_u_bmstpay_balc_scid_fenyue'
  540. dw_spttype.Visible = True
  541. tv_1.Visible = False
  542. dw_1.SetTransObject(sqlca)
  543. END IF
  544. dw_spttype.SetTransObject(sqlca)
  545. dw_1.ins_INIfile_name = sys_inifilename
  546. dw_1.ins_opemp = publ_operator
  547. dw_1.cardw_empid = sys_empid
  548. dw_1.cur_DataObject = dw_1.DataObject
  549. dw_1.uf_read_profile_layout()
  550. f_title_change(dw_1)
  551. IF cbx_loginretr.Checked THEN
  552. cb_1.TriggerEvent(Clicked!)
  553. END IF
  554. end event
  555. event ue_before_open;call super::ue_before_open;if_ue_retr=true
  556. if_ue_filter=true
  557. if_ue_sort=true
  558. if_ue_sentdataout=true
  559. end event
  560. event resize;call super::resize;tv_1.Height = dw_1.Height
  561. dw_spttype.x=tv_1.x
  562. dw_spttype.y=tv_1.y
  563. dw_spttype.width=tv_1.width
  564. dw_spttype.height=tv_1.height
  565. end event
  566. type cb_func from w_publ_easyq`cb_func within w_rp_aging
  567. end type
  568. type cb_exit from w_publ_easyq`cb_exit within w_rp_aging
  569. integer x = 919
  570. end type
  571. type cb_2 from w_publ_easyq`cb_2 within w_rp_aging
  572. boolean visible = false
  573. boolean bringtotop = true
  574. end type
  575. type cb_psetup from w_publ_easyq`cb_psetup within w_rp_aging
  576. boolean visible = false
  577. boolean bringtotop = true
  578. end type
  579. type cb_1 from w_publ_easyq`cb_1 within w_rp_aging
  580. boolean bringtotop = true
  581. end type
  582. event cb_1::clicked;Long i,j
  583. String ls_s
  584. DateTime firstdate,enddate
  585. firstdate = DateTime(Date("2000-01-01"),Time(0))
  586. enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  587. dd_enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
  588. IF rb_1.Checked = True THEN
  589. dw_1.DataObject = 'dw_rp_musttake_balc_scid_fenyue'
  590. tv_1.Visible = True
  591. dw_spttype.Visible = False
  592. dw_1.SetTransObject(sqlca)
  593. dw_1.Retrieve(ls_areaname)
  594. ELSE
  595. dw_1.DataObject = 'dw_rp_u_bmstpay_balc_scid_fenyue'
  596. dw_spttype.Visible = True
  597. tv_1.Visible = False
  598. dw_1.SetTransObject(sqlca)
  599. dw_1.Retrieve(ins_spttypeid)
  600. END IF
  601. wf_read_aging()
  602. IF rb_1.Checked = True THEN //应收表
  603. FOR i = 1 To dw_1.RowCount() //期初
  604. dw_1.Object.jine[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  605. NEXT
  606. FOR j = 1 To 24
  607. ls_s = "y" + String(j)
  608. dw_1.Modify(ls_s + '.Visible = 1')
  609. NEXT
  610. FOR j = UpperBound(ls_aging) * 2 - 1 To 24
  611. ls_s = "y" + String(j)
  612. dw_1.Modify(ls_s + '.Visible = 0')
  613. NEXT
  614. FOR j = 1 To UpperBound(ls_aging) - 1
  615. IF j = 1 THEN
  616. dw_1.Modify('y1.width = 500')
  617. dw_1.Modify("y1_t.text = '" + ls_aging[j] + "'")
  618. wf_kf_days( ls_aging[j])
  619. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  620. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  621. FOR i = 1 To dw_1.RowCount()
  622. dw_1.Object.y1[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  623. dw_1.AcceptText()
  624. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  625. dw_1.Object.y2[i] = dw_1.Object.y1[i] / dw_1.Object.jine[i] * 100
  626. END IF
  627. NEXT
  628. dw_1.Modify('y2.width = 500')
  629. dw_1.Modify("y2_t.text = '" + "所占比例%"+ "'")
  630. END IF
  631. IF j = 2 THEN
  632. dw_1.Modify('y3.width = 500')
  633. dw_1.Modify("y3_t.text = '" + ls_aging[j] + "'")
  634. wf_kf_days( ls_aging[j])
  635. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  636. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  637. FOR i = 1 To dw_1.RowCount()
  638. dw_1.Object.y3[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  639. dw_1.AcceptText()
  640. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  641. dw_1.Object.y4[i] = dw_1.Object.y3[i] / dw_1.Object.jine[i] * 100
  642. END IF
  643. NEXT
  644. dw_1.Modify('y4.width = 500')
  645. dw_1.Modify("y4_t.text = '" + "所占比例%"+ "'")
  646. END IF
  647. IF j = 3 THEN
  648. dw_1.Modify('y5.width = 500')
  649. dw_1.Modify("y5_t.text = '" + ls_aging[j] + "'")
  650. wf_kf_days( ls_aging[j])
  651. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  652. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  653. FOR i = 1 To dw_1.RowCount()
  654. dw_1.Object.y5[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  655. dw_1.AcceptText()
  656. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  657. dw_1.Object.y6[i] = dw_1.Object.y5[i] / dw_1.Object.jine[i] * 100
  658. END IF
  659. NEXT
  660. dw_1.Modify('y6.width = 500')
  661. dw_1.Modify("y6_t.text = '" + "所占比例%"+ "'")
  662. END IF
  663. IF j = 4 THEN
  664. dw_1.Modify('y7.width = 500')
  665. dw_1.Modify("y7_t.text = '" + ls_aging[j] + "'")
  666. wf_kf_days( ls_aging[j])
  667. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  668. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  669. FOR i = 1 To dw_1.RowCount()
  670. dw_1.Object.y7[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  671. dw_1.AcceptText()
  672. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  673. dw_1.Object.y8[i] = dw_1.Object.y7[i] / dw_1.Object.jine[i] * 100
  674. END IF
  675. NEXT
  676. dw_1.Modify('y8.width = 500')
  677. dw_1.Modify("y8_t.text = '" + "所占比例%"+ "'")
  678. END IF
  679. IF j = 5 THEN
  680. dw_1.Modify('y9.width = 500')
  681. dw_1.Modify("y9_t.text = '" + ls_aging[j] + "'")
  682. wf_kf_days( ls_aging[j])
  683. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  684. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  685. FOR i = 1 To dw_1.RowCount()
  686. dw_1.Object.y9[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  687. dw_1.AcceptText()
  688. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  689. dw_1.Object.y10[i] = dw_1.Object.y9[i] / dw_1.Object.jine[i] * 100
  690. END IF
  691. NEXT
  692. dw_1.Modify('y10.width = 500')
  693. dw_1.Modify("y10_t.text = '" + "所占比例%"+ "'")
  694. END IF
  695. IF j = 6 THEN
  696. dw_1.Modify('y11.width = 500')
  697. dw_1.Modify("y11_t.text = '" + ls_aging[j] + "'")
  698. wf_kf_days( ls_aging[j])
  699. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  700. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  701. FOR i = 1 To dw_1.RowCount()
  702. dw_1.Object.y11[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  703. dw_1.AcceptText()
  704. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  705. dw_1.Object.y12[i] = dw_1.Object.y11[i] / dw_1.Object.jine[i] * 100
  706. END IF
  707. NEXT
  708. dw_1.Modify('y12.width = 500')
  709. dw_1.Modify("y12_t.text = '" + "所占比例%"+ "'")
  710. END IF
  711. IF j = 7 THEN
  712. dw_1.Modify('y13.width = 500')
  713. dw_1.Modify("y13_t.text = '" + ls_aging[j] + "'")
  714. wf_kf_days( ls_aging[j])
  715. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  716. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  717. FOR i = 1 To dw_1.RowCount()
  718. dw_1.Object.y13[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  719. dw_1.AcceptText()
  720. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  721. dw_1.Object.y14[i] = dw_1.Object.y13[i] / dw_1.Object.jine[i] * 100
  722. END IF
  723. NEXT
  724. dw_1.Modify('y14.width = 500')
  725. dw_1.Modify("y14_t.text = '" + "所占比例%"+ "'")
  726. END IF
  727. IF j = 8 THEN
  728. dw_1.Modify('y15.width = 500')
  729. dw_1.Modify("y15_t.text = '" + ls_aging[j] + "'")
  730. wf_kf_days( ls_aging[j])
  731. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  732. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  733. FOR i = 1 To dw_1.RowCount()
  734. dw_1.Object.y15[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  735. dw_1.AcceptText()
  736. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  737. dw_1.Object.y16[i] = dw_1.Object.y15[i] / dw_1.Object.jine[i] * 100
  738. END IF
  739. NEXT
  740. dw_1.Modify('y16.width = 500')
  741. dw_1.Modify("y16_t.text = '" + "所占比例%"+ "'")
  742. END IF
  743. IF j = 9 THEN
  744. dw_1.Modify('y17.width = 500')
  745. dw_1.Modify("y17_t.text = '" + ls_aging[j] + "'")
  746. wf_kf_days( ls_aging[j])
  747. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  748. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  749. FOR i = 1 To dw_1.RowCount()
  750. dw_1.Object.y17[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  751. dw_1.AcceptText()
  752. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  753. dw_1.Object.y18[i] = dw_1.Object.y17[i] / dw_1.Object.jine[i] * 100
  754. END IF
  755. NEXT
  756. dw_1.Modify('y18.width = 500')
  757. dw_1.Modify("y18_t.text = '" + "所占比例%"+ "'")
  758. END IF
  759. IF j = 10 THEN
  760. dw_1.Modify('y19.width = 500')
  761. dw_1.Modify("y19_t.text = '" + ls_aging[j] + "'")
  762. wf_kf_days( ls_aging[j])
  763. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  764. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  765. FOR i = 1 To dw_1.RowCount()
  766. dw_1.Object.y19[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  767. dw_1.AcceptText()
  768. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  769. dw_1.Object.y20[i] = dw_1.Object.y19[i] / dw_1.Object.jine[i] * 100
  770. END IF
  771. NEXT
  772. dw_1.Modify('y20.width = 500')
  773. dw_1.Modify("y20_t.text = '" + "所占比例%"+ "'")
  774. END IF
  775. IF j = 11 THEN
  776. dw_1.Modify('y21.width = 500')
  777. dw_1.Modify("y21_t.text = '" + ls_aging[j] + "'")
  778. wf_kf_days( ls_aging[j])
  779. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  780. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  781. FOR i = 1 To dw_1.RowCount()
  782. dw_1.Object.y21[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  783. dw_1.AcceptText()
  784. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  785. dw_1.Object.y22[i] = dw_1.Object.y21[i] / dw_1.Object.jine[i] * 100
  786. END IF
  787. NEXT
  788. dw_1.Modify('y22.width = 500')
  789. dw_1.Modify("y22_t.text = '" + "所占比例%"+ "'")
  790. END IF
  791. IF j = 12 THEN
  792. dw_1.Modify('y23.width = 500')
  793. dw_1.Modify("y23_t.text = '" + ls_aging[j] + "'")
  794. wf_kf_days( ls_aging[j])
  795. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  796. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  797. FOR i = 1 To dw_1.RowCount()
  798. dw_1.Object.y23[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
  799. dw_1.AcceptText()
  800. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  801. dw_1.Object.y24[i] = dw_1.Object.y23[i] / dw_1.Object.jine[i] * 100
  802. END IF
  803. NEXT
  804. dw_1.Modify('y24.width = 500')
  805. dw_1.Modify("y24_t.text = '" + "所占比例%"+ "'")
  806. END IF
  807. NEXT
  808. END IF
  809. IF rb_2.Checked = True THEN //应付表
  810. FOR i = 1 To dw_1.RowCount() //期初
  811. dw_1.Object.jine[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,dd_enddate)
  812. NEXT
  813. FOR j = 1 To 24
  814. ls_s = "y" + String(j)
  815. dw_1.Modify(ls_s + '.Visible = 1')
  816. NEXT
  817. FOR j = UpperBound(ls_aging) * 2 - 1 To 24
  818. ls_s = "y" + String(j)
  819. dw_1.Modify(ls_s + '.Visible = 0')
  820. NEXT
  821. FOR j = 1 To UpperBound(ls_aging) - 1
  822. IF j = 1 THEN
  823. dw_1.Modify('y1.width = 500')
  824. dw_1.Modify("y1_t.text = '" + ls_aging[j] + "'")
  825. wf_kf_days( ls_aging[j])
  826. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  827. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  828. FOR i = 1 To dw_1.RowCount()
  829. dw_1.Object.y1[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  830. dw_1.AcceptText()
  831. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  832. dw_1.Object.y2[i] = dw_1.Object.y1[i] / dw_1.Object.jine[i] * 100
  833. END IF
  834. NEXT
  835. dw_1.Modify('y2.width = 500')
  836. dw_1.Modify("y2_t.text = '" + "所占比例%"+ "'")
  837. END IF
  838. IF j = 2 THEN
  839. dw_1.Modify('y3.width = 500')
  840. dw_1.Modify("y3_t.text = '" + ls_aging[j] + "'")
  841. wf_kf_days( ls_aging[j])
  842. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  843. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  844. FOR i = 1 To dw_1.RowCount()
  845. dw_1.Object.y3[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  846. dw_1.AcceptText()
  847. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  848. dw_1.Object.y4[i] = dw_1.Object.y3[i] / dw_1.Object.jine[i] * 100
  849. END IF
  850. NEXT
  851. dw_1.Modify('y4.width = 500')
  852. dw_1.Modify("y4_t.text = '" + "所占比例%"+ "'")
  853. END IF
  854. IF j = 3 THEN
  855. dw_1.Modify('y5.width = 500')
  856. dw_1.Modify("y5_t.text = '" + ls_aging[j] + "'")
  857. wf_kf_days( ls_aging[j])
  858. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  859. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  860. FOR i = 1 To dw_1.RowCount()
  861. dw_1.Object.y5[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  862. dw_1.AcceptText()
  863. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  864. dw_1.Object.y6[i] = dw_1.Object.y5[i] / dw_1.Object.jine[i] * 100
  865. END IF
  866. NEXT
  867. dw_1.Modify('y6.width = 500')
  868. dw_1.Modify("y6_t.text = '" + "所占比例%"+ "'")
  869. END IF
  870. IF j = 4 THEN
  871. dw_1.Modify('y7.width = 500')
  872. dw_1.Modify("y7_t.text = '" + ls_aging[j] + "'")
  873. wf_kf_days( ls_aging[j])
  874. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  875. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  876. FOR i = 1 To dw_1.RowCount()
  877. dw_1.Object.y7[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  878. dw_1.AcceptText()
  879. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  880. dw_1.Object.y8[i] = dw_1.Object.y7[i] / dw_1.Object.jine[i] * 100
  881. END IF
  882. NEXT
  883. dw_1.Modify('y8.width = 500')
  884. dw_1.Modify("y8_t.text = '" + "所占比例%"+ "'")
  885. END IF
  886. IF j = 5 THEN
  887. dw_1.Modify('y9.width = 500')
  888. dw_1.Modify("y9_t.text = '" + ls_aging[j] + "'")
  889. wf_kf_days( ls_aging[j])
  890. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  891. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  892. FOR i = 1 To dw_1.RowCount()
  893. dw_1.Object.y9[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  894. dw_1.AcceptText()
  895. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  896. dw_1.Object.y10[i] = dw_1.Object.y9[i] / dw_1.Object.jine[i] * 100
  897. END IF
  898. NEXT
  899. dw_1.Modify('y10.width = 500')
  900. dw_1.Modify("y10_t.text = '" + "所占比例%"+ "'")
  901. END IF
  902. IF j = 6 THEN
  903. dw_1.Modify('y11.width = 500')
  904. dw_1.Modify("y11_t.text = '" + ls_aging[j] + "'")
  905. wf_kf_days( ls_aging[j])
  906. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  907. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  908. FOR i = 1 To dw_1.RowCount()
  909. dw_1.Object.y11[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  910. dw_1.AcceptText()
  911. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  912. dw_1.Object.y12[i] = dw_1.Object.y11[i] / dw_1.Object.jine[i] * 100
  913. END IF
  914. NEXT
  915. dw_1.Modify('y12.width = 500')
  916. dw_1.Modify("y12_t.text = '" + "所占比例%"+ "'")
  917. END IF
  918. IF j = 7 THEN
  919. dw_1.Modify('y13.width = 500')
  920. dw_1.Modify("y13_t.text = '" + ls_aging[j] + "'")
  921. wf_kf_days( ls_aging[j])
  922. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  923. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  924. FOR i = 1 To dw_1.RowCount()
  925. dw_1.Object.y13[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  926. dw_1.AcceptText()
  927. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  928. dw_1.Object.y14[i] = dw_1.Object.y13[i] / dw_1.Object.jine[i] * 100
  929. END IF
  930. NEXT
  931. dw_1.Modify('y14.width = 500')
  932. dw_1.Modify("y14_t.text = '" + "所占比例%"+ "'")
  933. END IF
  934. IF j = 8 THEN
  935. dw_1.Modify('y15.width = 500')
  936. dw_1.Modify("y15_t.text = '" + ls_aging[j] + "'")
  937. wf_kf_days( ls_aging[j])
  938. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  939. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  940. FOR i = 1 To dw_1.RowCount()
  941. dw_1.Object.y15[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  942. dw_1.AcceptText()
  943. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  944. dw_1.Object.y16[i] = dw_1.Object.y15[i] / dw_1.Object.jine[i] * 100
  945. END IF
  946. NEXT
  947. dw_1.Modify('y16.width = 500')
  948. dw_1.Modify("y16_t.text = '" + "所占比例%"+ "'")
  949. END IF
  950. IF j = 9 THEN
  951. dw_1.Modify('y17.width = 500')
  952. dw_1.Modify("y17_t.text = '" + ls_aging[j] + "'")
  953. wf_kf_days( ls_aging[j])
  954. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  955. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  956. FOR i = 1 To dw_1.RowCount()
  957. dw_1.Object.y17[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  958. dw_1.AcceptText()
  959. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  960. dw_1.Object.y18[i] = dw_1.Object.y17[i] / dw_1.Object.jine[i] * 100
  961. END IF
  962. NEXT
  963. dw_1.Modify('y18.width = 500')
  964. dw_1.Modify("y18_t.text = '" + "所占比例%"+ "'")
  965. END IF
  966. IF j = 10 THEN
  967. dw_1.Modify('y19.width = 500')
  968. dw_1.Modify("y19_t.text = '" + ls_aging[j] + "'")
  969. wf_kf_days( ls_aging[j])
  970. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  971. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  972. FOR i = 1 To dw_1.RowCount()
  973. dw_1.Object.y19[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  974. dw_1.AcceptText()
  975. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  976. dw_1.Object.y20[i] = dw_1.Object.y19[i] / dw_1.Object.jine[i] * 100
  977. END IF
  978. NEXT
  979. dw_1.Modify('y20.width = 500')
  980. dw_1.Modify("y20_t.text = '" + "所占比例%"+ "'")
  981. END IF
  982. IF j = 11 THEN
  983. dw_1.Modify('y21.width = 500')
  984. dw_1.Modify("y21_t.text = '" + ls_aging[j] + "'")
  985. wf_kf_days( ls_aging[j])
  986. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  987. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  988. FOR i = 1 To dw_1.RowCount()
  989. dw_1.Object.y21[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  990. dw_1.AcceptText()
  991. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  992. dw_1.Object.y22[i] = dw_1.Object.y21[i] / dw_1.Object.jine[i] * 100
  993. END IF
  994. NEXT
  995. dw_1.Modify('y22.width = 500')
  996. dw_1.Modify("y22_t.text = '" + "所占比例%"+ "'")
  997. END IF
  998. IF j = 12 THEN
  999. dw_1.Modify('y23.width = 500')
  1000. dw_1.Modify("y23_t.text = '" + ls_aging[j] + "'")
  1001. wf_kf_days( ls_aging[j])
  1002. firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
  1003. enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
  1004. FOR i = 1 To dw_1.RowCount()
  1005. dw_1.Object.y23[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
  1006. dw_1.AcceptText()
  1007. IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
  1008. dw_1.Object.y24[i] = dw_1.Object.y23[i] / dw_1.Object.jine[i] * 100
  1009. END IF
  1010. NEXT
  1011. dw_1.Modify('y24.width = 500')
  1012. dw_1.Modify("y24_t.text = '" + "所占比例%"+ "'")
  1013. END IF
  1014. NEXT
  1015. END IF
  1016. next1:
  1017. IF cbx_1.Checked = False THEN //显示0金额
  1018. FOR i = 1 To dw_1.RowCount()
  1019. IF dw_1.Object.jine[i] = 0 THEN
  1020. dw_1.DeleteRow(i)
  1021. GOTO next1
  1022. END IF
  1023. NEXT
  1024. END IF
  1025. end event
  1026. type st_3 from w_publ_easyq`st_3 within w_rp_aging
  1027. boolean visible = false
  1028. integer x = 2162
  1029. integer y = 292
  1030. boolean enabled = true
  1031. end type
  1032. type st_4 from w_publ_easyq`st_4 within w_rp_aging
  1033. boolean visible = false
  1034. integer x = 2889
  1035. integer y = 292
  1036. boolean enabled = true
  1037. end type
  1038. type em_1 from w_publ_easyq`em_1 within w_rp_aging
  1039. boolean visible = false
  1040. integer x = 2363
  1041. integer y = 276
  1042. end type
  1043. type em_2 from w_publ_easyq`em_2 within w_rp_aging
  1044. integer x = 338
  1045. integer y = 308
  1046. integer width = 462
  1047. end type
  1048. event em_2::losefocus;call super::losefocus;cb_1.TriggerEvent(Clicked!)
  1049. end event
  1050. type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_aging
  1051. integer x = 1541
  1052. end type
  1053. type cbx_yl from w_publ_easyq`cbx_yl within w_rp_aging
  1054. end type
  1055. type dw_1 from w_publ_easyq`dw_1 within w_rp_aging
  1056. integer x = 850
  1057. integer width = 2706
  1058. integer height = 1680
  1059. string dataobject = "dw_rp_musttake_balc_scid_fenyue"
  1060. end type
  1061. type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_aging
  1062. integer y = 464
  1063. end type
  1064. type sle_cust from w_publ_easyq`sle_cust within w_rp_aging
  1065. integer y = 464
  1066. end type
  1067. type st_mtrl from w_publ_easyq`st_mtrl within w_rp_aging
  1068. integer y = 480
  1069. end type
  1070. type st_cust from w_publ_easyq`st_cust within w_rp_aging
  1071. integer y = 480
  1072. end type
  1073. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_aging
  1074. boolean visible = true
  1075. end type
  1076. type pb_em1 from w_publ_easyq`pb_em1 within w_rp_aging
  1077. boolean visible = false
  1078. integer x = 3040
  1079. integer y = 256
  1080. end type
  1081. type pb_em2 from w_publ_easyq`pb_em2 within w_rp_aging
  1082. integer x = 814
  1083. integer y = 304
  1084. end type
  1085. type pb_2 from w_publ_easyq`pb_2 within w_rp_aging
  1086. boolean visible = false
  1087. integer x = 3154
  1088. integer y = 268
  1089. end type
  1090. type cb_help from w_publ_easyq`cb_help within w_rp_aging
  1091. integer x = 768
  1092. end type
  1093. type cb_copyself from w_publ_easyq`cb_copyself within w_rp_aging
  1094. boolean visible = false
  1095. end type
  1096. type gb_1 from w_publ_easyq`gb_1 within w_rp_aging
  1097. integer x = 1019
  1098. integer y = 416
  1099. integer width = 1659
  1100. end type
  1101. type ln_bar from w_publ_easyq`ln_bar within w_rp_aging
  1102. end type
  1103. type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_aging
  1104. end type
  1105. type r_bar from w_publ_easyq`r_bar within w_rp_aging
  1106. end type
  1107. type ln_1 from w_publ_easyq`ln_1 within w_rp_aging
  1108. end type
  1109. type ln_2 from w_publ_easyq`ln_2 within w_rp_aging
  1110. end type
  1111. type ln_3 from w_publ_easyq`ln_3 within w_rp_aging
  1112. end type
  1113. type ln_4 from w_publ_easyq`ln_4 within w_rp_aging
  1114. end type
  1115. type tv_1 from uo_tv_cusarea within w_rp_aging
  1116. integer y = 416
  1117. integer width = 850
  1118. integer height = 1680
  1119. integer taborder = 70
  1120. boolean bringtotop = true
  1121. integer textsize = -9
  1122. fontcharset fontcharset = gb2312charset!
  1123. fontfamily fontfamily = anyfont!
  1124. string facename = "宋体"
  1125. end type
  1126. event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
  1127. ls_areaname = ls_areaname + '%'
  1128. cb_1.TriggerEvent(Clicked!)
  1129. end event
  1130. type ddlb_1 from uo_ddlb_moneyid within w_rp_aging
  1131. integer x = 343
  1132. integer y = 192
  1133. integer width = 466
  1134. integer height = 772
  1135. integer taborder = 30
  1136. boolean bringtotop = true
  1137. end type
  1138. event constructor;call super::constructor;cur_moneyid = THIS.uo_moneyid
  1139. end event
  1140. event selectionchanged;call super::selectionchanged;cur_moneyid = THIS.uo_moneyid
  1141. cb_1.TriggerEvent(Clicked!)
  1142. end event
  1143. type st_1 from statictext within w_rp_aging
  1144. integer x = 9
  1145. integer y = 208
  1146. integer width = 302
  1147. integer height = 60
  1148. boolean bringtotop = true
  1149. integer textsize = -9
  1150. integer weight = 400
  1151. fontcharset fontcharset = gb2312charset!
  1152. fontpitch fontpitch = variable!
  1153. string facename = "宋体"
  1154. long textcolor = 33554432
  1155. long backcolor = 134217739
  1156. string text = "币种:"
  1157. boolean focusrectangle = false
  1158. end type
  1159. type cbx_ifmsttake from checkbox within w_rp_aging
  1160. boolean visible = false
  1161. integer x = 777
  1162. integer y = 200
  1163. integer width = 521
  1164. integer height = 60
  1165. boolean bringtotop = true
  1166. integer textsize = -9
  1167. integer weight = 400
  1168. fontcharset fontcharset = gb2312charset!
  1169. fontpitch fontpitch = variable!
  1170. string facename = "宋体"
  1171. long textcolor = 33554432
  1172. long backcolor = 134217739
  1173. string text = "只显示应收未对单"
  1174. boolean checked = true
  1175. end type
  1176. event clicked;Int ifmsttake
  1177. IF THIS.Checked THEN
  1178. ifmsttake = 1
  1179. ELSE
  1180. ifmsttake = 0
  1181. END IF
  1182. f_SetProfileString (sys_empid,dw_1.DataObject, "ifmsttake", String(ifmsttake))
  1183. cb_1.triggerevent(clicked!)
  1184. end event
  1185. event constructor;Int ifmsttake
  1186. ifmsttake = Integer(f_ProfileString (sys_empid,dw_1.DataObject, "ifmsttake", '0'))
  1187. IF ifmsttake = 0 THEN
  1188. THIS.Checked = FALSE
  1189. ELSE
  1190. THIS.Checked = TRUE
  1191. END IF
  1192. end event
  1193. type cbx_type from checkbox within w_rp_aging
  1194. boolean visible = false
  1195. integer x = 1440
  1196. integer y = 200
  1197. integer width = 466
  1198. integer height = 60
  1199. boolean bringtotop = true
  1200. integer textsize = -9
  1201. integer weight = 400
  1202. fontcharset fontcharset = gb2312charset!
  1203. fontpitch fontpitch = variable!
  1204. string facename = "宋体"
  1205. long textcolor = 33554432
  1206. long backcolor = 134217739
  1207. string text = "按客户分组小计"
  1208. end type
  1209. event clicked;int ifcusgroup
  1210. dw_1.uf_save_profile_layout()
  1211. IF THIS.Checked THEN
  1212. dw_1.DataObject = 'dw_rp_cusbalc_bill_cus'
  1213. ifcusgroup = 1
  1214. ELSE
  1215. dw_1.DataObject = 'dw_rp_cusbalc_bill'
  1216. ifcusgroup = 0
  1217. END IF
  1218. dw_1.SetTransObject(sqlca)
  1219. dw_1.ins_INIfile_name = sys_inifilename
  1220. dw_1.ins_opemp = publ_operator
  1221. dw_1.cardw_empid = sys_empid
  1222. dw_1.cur_DataObject = dw_1.DataObject
  1223. dw_1.uf_read_profile_layout()
  1224. f_title_change(dw_1)
  1225. f_SetProfileString (sys_empid,'w_rp_cusbalc_bill', "ifcusgroup", String(ifcusgroup))
  1226. cb_1.TriggerEvent(Clicked!)
  1227. end event
  1228. event constructor;Int ifcusgroup
  1229. ifcusgroup = Integer(f_ProfileString (sys_empid,'w_rp_cusbalc_bill', "ifcusgroup", '0'))
  1230. IF ifcusgroup = 0 THEN
  1231. THIS.Checked = FALSE
  1232. ELSE
  1233. THIS.Checked = TRUE
  1234. END IF
  1235. end event
  1236. type st_2 from statictext within w_rp_aging
  1237. integer x = 9
  1238. integer y = 328
  1239. integer width = 302
  1240. integer height = 60
  1241. boolean bringtotop = true
  1242. integer textsize = -9
  1243. integer weight = 400
  1244. fontcharset fontcharset = gb2312charset!
  1245. fontpitch fontpitch = variable!
  1246. string facename = "宋体"
  1247. long textcolor = 33554432
  1248. long backcolor = 134217739
  1249. string text = "截止日期:"
  1250. boolean focusrectangle = false
  1251. end type
  1252. type ddlb_scid from uo_ddlb_scid within w_rp_aging
  1253. integer x = 1120
  1254. integer y = 192
  1255. integer width = 562
  1256. integer height = 424
  1257. integer taborder = 30
  1258. boolean bringtotop = true
  1259. end type
  1260. event constructor;call super::constructor;cur_scid_arr1 = THIS.uo_scid_arr
  1261. cur_scid=this.uo_scid
  1262. end event
  1263. event selectionchanged;call super::selectionchanged;cur_scid_arr1[] = THIS.uo_scid_arr
  1264. cur_scid=this.uo_scid
  1265. //cb_1.triggerevent(clicked!)
  1266. end event
  1267. type st_5 from statictext within w_rp_aging
  1268. integer x = 887
  1269. integer y = 204
  1270. integer width = 224
  1271. integer height = 60
  1272. boolean bringtotop = true
  1273. integer textsize = -9
  1274. integer weight = 400
  1275. fontcharset fontcharset = gb2312charset!
  1276. fontpitch fontpitch = variable!
  1277. string facename = "宋体"
  1278. long textcolor = 33554432
  1279. long backcolor = 134217739
  1280. string text = "分部:"
  1281. boolean focusrectangle = false
  1282. end type
  1283. type cb_edit from uo_imflatbutton within w_rp_aging
  1284. integer x = 306
  1285. integer width = 274
  1286. integer height = 164
  1287. integer taborder = 20
  1288. boolean bringtotop = true
  1289. string text = "设置分组"
  1290. string normalpicname = "PRINTFLD.BMP"
  1291. integer picsize = 16
  1292. toolbaralignment pic_align = alignattop!
  1293. boolean border = false
  1294. end type
  1295. event clicked;call super::clicked;open(w_money_aging)
  1296. end event
  1297. type cb_3 from uo_imflatbutton within w_rp_aging
  1298. integer x = 585
  1299. integer width = 183
  1300. integer height = 164
  1301. integer taborder = 30
  1302. boolean bringtotop = true
  1303. string text = "导出"
  1304. string normalpicname = "excel.bmp"
  1305. integer picsize = 16
  1306. toolbaralignment pic_align = alignattop!
  1307. boolean border = false
  1308. end type
  1309. event clicked;call super::clicked;OPENWITHPARM(w_sentdataout,dw_1)
  1310. end event
  1311. type rb_1 from radiobutton within w_rp_aging
  1312. integer x = 1102
  1313. integer y = 320
  1314. integer width = 425
  1315. integer height = 60
  1316. boolean bringtotop = true
  1317. integer textsize = -9
  1318. integer weight = 400
  1319. fontcharset fontcharset = gb2312charset!
  1320. fontpitch fontpitch = variable!
  1321. string facename = "宋体"
  1322. long textcolor = 33554432
  1323. long backcolor = 67108864
  1324. string text = "应收"
  1325. boolean checked = true
  1326. end type
  1327. event clicked;cb_1.TriggerEvent(Clicked!)
  1328. end event
  1329. type rb_2 from radiobutton within w_rp_aging
  1330. integer x = 1582
  1331. integer y = 320
  1332. integer width = 425
  1333. integer height = 60
  1334. boolean bringtotop = true
  1335. integer textsize = -9
  1336. integer weight = 400
  1337. fontcharset fontcharset = gb2312charset!
  1338. fontpitch fontpitch = variable!
  1339. string facename = "宋体"
  1340. long textcolor = 33554432
  1341. long backcolor = 67108864
  1342. string text = "应付"
  1343. end type
  1344. event clicked;dw_spttype.retrieve()
  1345. cb_1.TriggerEvent(Clicked!)
  1346. end event
  1347. type dw_spttype from u_dw_rbtnfilter within w_rp_aging
  1348. integer y = 1212
  1349. integer width = 841
  1350. integer height = 1656
  1351. integer taborder = 100
  1352. boolean bringtotop = true
  1353. string dataobject = "dw_spttype_index"
  1354. end type
  1355. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  1356. this.selectrow(0,false)
  1357. this.selectrow(currentrow,true)
  1358. IF dw_spttype.GetRow() <= 0 THEN
  1359. ins_spttypeid = 0
  1360. ELSE
  1361. ins_spttypeid = dw_spttype.Object.spttypeid[dw_spttype.GetRow()]
  1362. END IF
  1363. cb_1.triggerevent(clicked!)
  1364. end event
  1365. type cbx_1 from checkbox within w_rp_aging
  1366. integer x = 2139
  1367. integer y = 324
  1368. integer width = 402
  1369. integer height = 60
  1370. boolean bringtotop = true
  1371. integer textsize = -9
  1372. integer weight = 400
  1373. fontcharset fontcharset = gb2312charset!
  1374. fontpitch fontpitch = variable!
  1375. string facename = "宋体"
  1376. long textcolor = 33554432
  1377. long backcolor = 134217739
  1378. string text = "显示0金额"
  1379. end type
  1380. event clicked;cb_1.TriggerEvent(Clicked!)
  1381. end event