1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774 |
- $PBExportHeader$w_rp_aging.srw
- forward
- global type w_rp_aging from w_publ_easyq
- end type
- type tv_1 from uo_tv_cusarea within w_rp_aging
- end type
- type ddlb_1 from uo_ddlb_moneyid within w_rp_aging
- end type
- type st_1 from statictext within w_rp_aging
- end type
- type cbx_ifmsttake from checkbox within w_rp_aging
- end type
- type cbx_type from checkbox within w_rp_aging
- end type
- type st_2 from statictext within w_rp_aging
- end type
- type ddlb_scid from uo_ddlb_scid within w_rp_aging
- end type
- type st_5 from statictext within w_rp_aging
- end type
- type cb_edit from uo_imflatbutton within w_rp_aging
- end type
- type cb_3 from uo_imflatbutton within w_rp_aging
- end type
- type rb_1 from radiobutton within w_rp_aging
- end type
- type rb_2 from radiobutton within w_rp_aging
- end type
- type dw_spttype from u_dw_rbtnfilter within w_rp_aging
- end type
- type cbx_1 from checkbox within w_rp_aging
- end type
- type s_bmstpay_wf from structure within w_rp_aging
- end type
- type s_bmsttake_ws from structure within w_rp_aging
- end type
- type s_bmsttake_ws_all from structure within w_rp_aging
- end type
- end forward
- type s_Bmstpay_wf from structure
- long payid
- decimal oriamt
- decimal payamt
- decimal wfamt
- end type
- type s_bmsttake_ws from structure
- long takeid
- decimal oriamt
- decimal takeamt
- decimal wsamt
- end type
- type s_bmsttake_ws_all from structure
- long cusid
- long scid
- long moneyid
- datetime takedate
- long takeid
- decimal oriamt
- decimal takeamt
- decimal wsamt
- end type
- global type w_rp_aging from w_publ_easyq
- integer x = 9
- integer y = 12
- string title = "账龄分析表"
- tv_1 tv_1
- ddlb_1 ddlb_1
- st_1 st_1
- cbx_ifmsttake cbx_ifmsttake
- cbx_type cbx_type
- st_2 st_2
- ddlb_scid ddlb_scid
- st_5 st_5
- cb_edit cb_edit
- cb_3 cb_3
- rb_1 rb_1
- rb_2 rb_2
- dw_spttype dw_spttype
- cbx_1 cbx_1
- end type
- global w_rp_aging w_rp_aging
- type variables
- private:
- s_bmsttake_ws ss_bmsttake_ws[]
- s_bmsttake_ws_all ss_bmsttake_ws_all[]
- s_Bmstpay_wf ss_Bmstpay_wf[]
- public:
- String ls_areaname = ''
- Long cur_moneyid = -1
- string ls_aging[]
- long cur_scid_arr1[],cur_scid =100
- long s_days,e_days
- datetime dd_enddate
- long ins_spttypeid
- end variables
- forward prototypes
- public subroutine wf_read_aging ()
- public subroutine wf_kf_days (string arg_str)
- public function decimal f_getys1 (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
- public function decimal f_getys (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
- public function decimal f_getys3 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
- public function decimal f_getys4 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end)
- public subroutine wf_init ()
- end prototypes
- public subroutine wf_read_aging ();//游标读收费项目
- integer i
- DECLARE read_aging CURSOR FOR
- SELECT u_money_aging.name
- FROM u_money_aging ;
-
- OPEN read_aging;
- i++
- FETCH read_aging INTO :ls_aging[i];
- DO WHILE sqlca.SQLCode = 0
- i++
- FETCH read_aging INTO :ls_aging[i];
- LOOP
- CLOSE read_aging;
- end subroutine
- public subroutine wf_kf_days (string arg_str);arg_str = Trim(arg_str)
- Integer ll_s,ll_e
- s_days = 0
- e_days = 0
- ll_s = Pos(arg_str,"至")
- s_days = Long(Left(arg_str,ll_s - 1))
- e_days = Long(Mid(arg_str,ll_s + 1,Len(arg_str) - ll_s -1))
- IF s_days = 0 or e_days= 0 THEN
- MessageBox("错误","分拆日期出错")
- END IF
- end subroutine
- public function decimal f_getys1 (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1,temamt
- //游标读收费项目
- Long i,j,k
- //FOR j = 1 To UpperBound(ss_bmsttake_ws)
- // ss_bmsttake_ws[j].takeid = 0
- // ss_bmsttake_ws[j].oriamt = 0
- // ss_bmsttake_ws[j].takeamt = 0
- // ss_bmsttake_ws[j].wsamt = 0
- //NEXT
- //DECLARE read_u_Bmsttake CURSOR FOR
- // SELECT u_Bmsttake.takeid,u_Bmsttake.oriamt,u_Bmsttake.takeamt,(msttakeamt - takeamt) as wsamt
- // FROM u_Bmsttake
- // WHERE
- // ( u_Bmsttake.cusid = :arg_custid) AND
- // ( u_Bmsttake.scid = :arg_scid ) AND
- // ( u_Bmsttake.moneyid = :arg_moneyid) AND
- // ( u_Bmsttake.takedate >= :arg_star ) AND
- // ( u_Bmsttake.takedate <= :arg_end) AND
- // (msttakeamt - takeamt<> 0);
- //// ((u_Bmsttake.oriamt = u_Bmsttake.msttakeamt) Or (msttakeamt - takeamt <> 0)) ;
- //// ((u_Bmsttake.oriamt > 0) Or (u_Bmsttake.oriamt < 0 And accountsid = 0));
- //
- //OPEN read_u_Bmsttake;
- //i++
- //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;
- //
- //DO WHILE sqlca.SQLCode = 0
- // i++
- // 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;
- //LOOP
- //CLOSE read_u_Bmsttake;
- //
- //
- //IF arg_custid = 14 THEN
- // Long aaa
- // aaa = 1
- //END IF
- //messagebox("",string(UpperBound(ss_bmsttake_ws)))
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- ss_bmsttake_ws[j].takeid = 0
- ss_bmsttake_ws[j].oriamt = 0
- ss_bmsttake_ws[j].takeamt = 0
- ss_bmsttake_ws[j].wsamt = 0
- NEXT
- k = 0
- FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
- IF ss_bmsttake_ws_all[j].cusid = arg_custid And &
- ss_bmsttake_ws_all[j].scid = arg_scid And &
- ss_bmsttake_ws_all[j].takedate >= arg_star And &
- ss_bmsttake_ws_all[j].takedate <= arg_end THEN
-
- k++
- ss_bmsttake_ws[k].takeid=ss_bmsttake_ws_all[j].takeid
- ss_bmsttake_ws[k].oriamt=ss_bmsttake_ws_all[j].oriamt
- ss_bmsttake_ws[k].takeamt=ss_bmsttake_ws_all[j].takeamt
- ss_bmsttake_ws[k].wsamt=ss_bmsttake_ws_all[j].wsamt
-
-
- END IF
-
- NEXT
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- IF ss_bmsttake_ws[j].takeid > 0 THEN
- // IF ss_bmsttake_ws[j].takeamt <> 0 THEN
- IF ss_bmsttake_ws[j].oriamt > 0 THEN
- SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And takedate > :dd_enddate And listno > 0;
- ELSE
- SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And opdate > :dd_enddate And listno > 0;
- END IF
- IF IsNull(temamt) THEN temamt = 0
-
-
- ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].wsamt + temamt
-
- // ELSE
- // ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].oriamt
- //
- // END IF
- END IF
- NEXT
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- IF ss_bmsttake_ws[j].takeid > 0 THEN
- amt = amt + ss_bmsttake_ws[j].wsamt
- END IF
- NEXT
- RETURN amt
- //
- //SELECT
- // isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收'
- //Into :amt
- //From u_Bmsttake Left Outer join u_accounts On
- //u_Bmsttake.accountsid = u_accounts.accountsid
- //Left Outer join u_itemdef On
- //u_Bmsttake.itemid = u_itemdef.itemid
- //Left Outer join cw_banktype On
- //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
- //u_scdef
- //Where
- //( u_Bmsttake.cusid = :arg_custid) And
- //( u_Bmsttake.scid = :arg_scid ) And
- //( u_Bmsttake.moneyid = :arg_moneyid) And
- //( u_Bmsttake.takedate >= :arg_star ) And
- //( u_Bmsttake.takedate < :arg_end) ;
- //
- ////////////////////////////////////
- //// SELECT
- //// isnull(sum(abs( u_Bmsttake.oriamt)),0)
- //// into :amt1
- //// FROM U_Bmsttake left outer join u_accounts on
- //// U_Bmsttake.accountsid = u_accounts.accountsid
- //// left outer join u_itemdef on
- //// U_Bmsttake.itemid = u_itemdef.itemid
- //// left outer join cw_banktype on
- //// U_Bmsttake.banktypeid = cw_banktype.banktypeid,
- //// u_scdef
- //// Where
- //// ( u_Bmsttake.cusid = :arg_custid) And
- ////( u_Bmsttake.scid = :arg_scid ) And
- ////( u_Bmsttake.moneyid = :arg_moneyid) And
- ////( u_Bmsttake.takedate > :arg_end ) And
- //// (u_Bmsttake.finishflag=1) and
- //// (u_Bmsttake.oriamt <0);
- //amt=amt+ amt1
- end function
- public function decimal f_getys (long arg_custid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);//Decimal amt,amt1
- //
- //SELECT
- //IsNull(sum(u_Bmsttake.oriamt),0)
- //Into :amt
- //From u_Bmsttake Left Outer join u_accounts On
- //u_Bmsttake.accountsid = u_accounts.accountsid
- //Left Outer join u_itemdef On
- //u_Bmsttake.itemid = u_itemdef.itemid
- //Left Outer join cw_banktype On
- //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
- //u_scdef
- //Where
- //( u_Bmsttake.cusid = :arg_custid) And
- //( u_Bmsttake.scid = :arg_scid ) And
- //( u_Bmsttake.moneyid = :arg_moneyid) And
- //( u_Bmsttake.takedate >= :arg_star ) And
- //( u_Bmsttake.takedate < :arg_end) ;
- //
- //RETURN amt
- Decimal amt,amt1,temamt
- //游标读收费项目
- Long i,j,k
- //FOR j = 1 To UpperBound(ss_bmsttake_ws)
- // ss_bmsttake_ws[j].takeid = 0
- // ss_bmsttake_ws[j].oriamt = 0
- // ss_bmsttake_ws[j].takeamt = 0
- // ss_bmsttake_ws[j].wsamt = 0
- //NEXT
- //DECLARE read_u_Bmsttake CURSOR FOR
- // SELECT u_Bmsttake.takeid,u_Bmsttake.oriamt,u_Bmsttake.takeamt,(msttakeamt - takeamt) as wsamt
- // FROM u_Bmsttake
- // WHERE
- // ( u_Bmsttake.cusid = :arg_custid) AND
- // ( u_Bmsttake.scid = :arg_scid ) AND
- // ( u_Bmsttake.moneyid = :arg_moneyid) AND
- // ( u_Bmsttake.takedate >= :arg_star ) AND
- // ( u_Bmsttake.takedate <= :arg_end) AND
- // (msttakeamt - takeamt<> 0);
- //// ((u_Bmsttake.oriamt = u_Bmsttake.msttakeamt) Or (msttakeamt - takeamt <> 0)) ;
- //// ((u_Bmsttake.oriamt > 0) Or (u_Bmsttake.oriamt < 0 And accountsid = 0));
- //
- //OPEN read_u_Bmsttake;
- //i++
- //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;
- //
- //DO WHILE sqlca.SQLCode = 0
- // i++
- // 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;
- //LOOP
- //CLOSE read_u_Bmsttake;
- //
- //
- //IF arg_custid = 14 THEN
- // Long aaa
- // aaa = 1
- //END IF
- //messagebox("",string(UpperBound(ss_bmsttake_ws)))
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- ss_bmsttake_ws[j].takeid = 0
- ss_bmsttake_ws[j].oriamt = 0
- ss_bmsttake_ws[j].takeamt = 0
- ss_bmsttake_ws[j].wsamt = 0
- NEXT
- k = 0
- FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
- IF ss_bmsttake_ws_all[j].cusid = arg_custid And &
- ss_bmsttake_ws_all[j].scid = arg_scid And &
- ss_bmsttake_ws_all[j].takedate >= arg_star And &
- ss_bmsttake_ws_all[j].takedate <= arg_end THEN
-
- k++
- ss_bmsttake_ws[k].takeid=ss_bmsttake_ws_all[j].takeid
- ss_bmsttake_ws[k].oriamt=ss_bmsttake_ws_all[j].oriamt
- ss_bmsttake_ws[k].takeamt=ss_bmsttake_ws_all[j].takeamt
- ss_bmsttake_ws[k].wsamt=ss_bmsttake_ws_all[j].wsamt
-
-
- END IF
-
- NEXT
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- IF ss_bmsttake_ws[j].takeid > 0 THEN
- IF ss_bmsttake_ws[j].takeamt <> 0 THEN
- IF ss_bmsttake_ws[j].oriamt > 0 THEN
- SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And takedate > :dd_enddate And listno > 0;
- ELSE
- SELECT sum(takeamt) Into :temamt From u_Bmsttakemx Where takeid = :ss_bmsttake_ws[j].takeid And opdate > :dd_enddate And listno > 0;
- END IF
- IF IsNull(temamt) THEN temamt = 0
-
-
- ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].wsamt + temamt
-
- ELSE
- ss_bmsttake_ws[j].wsamt = ss_bmsttake_ws[j].oriamt
-
- END IF
- END IF
- NEXT
- FOR j = 1 To UpperBound(ss_bmsttake_ws)
- IF ss_bmsttake_ws[j].takeid > 0 THEN
- amt = amt + ss_bmsttake_ws[j].wsamt
- END IF
- NEXT
- RETURN amt
- //
- //SELECT
- // isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收'
- //Into :amt
- //From u_Bmsttake Left Outer join u_accounts On
- //u_Bmsttake.accountsid = u_accounts.accountsid
- //Left Outer join u_itemdef On
- //u_Bmsttake.itemid = u_itemdef.itemid
- //Left Outer join cw_banktype On
- //u_Bmsttake.banktypeid = cw_banktype.banktypeid,
- //u_scdef
- //Where
- //( u_Bmsttake.cusid = :arg_custid) And
- //( u_Bmsttake.scid = :arg_scid ) And
- //( u_Bmsttake.moneyid = :arg_moneyid) And
- //( u_Bmsttake.takedate >= :arg_star ) And
- //( u_Bmsttake.takedate < :arg_end) ;
- //
- ////////////////////////////////////
- //// SELECT
- //// isnull(sum(abs( u_Bmsttake.oriamt)),0)
- //// into :amt1
- //// FROM U_Bmsttake left outer join u_accounts on
- //// U_Bmsttake.accountsid = u_accounts.accountsid
- //// left outer join u_itemdef on
- //// U_Bmsttake.itemid = u_itemdef.itemid
- //// left outer join cw_banktype on
- //// U_Bmsttake.banktypeid = cw_banktype.banktypeid,
- //// u_scdef
- //// Where
- //// ( u_Bmsttake.cusid = :arg_custid) And
- ////( u_Bmsttake.scid = :arg_scid ) And
- ////( u_Bmsttake.moneyid = :arg_moneyid) And
- ////( u_Bmsttake.takedate > :arg_end ) And
- //// (u_Bmsttake.finishflag=1) and
- //// (u_Bmsttake.oriamt <0);
- //amt=amt+ amt1
- end function
- public function decimal f_getys3 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1
- SELECT
- IsNull(sum(u_Bmstpay.oriamt),0)
- Into :amt
- From u_Bmstpay Left Outer join u_accounts On
- u_Bmstpay.accountsid = u_accounts.accountsid
- Left Outer join u_itemdef On
- u_Bmstpay.itemid = u_itemdef.itemid
- Left Outer join cw_banktype On
- u_Bmstpay.banktypeid = cw_banktype.banktypeid,
- u_scdef
- Where
- ( u_Bmstpay.sptid = :arg_sptid) And
- ( u_Bmstpay.scid = :arg_scid ) And
- ( u_Bmstpay.moneyid = :arg_moneyid) And
- ( u_Bmstpay.paydate >= :arg_star ) And
- ( u_Bmstpay.paydate < :arg_end) ;
- RETURN amt
- end function
- public function decimal f_getys4 (long arg_sptid, integer arg_scid, integer arg_moneyid, datetime arg_star, datetime arg_end);Decimal amt,amt1,temamt
- //游标读收费项目
- Integer i,j
- FOR j = 1 To UpperBound(ss_Bmstpay_wf)
- ss_Bmstpay_wf[j].payid = 0
- ss_Bmstpay_wf[j].oriamt = 0
- ss_Bmstpay_wf[j].payamt = 0
- ss_Bmstpay_wf[j].wfamt = 0
- NEXT
- DECLARE read_u_Bmstpay CURSOR FOR
- SELECT payid,oriamt,payamt
- FROM u_Bmstpay
- WHERE
- ( u_Bmstpay.sptid = :arg_sptid) AND
- ( u_Bmstpay.scid = :arg_scid ) AND
- ( u_Bmstpay.moneyid = :arg_moneyid) AND
- ( u_Bmstpay.paydate >= :arg_star ) AND
- ( u_Bmstpay.paydate <= :arg_end) AND
- ( Mstpayamt - payamt<> 0);
- //(u_Bmstpay.oriamt = u_Bmstpay.Mstpayamt);
-
- OPEN read_u_Bmstpay;
- i++
- FETCH read_u_Bmstpay Into :ss_Bmstpay_wf[i].payid,:ss_Bmstpay_wf[i].oriamt,:ss_Bmstpay_wf[i].payamt;
- DO WHILE sqlca.SQLCode = 0
- i++
- FETCH read_u_Bmstpay Into :ss_Bmstpay_wf[i].payid,:ss_Bmstpay_wf[i].oriamt,:ss_Bmstpay_wf[i].payamt;
- LOOP
- CLOSE read_u_Bmstpay;
- FOR j = 1 To UpperBound(ss_Bmstpay_wf)
- IF ss_Bmstpay_wf[j].payid > 0 THEN
- // IF ss_Bmstpay_wf[j].payamt <> 0 THEN
- IF ss_Bmstpay_wf[j].oriamt > 0 THEN
- SELECT sum(payamt) Into :temamt From u_Bmstpaymx Where payid = :ss_Bmstpay_wf[j].payid And paydate > :dd_enddate And listno > 0;
- ELSE
- SELECT sum(payamt) Into :temamt From u_Bmstpaymx Where payid = :ss_Bmstpay_wf[j].payid And opdate > :dd_enddate And listno > 0;
- END IF
- IF IsNull(temamt) THEN temamt = 0
- ss_Bmstpay_wf[j].wfamt = ss_Bmstpay_wf[j].oriamt - ss_Bmstpay_wf[j].payamt + temamt
- // ELSE
- // ss_Bmstpay_wf[j].wfamt = ss_Bmstpay_wf[j].oriamt
- //
- // END IF
- END IF
- NEXT
- FOR j = 1 To UpperBound(ss_Bmstpay_wf)
- IF ss_Bmstpay_wf[j].payid > 0 THEN
- amt = amt + ss_Bmstpay_wf[j].wfamt
- END IF
- NEXT
- RETURN amt
- end function
- public subroutine wf_init ();open(w_sys_wait)
- Decimal amt,amt1,temamt
- //游标读收费项目
- long i,j
- FOR j = 1 To UpperBound(ss_bmsttake_ws_all)
- ss_bmsttake_ws_all[j].cusid = 0
- ss_bmsttake_ws_all[j].scid = 0
- ss_bmsttake_ws_all[j].moneyid = 0
- ss_bmsttake_ws_all[j].takeid = 0
- ss_bmsttake_ws_all[j].oriamt = 0
- ss_bmsttake_ws_all[j].takeamt = 0
- ss_bmsttake_ws_all[j].wsamt = 0
- NEXT
- DECLARE read_u_Bmsttake_all CURSOR FOR
- 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
- FROM u_Bmsttake where (msttakeamt - takeamt<> 0);
-
- OPEN read_u_Bmsttake_all;
- i++
- 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;
- DO WHILE sqlca.SQLCode = 0
- i++
- 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;
- LOOP
- CLOSE read_u_Bmsttake_all;
- close(w_sys_wait)
- end subroutine
- on w_rp_aging.create
- int iCurrent
- call super::create
- this.tv_1=create tv_1
- this.ddlb_1=create ddlb_1
- this.st_1=create st_1
- this.cbx_ifmsttake=create cbx_ifmsttake
- this.cbx_type=create cbx_type
- this.st_2=create st_2
- this.ddlb_scid=create ddlb_scid
- this.st_5=create st_5
- this.cb_edit=create cb_edit
- this.cb_3=create cb_3
- this.rb_1=create rb_1
- this.rb_2=create rb_2
- this.dw_spttype=create dw_spttype
- this.cbx_1=create cbx_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.tv_1
- this.Control[iCurrent+2]=this.ddlb_1
- this.Control[iCurrent+3]=this.st_1
- this.Control[iCurrent+4]=this.cbx_ifmsttake
- this.Control[iCurrent+5]=this.cbx_type
- this.Control[iCurrent+6]=this.st_2
- this.Control[iCurrent+7]=this.ddlb_scid
- this.Control[iCurrent+8]=this.st_5
- this.Control[iCurrent+9]=this.cb_edit
- this.Control[iCurrent+10]=this.cb_3
- this.Control[iCurrent+11]=this.rb_1
- this.Control[iCurrent+12]=this.rb_2
- this.Control[iCurrent+13]=this.dw_spttype
- this.Control[iCurrent+14]=this.cbx_1
- end on
- on w_rp_aging.destroy
- call super::destroy
- destroy(this.tv_1)
- destroy(this.ddlb_1)
- destroy(this.st_1)
- destroy(this.cbx_ifmsttake)
- destroy(this.cbx_type)
- destroy(this.st_2)
- destroy(this.ddlb_scid)
- destroy(this.st_5)
- destroy(this.cb_edit)
- destroy(this.cb_3)
- destroy(this.rb_1)
- destroy(this.rb_2)
- destroy(this.dw_spttype)
- destroy(this.cbx_1)
- end on
- event open;call super::open;em_1.Text = String(Today(),'yyyy-mm')+'-01'
- wf_init()
- //Int ifcusgroup
- //ifcusgroup = Integer(f_ProfileString (sys_empid,'dw_rp_musttake_balc_scid_fenyue', "ifcusgroup", '0'))
- IF rb_1.Checked = True THEN
- dw_1.DataObject = 'dw_rp_musttake_balc_scid_fenyue'
- tv_1.Visible = True
- dw_spttype.Visible = False
- dw_1.SetTransObject(sqlca)
- ELSE
- dw_1.DataObject = 'dw_rp_u_bmstpay_balc_scid_fenyue'
- dw_spttype.Visible = True
- tv_1.Visible = False
- dw_1.SetTransObject(sqlca)
- END IF
- dw_spttype.SetTransObject(sqlca)
- dw_1.ins_INIfile_name = sys_inifilename
- dw_1.ins_opemp = publ_operator
- dw_1.cardw_empid = sys_empid
- dw_1.cur_DataObject = dw_1.DataObject
- dw_1.uf_read_profile_layout()
- f_title_change(dw_1)
- IF cbx_loginretr.Checked THEN
- cb_1.TriggerEvent(Clicked!)
- END IF
- end event
- event ue_before_open;call super::ue_before_open;if_ue_retr=true
- if_ue_filter=true
- if_ue_sort=true
- if_ue_sentdataout=true
- end event
- event resize;call super::resize;tv_1.Height = dw_1.Height
- dw_spttype.x=tv_1.x
- dw_spttype.y=tv_1.y
- dw_spttype.width=tv_1.width
- dw_spttype.height=tv_1.height
- end event
- type cb_func from w_publ_easyq`cb_func within w_rp_aging
- end type
- type cb_exit from w_publ_easyq`cb_exit within w_rp_aging
- integer x = 919
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_rp_aging
- boolean visible = false
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_rp_aging
- boolean visible = false
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_rp_aging
- boolean bringtotop = true
- end type
- event cb_1::clicked;Long i,j
- String ls_s
- DateTime firstdate,enddate
- firstdate = DateTime(Date("2000-01-01"),Time(0))
- enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
- dd_enddate = DateTime(Date(em_2.Text),Time('23:59:59'))
- IF rb_1.Checked = True THEN
- dw_1.DataObject = 'dw_rp_musttake_balc_scid_fenyue'
- tv_1.Visible = True
- dw_spttype.Visible = False
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(ls_areaname)
- ELSE
- dw_1.DataObject = 'dw_rp_u_bmstpay_balc_scid_fenyue'
- dw_spttype.Visible = True
- tv_1.Visible = False
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(ins_spttypeid)
-
- END IF
- wf_read_aging()
- IF rb_1.Checked = True THEN //应收表
- FOR i = 1 To dw_1.RowCount() //期初
- dw_1.Object.jine[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- NEXT
-
-
-
- FOR j = 1 To 24
- ls_s = "y" + String(j)
- dw_1.Modify(ls_s + '.Visible = 1')
- NEXT
-
- FOR j = UpperBound(ls_aging) * 2 - 1 To 24
- ls_s = "y" + String(j)
- dw_1.Modify(ls_s + '.Visible = 0')
- NEXT
-
- FOR j = 1 To UpperBound(ls_aging) - 1
-
- IF j = 1 THEN
- dw_1.Modify('y1.width = 500')
- dw_1.Modify("y1_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y1[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y2[i] = dw_1.Object.y1[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
- dw_1.Modify('y2.width = 500')
- dw_1.Modify("y2_t.text = '" + "所占比例%"+ "'")
-
-
- END IF
-
-
-
-
- IF j = 2 THEN
- dw_1.Modify('y3.width = 500')
- dw_1.Modify("y3_t.text = '" + ls_aging[j] + "'")
-
-
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y3[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y4[i] = dw_1.Object.y3[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
-
- dw_1.Modify('y4.width = 500')
- dw_1.Modify("y4_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 3 THEN
- dw_1.Modify('y5.width = 500')
- dw_1.Modify("y5_t.text = '" + ls_aging[j] + "'")
-
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y5[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y6[i] = dw_1.Object.y5[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
- dw_1.Modify('y6.width = 500')
- dw_1.Modify("y6_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 4 THEN
- dw_1.Modify('y7.width = 500')
- dw_1.Modify("y7_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y7[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y8[i] = dw_1.Object.y7[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y8.width = 500')
- dw_1.Modify("y8_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 5 THEN
- dw_1.Modify('y9.width = 500')
- dw_1.Modify("y9_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y9[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y10[i] = dw_1.Object.y9[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y10.width = 500')
- dw_1.Modify("y10_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 6 THEN
- dw_1.Modify('y11.width = 500')
- dw_1.Modify("y11_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y11[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y12[i] = dw_1.Object.y11[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y12.width = 500')
- dw_1.Modify("y12_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 7 THEN
- dw_1.Modify('y13.width = 500')
- dw_1.Modify("y13_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y13[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y14[i] = dw_1.Object.y13[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y14.width = 500')
- dw_1.Modify("y14_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 8 THEN
- dw_1.Modify('y15.width = 500')
- dw_1.Modify("y15_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y15[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y16[i] = dw_1.Object.y15[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y16.width = 500')
- dw_1.Modify("y16_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 9 THEN
- dw_1.Modify('y17.width = 500')
- dw_1.Modify("y17_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y17[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y18[i] = dw_1.Object.y17[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y18.width = 500')
- dw_1.Modify("y18_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 10 THEN
- dw_1.Modify('y19.width = 500')
- dw_1.Modify("y19_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y19[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y20[i] = dw_1.Object.y19[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y20.width = 500')
- dw_1.Modify("y20_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 11 THEN
- dw_1.Modify('y21.width = 500')
- dw_1.Modify("y21_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y21[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y22[i] = dw_1.Object.y21[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y22.width = 500')
- dw_1.Modify("y22_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 12 THEN
- dw_1.Modify('y23.width = 500')
- dw_1.Modify("y23_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y23[i] = f_getys1(dw_1.Object.cusid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y24[i] = dw_1.Object.y23[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y24.width = 500')
- dw_1.Modify("y24_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
-
-
-
-
- NEXT
- END IF
- IF rb_2.Checked = True THEN //应付表
- FOR i = 1 To dw_1.RowCount() //期初
- dw_1.Object.jine[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,dd_enddate)
- NEXT
-
-
-
- FOR j = 1 To 24
- ls_s = "y" + String(j)
- dw_1.Modify(ls_s + '.Visible = 1')
- NEXT
-
- FOR j = UpperBound(ls_aging) * 2 - 1 To 24
- ls_s = "y" + String(j)
- dw_1.Modify(ls_s + '.Visible = 0')
- NEXT
-
- FOR j = 1 To UpperBound(ls_aging) - 1
-
- IF j = 1 THEN
- dw_1.Modify('y1.width = 500')
- dw_1.Modify("y1_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y1[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y2[i] = dw_1.Object.y1[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
- dw_1.Modify('y2.width = 500')
- dw_1.Modify("y2_t.text = '" + "所占比例%"+ "'")
-
-
- END IF
-
-
-
-
- IF j = 2 THEN
- dw_1.Modify('y3.width = 500')
- dw_1.Modify("y3_t.text = '" + ls_aging[j] + "'")
-
-
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y3[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y4[i] = dw_1.Object.y3[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
-
- dw_1.Modify('y4.width = 500')
- dw_1.Modify("y4_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 3 THEN
- dw_1.Modify('y5.width = 500')
- dw_1.Modify("y5_t.text = '" + ls_aging[j] + "'")
-
- wf_kf_days( ls_aging[j])
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y5[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y6[i] = dw_1.Object.y5[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
-
- dw_1.Modify('y6.width = 500')
- dw_1.Modify("y6_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 4 THEN
- dw_1.Modify('y7.width = 500')
- dw_1.Modify("y7_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y7[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y8[i] = dw_1.Object.y7[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y8.width = 500')
- dw_1.Modify("y8_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 5 THEN
- dw_1.Modify('y9.width = 500')
- dw_1.Modify("y9_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y9[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y10[i] = dw_1.Object.y9[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y10.width = 500')
- dw_1.Modify("y10_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 6 THEN
- dw_1.Modify('y11.width = 500')
- dw_1.Modify("y11_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y11[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y12[i] = dw_1.Object.y11[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y12.width = 500')
- dw_1.Modify("y12_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 7 THEN
- dw_1.Modify('y13.width = 500')
- dw_1.Modify("y13_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y13[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y14[i] = dw_1.Object.y13[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y14.width = 500')
- dw_1.Modify("y14_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
- IF j = 8 THEN
- dw_1.Modify('y15.width = 500')
- dw_1.Modify("y15_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y15[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y16[i] = dw_1.Object.y15[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y16.width = 500')
- dw_1.Modify("y16_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 9 THEN
- dw_1.Modify('y17.width = 500')
- dw_1.Modify("y17_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y17[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y18[i] = dw_1.Object.y17[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y18.width = 500')
- dw_1.Modify("y18_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 10 THEN
- dw_1.Modify('y19.width = 500')
- dw_1.Modify("y19_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y19[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y20[i] = dw_1.Object.y19[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y20.width = 500')
- dw_1.Modify("y20_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 11 THEN
- dw_1.Modify('y21.width = 500')
- dw_1.Modify("y21_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y21[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y22[i] = dw_1.Object.y21[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y22.width = 500')
- dw_1.Modify("y22_t.text = '" + "所占比例%"+ "'")
- END IF
-
- IF j = 12 THEN
- dw_1.Modify('y23.width = 500')
- dw_1.Modify("y23_t.text = '" + ls_aging[j] + "'")
- wf_kf_days( ls_aging[j])
-
- firstdate = DateTime(RelativeDate(Date(dd_enddate),(e_days * (-1)) + 1),Time(0))
- enddate = DateTime(RelativeDate(Date(dd_enddate),(s_days * (-1)) + 1),Time('23:59:59'))
-
- FOR i = 1 To dw_1.RowCount()
- dw_1.Object.y23[i] = f_getys4(dw_1.Object.sptid[i],cur_scid,cur_moneyid,firstdate,enddate)
- dw_1.AcceptText()
- IF dw_1.Object.jine[i] <> 0 And Not IsNull(dw_1.Object.jine[i]) THEN
- dw_1.Object.y24[i] = dw_1.Object.y23[i] / dw_1.Object.jine[i] * 100
- END IF
- NEXT
-
- dw_1.Modify('y24.width = 500')
- dw_1.Modify("y24_t.text = '" + "所占比例%"+ "'")
- END IF
-
-
-
-
-
-
- NEXT
-
-
- END IF
- next1:
- IF cbx_1.Checked = False THEN //显示0金额
- FOR i = 1 To dw_1.RowCount()
- IF dw_1.Object.jine[i] = 0 THEN
- dw_1.DeleteRow(i)
- GOTO next1
- END IF
- NEXT
- END IF
- end event
- type st_3 from w_publ_easyq`st_3 within w_rp_aging
- boolean visible = false
- integer x = 2162
- integer y = 292
- boolean enabled = true
- end type
- type st_4 from w_publ_easyq`st_4 within w_rp_aging
- boolean visible = false
- integer x = 2889
- integer y = 292
- boolean enabled = true
- end type
- type em_1 from w_publ_easyq`em_1 within w_rp_aging
- boolean visible = false
- integer x = 2363
- integer y = 276
- end type
- type em_2 from w_publ_easyq`em_2 within w_rp_aging
- integer x = 338
- integer y = 308
- integer width = 462
- end type
- event em_2::losefocus;call super::losefocus;cb_1.TriggerEvent(Clicked!)
- end event
- type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_aging
- integer x = 1541
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_rp_aging
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_rp_aging
- integer x = 850
- integer width = 2706
- integer height = 1680
- string dataobject = "dw_rp_musttake_balc_scid_fenyue"
- end type
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_aging
- integer y = 464
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_rp_aging
- integer y = 464
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_rp_aging
- integer y = 480
- end type
- type st_cust from w_publ_easyq`st_cust within w_rp_aging
- integer y = 480
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_aging
- boolean visible = true
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_rp_aging
- boolean visible = false
- integer x = 3040
- integer y = 256
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_rp_aging
- integer x = 814
- integer y = 304
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_rp_aging
- boolean visible = false
- integer x = 3154
- integer y = 268
- end type
- type cb_help from w_publ_easyq`cb_help within w_rp_aging
- integer x = 768
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_rp_aging
- boolean visible = false
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_rp_aging
- integer x = 1019
- integer y = 416
- integer width = 1659
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_rp_aging
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_aging
- end type
- type r_bar from w_publ_easyq`r_bar within w_rp_aging
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_rp_aging
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_rp_aging
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_rp_aging
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_rp_aging
- end type
- type tv_1 from uo_tv_cusarea within w_rp_aging
- integer y = 416
- integer width = 850
- integer height = 1680
- integer taborder = 70
- boolean bringtotop = true
- integer textsize = -9
- fontcharset fontcharset = gb2312charset!
- fontfamily fontfamily = anyfont!
- string facename = "宋体"
- end type
- event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
- ls_areaname = ls_areaname + '%'
- cb_1.TriggerEvent(Clicked!)
- end event
- type ddlb_1 from uo_ddlb_moneyid within w_rp_aging
- integer x = 343
- integer y = 192
- integer width = 466
- integer height = 772
- integer taborder = 30
- boolean bringtotop = true
- end type
- event constructor;call super::constructor;cur_moneyid = THIS.uo_moneyid
- end event
- event selectionchanged;call super::selectionchanged;cur_moneyid = THIS.uo_moneyid
- cb_1.TriggerEvent(Clicked!)
- end event
- type st_1 from statictext within w_rp_aging
- integer x = 9
- integer y = 208
- integer width = 302
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "币种:"
- boolean focusrectangle = false
- end type
- type cbx_ifmsttake from checkbox within w_rp_aging
- boolean visible = false
- integer x = 777
- integer y = 200
- integer width = 521
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "只显示应收未对单"
- boolean checked = true
- end type
- event clicked;Int ifmsttake
- IF THIS.Checked THEN
- ifmsttake = 1
- ELSE
- ifmsttake = 0
- END IF
- f_SetProfileString (sys_empid,dw_1.DataObject, "ifmsttake", String(ifmsttake))
- cb_1.triggerevent(clicked!)
- end event
- event constructor;Int ifmsttake
- ifmsttake = Integer(f_ProfileString (sys_empid,dw_1.DataObject, "ifmsttake", '0'))
- IF ifmsttake = 0 THEN
- THIS.Checked = FALSE
- ELSE
- THIS.Checked = TRUE
- END IF
- end event
- type cbx_type from checkbox within w_rp_aging
- boolean visible = false
- integer x = 1440
- integer y = 200
- integer width = 466
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "按客户分组小计"
- end type
- event clicked;int ifcusgroup
- dw_1.uf_save_profile_layout()
- IF THIS.Checked THEN
- dw_1.DataObject = 'dw_rp_cusbalc_bill_cus'
- ifcusgroup = 1
- ELSE
- dw_1.DataObject = 'dw_rp_cusbalc_bill'
- ifcusgroup = 0
- END IF
- dw_1.SetTransObject(sqlca)
- dw_1.ins_INIfile_name = sys_inifilename
- dw_1.ins_opemp = publ_operator
- dw_1.cardw_empid = sys_empid
- dw_1.cur_DataObject = dw_1.DataObject
- dw_1.uf_read_profile_layout()
- f_title_change(dw_1)
- f_SetProfileString (sys_empid,'w_rp_cusbalc_bill', "ifcusgroup", String(ifcusgroup))
- cb_1.TriggerEvent(Clicked!)
- end event
- event constructor;Int ifcusgroup
- ifcusgroup = Integer(f_ProfileString (sys_empid,'w_rp_cusbalc_bill', "ifcusgroup", '0'))
- IF ifcusgroup = 0 THEN
- THIS.Checked = FALSE
- ELSE
- THIS.Checked = TRUE
- END IF
- end event
- type st_2 from statictext within w_rp_aging
- integer x = 9
- integer y = 328
- integer width = 302
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "截止日期:"
- boolean focusrectangle = false
- end type
- type ddlb_scid from uo_ddlb_scid within w_rp_aging
- integer x = 1120
- integer y = 192
- integer width = 562
- integer height = 424
- integer taborder = 30
- boolean bringtotop = true
- end type
- event constructor;call super::constructor;cur_scid_arr1 = THIS.uo_scid_arr
- cur_scid=this.uo_scid
- end event
- event selectionchanged;call super::selectionchanged;cur_scid_arr1[] = THIS.uo_scid_arr
- cur_scid=this.uo_scid
- //cb_1.triggerevent(clicked!)
- end event
- type st_5 from statictext within w_rp_aging
- integer x = 887
- integer y = 204
- integer width = 224
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "分部:"
- boolean focusrectangle = false
- end type
- type cb_edit from uo_imflatbutton within w_rp_aging
- integer x = 306
- integer width = 274
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- string text = "设置分组"
- string normalpicname = "PRINTFLD.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;open(w_money_aging)
- end event
- type cb_3 from uo_imflatbutton within w_rp_aging
- integer x = 585
- integer width = 183
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "导出"
- string normalpicname = "excel.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;OPENWITHPARM(w_sentdataout,dw_1)
- end event
- type rb_1 from radiobutton within w_rp_aging
- integer x = 1102
- integer y = 320
- integer width = 425
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "应收"
- boolean checked = true
- end type
- event clicked;cb_1.TriggerEvent(Clicked!)
- end event
- type rb_2 from radiobutton within w_rp_aging
- integer x = 1582
- integer y = 320
- integer width = 425
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "应付"
- end type
- event clicked;dw_spttype.retrieve()
- cb_1.TriggerEvent(Clicked!)
- end event
- type dw_spttype from u_dw_rbtnfilter within w_rp_aging
- integer y = 1212
- integer width = 841
- integer height = 1656
- integer taborder = 100
- boolean bringtotop = true
- string dataobject = "dw_spttype_index"
- end type
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- IF dw_spttype.GetRow() <= 0 THEN
- ins_spttypeid = 0
- ELSE
- ins_spttypeid = dw_spttype.Object.spttypeid[dw_spttype.GetRow()]
- END IF
- cb_1.triggerevent(clicked!)
- end event
- type cbx_1 from checkbox within w_rp_aging
- integer x = 2139
- integer y = 324
- integer width = 402
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "显示0金额"
- end type
- event clicked;cb_1.TriggerEvent(Clicked!)
- end event
|