123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367 |
- $PBExportHeader$w_mustpay.srw
- forward
- global type w_mustpay from w_publ_pageretr
- end type
- type dw_mstpay from u_dw_rbtnfilter within w_mustpay
- end type
- type cbx_ifshowall from checkbox within w_mustpay
- end type
- type st_3 from statictext within w_mustpay
- end type
- type em_firstday from editmask within w_mustpay
- end type
- type st_4 from statictext within w_mustpay
- end type
- type em_endday from editmask within w_mustpay
- end type
- type cb_retrieve from uo_imflatbutton within w_mustpay
- end type
- type cb_2 from uo_imflatbutton within w_mustpay
- end type
- type cb_3 from uo_imflatbutton within w_mustpay
- end type
- type dw_mstpaymx from u_dw_rbtnfilter within w_mustpay
- end type
- type ddlb_1 from uo_ddlb_scid within w_mustpay
- end type
- type cb_autofinish from uo_imflatbutton within w_mustpay
- end type
- type cb_4 from uo_imflatbutton within w_mustpay
- end type
- type ddlb_2 from dropdownlistbox within w_mustpay
- end type
- type cb_reset from uo_imflatbutton within w_mustpay
- end type
- type st_6 from statictext within w_mustpay
- end type
- type ddlb_3 from dropdownlistbox within w_mustpay
- end type
- type st_2 from statictext within w_mustpay
- end type
- type st_5 from statictext within w_mustpay
- end type
- type cb_1 from uo_imflatbutton within w_mustpay
- end type
- type cbx_all from checkbox within w_mustpay
- end type
- type pb_em1 from picturebutton within w_mustpay
- end type
- type pb_em2 from picturebutton within w_mustpay
- end type
- type pb_2 from picturebutton within w_mustpay
- end type
- type cb_pay from uo_imflatbutton within w_mustpay
- end type
- type st_payamt from statictext within w_mustpay
- end type
- type st_mstpayamt from statictext within w_mustpay
- end type
- type st_balcamt from statictext within w_mustpay
- end type
- type ln_bar from line within w_mustpay
- end type
- type ln_bar2 from line within w_mustpay
- end type
- type r_bar from rectangle within w_mustpay
- end type
- type ln_1 from line within w_mustpay
- end type
- type ln_2 from line within w_mustpay
- end type
- type ln_5 from line within w_mustpay
- end type
- type ln_6 from line within w_mustpay
- end type
- type ln_3 from line within w_mustpay
- end type
- type ln_4 from line within w_mustpay
- end type
- type st_amtdisp from statictext within w_mustpay
- end type
- type cbx_1 from checkbox within w_mustpay
- end type
- end forward
- global type w_mustpay from w_publ_pageretr
- integer width = 3602
- integer height = 2300
- string title = "应付帐"
- boolean maxbox = true
- windowstate windowstate = maximized!
- event retrieve_pay ( )
- event retrieve_paymx ( )
- event ue_add ( )
- event ue_del ( )
- event ue_view_bill ( )
- event ue_pay ( )
- event ue_buybill_auto ( )
- event ue_dwchild_filter ( )
- event ue_rbbutton ( )
- event ue_create_buybill ( )
- event ue_create_sptamt ( )
- event ue_create_reissue_spt ( )
- event ue_buybill_auto_p ( )
- event ue_date1 ( )
- event ue_date2 ( )
- event ue_date3 ( )
- event ue_date4 ( )
- dw_mstpay dw_mstpay
- cbx_ifshowall cbx_ifshowall
- st_3 st_3
- em_firstday em_firstday
- st_4 st_4
- em_endday em_endday
- cb_retrieve cb_retrieve
- cb_2 cb_2
- cb_3 cb_3
- dw_mstpaymx dw_mstpaymx
- ddlb_1 ddlb_1
- cb_autofinish cb_autofinish
- cb_4 cb_4
- ddlb_2 ddlb_2
- cb_reset cb_reset
- st_6 st_6
- ddlb_3 ddlb_3
- st_2 st_2
- st_5 st_5
- cb_1 cb_1
- cbx_all cbx_all
- pb_em1 pb_em1
- pb_em2 pb_em2
- pb_2 pb_2
- cb_pay cb_pay
- st_payamt st_payamt
- st_mstpayamt st_mstpayamt
- st_balcamt st_balcamt
- ln_bar ln_bar
- ln_bar2 ln_bar2
- r_bar r_bar
- ln_1 ln_1
- ln_2 ln_2
- ln_5 ln_5
- ln_6 ln_6
- ln_3 ln_3
- ln_4 ln_4
- st_amtdisp st_amtdisp
- cbx_1 cbx_1
- end type
- global w_mustpay w_mustpay
- type variables
- uo_mustpay uo_pay
- long cur_id,cur_payid
- long cur_scid = 0
- long cur_scid_arr[]
- long ins_moneyid = -1
- Int finishflag = -1
- long cur_moneyid=0
- dec ins_mstpayamt=0
- dec ins_payamt=0
- end variables
- forward prototypes
- public subroutine wf_refresh_balc ()
- public function integer days_in_month (integer month, integer year)
- public function integer wf_dispamt ()
- public subroutine wf_initdisp ()
- end prototypes
- event retrieve_pay();long row,uc_relid=0,uc_scid,uc_moneyid
- string ls_cusname
- datetime firstdate,enddate
- row=dw_pageretr.getrow()
- if row>0 then
-
- uc_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[row]
-
- IF sys_option_scid_msttake_mstpay = 1 THEN
- uc_scid = dw_pageretr.Object.v_spt_balcamt_scid[row]
- ELSE
- uc_scid = cur_scid
- END IF
-
- uc_relid=dw_pageretr.object.sptid[row]
- ls_cusname=dw_pageretr.object.name[row]
- dw_mstpay.title=ls_cusname+'-应付帐'
- dw_mstpaymx.title=ls_cusname+'-应付帐明细'
-
- firstdate=datetime(date(em_firstday.text),time('00:00:00'))
- enddate=DATETIME(date(em_endday.TEXT),TIME('23:59:59'))
-
- dw_mstpay.SetRedraw (false)
- dw_mstpay.retrieve(uc_scid,uc_relid,firstdate,enddate,finishflag,uc_moneyid)
-
- if dw_mstpay.rowcount()>0 then
- dw_mstpay.selectrow(0,false)
- dw_mstpay.scrolltorow(1)
- dw_mstpay.selectrow(1,true)
- end if
- dw_mstpay.SetRedraw (true)
- else
- dw_mstpay.reset()
- end if
- cur_id=uc_relid
- cur_moneyid = uc_moneyid
- end event
- event retrieve_paymx();long row,uc_relid=0
- row=dw_mstpay.getrow()
- if row>0 then
- uc_relid=dw_mstpay.object.payid[row]
-
- dw_mstpaymx.SetRedraw (false)
- dw_mstpaymx.retrieve(uc_relid)
- dw_mstpaymx.SetRedraw (true)
- else
- dw_mstpaymx.reset()
- end if
- cur_payid=uc_relid
- end event
- event ue_add();IF NOT f_power_ind(134) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- IF cur_id <= 0 THEN
- MessageBox('提示','请选择供应商',information!,ok!)
- RETURN
- END IF
- IF cur_scid < 0 THEN
- MessageBox('提示','请选择分部',information!,ok!)
- RETURN
- END IF
- s_edit_index_tran s_open_tran
- s_open_tran.b_long = cur_id
- s_open_tran.b_string = ''
- s_open_tran.b_decimal = 0
- s_open_tran.c_long = cur_scid
- s_open_tran.d_long = cur_moneyid
- OpenWithParm(w_mustpay_mod,s_open_tran)
- wf_refresh_balc()
- THIS.TriggerEvent('retrieve_pay')
- end event
- event ue_del();IF NOT f_power_ind(134) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- Long payid,lirow
- String arg_msg
- lirow = dw_mstpay.GetRow()
- IF lirow = 0 THEN
- MessageBox('提示','请选定要删除的应付帐',information!,ok!)
- RETURN
- END IF
- IF MessageBox ("询问","是否确定要删除当前应付帐记录?",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- //IF dw_mstpay.Object.finishflag[lirow] = 1 THEN
- // MessageBox('提示','选定的应付帐已结清,不能删除',information!,ok!)
- // RETURN
- //END IF
- payid = dw_mstpay.Object.payid[lirow]
- IF uo_pay.del_payrec (cur_scid,0,payid, cur_id, arg_msg,TRUE) = 0 THEN
- MessageBox("错误",arg_msg,stopsign!,ok!)
- RETURN
- END IF
- //日志
- Long ls_id,ls_curid
- String ls_code,ls_opemp
- ls_id = payid
- ls_curid = cur_id
- ls_code = dw_mstpay.Object.billcode[lirow]
- ls_opemp = dw_mstpay.Object.opemp[lirow]
- f_setsysoplog('应付帐','应付帐删除,ID:'+String(ls_id)+',客户ID:'+String(ls_curid)+',code:'+ls_code+',建立人:'+ls_opemp,arg_msg,TRUE)
- //--
- dw_mstpay.DeleteRow(lirow)
- dw_mstpay.TriggerEvent(RowFocusChanged!)
- wf_refresh_balc()
- THIS.TriggerEvent('retrieve_pay')
- MessageBox('提示','删除应付帐操作成功!',information!,ok!)
- end event
- event ue_view_bill();Long row
- row = dw_mstpay.GetRow()
- IF row <= 0 THEN RETURN
- IF row > 0 THEN
- String ls_code
- Long ll_scid
- Int li_buildtype
- Decimal ld_mstamt
-
- ll_scid = dw_mstpay.Object.scid[row]
- ls_code = dw_mstpay.Object.billcode[row]
- ld_mstamt = dw_mstpay.Object.mstpayamt[row]
- li_buildtype = dw_mstpay.Object.buildtype[row]
-
- IF li_buildtype = 0 THEN RETURN
- f_open_win(ll_scid,ls_code)
-
- // IF ld_mstamt < 0 THEN
- // IF Pos(ls_code,'CT') > 0 THEN
- // f_open_win('w_inware_buy_th',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'ST') > 0 THEN
- // f_open_win('w_inware_wfjg_th',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'SI') > 0 THEN
- // f_open_win('w_wfjg_in_th',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'FK') > 0 THEN
- // f_open_win('w_sptamt_edit',ll_scid,ls_code)
- // END IF
- // ELSE
- // IF Pos(ls_code,'CG') > 0 THEN
- // f_open_win('w_inware_buy',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'WT') > 0 THEN
- // f_open_win('w_inware_wfjg',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'WI') > 0 THEN
- // f_open_win('w_wfjg_in',ll_scid,ls_code)
- // ELSEIF Pos(ls_code,'FK') > 0 THEN
- // f_open_win('w_sptamt_edit',ll_scid,ls_code)
- // END IF
- // END IF
- END IF
- end event
- event ue_pay();if not f_power_ind(134) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- if cur_id <= 0 then
- messagebox('提示','请选择供应商',information!,ok!)
- return
- end if
- long ll_row
- ll_row = dw_mstpay.getrow()
- if ll_row <= 0 then
- messagebox('提示','请选择付款单据',information!,ok!)
- return
- end if
- s_edit_index_tran s_open_tran
- s_open_tran.b_long = cur_id
- s_open_tran.c_long = cur_scid
- s_open_tran.b_string = dw_mstpay.object.billcode[ll_row]
- s_open_tran.b_decimal = dw_mstpay.object.balcamt[ll_row]
- s_open_tran.d_long=cur_moneyid
-
- openwithparm(w_mustpay_mod,s_open_tran)
- wf_refresh_balc()
- this.triggerevent('retrieve_pay')
- end event
- event ue_buybill_auto();Long ll_rowcount
- Long ll_banktypeid
- DateTime ld_mxpaydate
- Int j
- ld_mxpaydate = DateTime(Today(),Time(0))
- dw_mstpay.AcceptText()
- ll_rowcount = dw_mstpay.RowCount()
- IF ll_rowcount <= 0 THEN RETURN
- datastore ds_mstpaymx
- ds_mstpaymx = CREATE datastore
- ds_mstpaymx.DataObject = "dw_buybillmx_index"
- ds_mstpaymx.SetTransObject(sqlca)
- ds_mstpaymx.Retrieve(0.1)
- IF ds_mstpaymx.RowCount() > 0 THEN
- FOR j = 1 TO ds_mstpaymx.RowCount()
- ds_mstpaymx.DeleteRow(j)
- NEXT
- END IF
- ds_mstpaymx.AcceptText()
- Int i
- Long ll_row
- Long ll_payamtcount = 0
- FOR i = 1 TO ll_rowcount
- IF dw_mstpay.Object.checkdata[i] = 0 THEN
- CONTINUE
- END IF
-
- IF dw_mstpay.Object.balcamt[i] < 0 and (dw_mstpay.Object.payamt[i]>0 or dw_mstpay.Object.mstpayamt[i]<0 ) THEN
- ll_payamtcount++
- ld_mxpaydate = dw_mstpay.Object.paydate[i]
- ll_banktypeid = dw_mstpay.Object.banktypeid[i]
- END IF
-
- // IF ll_payamtcount > 1 THEN
- // MessageBox('提示','预付款或已付款限制对数只能有一条',information!,ok!)
- // RETURN
- // END IF
-
- ll_row = ds_mstpaymx.InsertRow(0)
- ds_mstpaymx.Object.billcode[ll_row] = dw_mstpay.Object.billcode[i]
- ds_mstpaymx.Object.paydate[ll_row] = dw_mstpay.Object.paydate[i]
- ds_mstpaymx.Object.oriamt[ll_row] = dw_mstpay.Object.oriamt[i]
- ds_mstpaymx.Object.mainmstpayamt[ll_row] = dw_mstpay.Object.mstpayamt[i]
- ds_mstpaymx.Object.mainpayamt[ll_row] = dw_mstpay.Object.payamt[i]
- ds_mstpaymx.Object.payid[ll_row] = dw_mstpay.Object.payid[i]
- NEXT
- ds_mstpaymx.AcceptText()
- //生成相关号
- long ll_pay_i
- string ls_pay_i_billcode,ls_not_pay_i_billcode
- FOR i = 1 TO ds_mstpaymx.RowCount()
- if ds_mstpaymx.Object.mainmstpayamt[i] = 0 and ds_mstpaymx.Object.mainpayamt[i]<>0 then
- ll_pay_i = i
- ls_pay_i_billcode = ds_mstpaymx.Object.billcode[i]
- else
- ls_not_pay_i_billcode = ls_not_pay_i_billcode + trim(ds_mstpaymx.Object.billcode[i])+','
- end if
- next
- ls_not_pay_i_billcode = left(ls_not_pay_i_billcode,len(ls_not_pay_i_billcode) - 1 )
- ls_not_pay_i_billcode = Left(ls_not_pay_i_billcode, 255)
- FOR i = 1 TO ds_mstpaymx.RowCount()
- if i = ll_pay_i then
- ds_mstpaymx.object.relbillcode[i] = ls_not_pay_i_billcode
- else
- ds_mstpaymx.object.relbillcode[i] = ls_pay_i_billcode
- end if
- next
- //
- Decimal mstpayamt = 0,payamt = 0
- //第一次循环,分配应付,计算总可分配
- FOR i = 1 TO ds_mstpaymx.RowCount()
- IF mstpayamt > 0 THEN
- IF ds_mstpaymx.Object.mainmstpayamt[i] <= mstpayamt THEN
- ds_mstpaymx.Object.mstpayamt[i] = ds_mstpaymx.Object.mainmstpayamt[i]
- mstpayamt = mstpayamt - ds_mstpaymx.Object.mainmstpayamt[i]
- ELSE
- ds_mstpaymx.Object.mstpayamt[i] = mstpayamt
- mstpayamt = 0
- END IF
- END IF
-
- payamt = payamt - (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
-
- ds_mstpaymx.Object.payamt[i] = (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
-
- NEXT
- ds_mstpaymx.AcceptText()
- //第二次循环:根据可分配判断正负,修正相关结余(正-负、负-正)
- IF payamt < 0 THEN //不够分配
- FOR i = ds_mstpaymx.RowCount() TO 1 STEP - 1
-
- IF (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i]) <= 0 THEN CONTINUE
-
- IF ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i] + payamt < 0 THEN
- ds_mstpaymx.Object.payamt[i] = 0
- payamt = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
- ELSE
- ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
- payamt = 0
- END IF
- NEXT
- ELSE // 分配有剩
-
- FOR i = ds_mstpaymx.RowCount() TO 1 STEP - 1
- IF (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i]) >= 0 THEN CONTINUE //or ds_mstpaymx.Object.payamt[i]=0
-
- IF ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i] + payamt > 0 THEN
- ds_mstpaymx.Object.payamt[i] = 0
- payamt = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
- //ds_mstpaymx.Object.payamt[i] =payamt
- ELSE
- ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mainmstpayamt[i] - ds_mstpaymx.Object.mainpayamt[i])
- payamt = 0
- END IF
- NEXT
- END IF
- ds_mstpaymx.AcceptText()
- uo_buybill uo_bill
- uo_bill = CREATE uo_buybill
- String arg_msg = ''
- IF uo_bill.newbegin() = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,ok!)
- RETURN
- END IF
- uo_bill.opemp = publ_operator
- uo_bill.paydate = ld_mxpaydate
- uo_bill.relcode = ''
- uo_bill.inrep = publ_operator
- uo_bill.banktypeid = ll_banktypeid
- uo_bill.dscrp = ''
- uo_bill.sptid = cur_id
- uo_bill.mstpayamt = 0
- uo_bill.payamt = 0
- uo_bill.accountsid = 0
- uo_bill.itemid = 0
- uo_bill.buildtype=1
- uo_bill.moneyid=ins_moneyid
- FOR i = 1 TO ds_mstpaymx.RowCount()
- IF ds_mstpaymx.Object.mainmstpayamt[i] <> 0 OR ds_mstpaymx.Object.mainpayamt[i] <> 0 THEN
- IF uo_bill.acceptmx(ds_mstpaymx.Object.payid[i],&
- ds_mstpaymx.Object.billcode[i],&
- ds_mstpaymx.Object.mstpayamt[i],&
- ds_mstpaymx.Object.payamt[i],&
- ds_mstpaymx.Object.oriamt[i],&
- ds_mstpaymx.Object.mainmstpayamt[i],&
- ds_mstpaymx.Object.mainpayamt[i],&
- ds_mstpaymx.Object.relbillcode[i],&
- arg_msg) = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,ok!)
- RETURN
- END IF
- END IF
- NEXT
- IF uo_bill.Save_ds(arg_msg,TRUE) = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,ok!)
- return
- END IF
- IF sys_option_mustpay_auditing = 1 then
- IF uo_bill.auditing(uo_bill.buybillid,publ_operator,arg_msg,true)=0 then
- messagebox('错误',arg_msg,stopsign!,ok!)
- return
- END IF
- END IF
- MessageBox('提示','自动生成采购支出单成功,单据编号为'+uo_bill.buybillcode,information!,ok!)
-
- DESTROY uo_bill
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- event ue_dwchild_filter();dw_mstpay.setfilter('')
- dw_mstpay.filter()
- end event
- event ue_rbbutton();dw_mstpay.event rbbutton( dw_mstpay.arg_ins_dwtype,dw_mstpay.arg_ins_dwname,dw_mstpay.arg_ins_dwdata,dw_mstpay.arg_ins_dwrow )
- end event
- event ue_create_buybill();//辅助建立供应商对数单
- if not f_power_ind(639) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- if cur_id <= 0 then
- messagebox('提示','请选择供应商',information!,ok!)
- return
- end if
- if cur_scid < 0 then
- messagebox('提示','请选择分部',information!,ok!)
- return
- end if
- s_edit_index_tran s_open_tran
- s_open_tran.b_long=cur_id
- s_open_tran.b_string = ''
- s_open_tran.b_decimal = 0
- s_open_tran.c_long = cur_scid
- openwithparm(w_buybill,s_open_tran)
- wf_refresh_balc()
- this.triggerevent('retrieve_pay')
- end event
- event ue_create_sptamt();//辅助建立供应商付款单
- IF Not f_power_ind(920) THEN
- MessageBox(publ_operator,"你没有权限")
- RETURN
- END IF
- IF cur_id <= 0 THEN
- MessageBox(publ_operator,'请选择供应商')
- RETURN
- END IF
- IF cur_scid < 0 THEN
- MessageBox(publ_operator,'请选择分部')
- RETURN
- END IF
- String ls_scname
- SELECT scname
- INTO :ls_scname
- FROM u_scdef
- Where scid = :cur_scid;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','查询分部名称失败')
- RETURN
- END IF
- s_edit_index_tran s_open_tran
- s_open_tran.d_long = 1
- s_open_tran.c_long = cur_scid
- s_open_tran.d_string = ls_scname
- s_open_tran.e_long = cur_id
- OpenWithParm(w_sptamt_edit_response,s_open_tran)
- wf_refresh_balc()
- This.TriggerEvent('retrieve_pay')
- end event
- event ue_create_reissue_spt();//辅助建立供应商费用单
- IF Not f_power_ind(1021) THEN
- MessageBox(publ_operator,"你没有权限")
- RETURN
- END IF
- IF cur_id <= 0 THEN
- MessageBox(publ_operator,'请选择供应商')
- RETURN
- END IF
- IF cur_scid < 0 THEN
- MessageBox(publ_operator,'请选择分部')
- RETURN
- END IF
- String ls_scname
- SELECT scname
- INTO :ls_scname
- FROM u_scdef
- Where scid = :cur_scid;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('系统提示','查询分部名称失败')
- RETURN
- END IF
- s_edit_index_tran s_open_tran
- s_open_tran.d_long = 1
- s_open_tran.c_long = cur_scid
- s_open_tran.d_string = ls_scname
- s_open_tran.e_long = cur_id
- OpenWithParm(w_reissue_spt_response,s_open_tran)
- wf_refresh_balc()
- This.TriggerEvent('retrieve_pay')
- end event
- event ue_buybill_auto_p();IF Not f_power_ind(1546) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- IF MessageBox('确认','是否对当前选择供应商自动对单?',question!,yesno!) = 2 THEN RETURN
- Long row
- DateTime enddate
- Long uc_scid,uc_moneyid,uc_sptid
- Long ll_i,ll_j,ll_k,i
- Long ll_pay_i
- String ls_pay_i_billcode,ls_not_pay_i_billcode
- Decimal ld_payamt
- DateTime ldt_paydate
- Long ll_banktypeid,ll_row
- String ls_mxdscrp
- Long ll_accountsid, ll_itemid
- Decimal payamt
- //DateTime ls_dsdate
- //String ls_dsdscrp
- String arg_msg_all
- String ls_sptname
- decimal lde_mstpayamt_tolbill, lde_payamt_tolbill, lde_payamt_mx
- datastore ds_mstpaymx
- ds_mstpaymx = Create datastore
- ds_mstpaymx.DataObject = "dw_buybillmx_index"
- uo_buybill uo_bill
- uo_bill = Create uo_buybill
- datastore ds_pay,ds_mstpay
- ds_pay = Create datastore
- ds_pay.DataObject = 'ds_mstpay_index_autobill'
- ds_pay.SetTransObject(sqlca)
- ds_mstpay = Create datastore
- ds_mstpay.DataObject = 'ds_mstpay_index_autobill_mst'
- ds_mstpay.SetTransObject(sqlca)
- row = dw_pageretr.Find('ch = 1',1,dw_pageretr.RowCount())
- IF row <= 0 THEN
- MessageBox('系统提示','请先选择供应商')
- RETURN
- END IF
- Open(w_autobill_date_ch)
- s_edit_index_tran s_tran_date
- s_tran_date = Message.PowerObjectParm
- IF s_tran_date.b_long = 0 THEN RETURN
- enddate = s_tran_date.b_datetime
- FOR ll_i = 1 To dw_pageretr.RowCount()
- IF dw_pageretr.Object.ch[ll_i] = 0 THEN CONTINUE
-
- uc_sptid = dw_pageretr.Object.sptid[ll_i]
- uc_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[ll_i]
- ls_sptname = dw_pageretr.Object.Name[ll_i]
-
- IF sys_option_scid_msttake_mstpay = 1 THEN
- uc_scid = dw_pageretr.Object.v_spt_balcamt_scid[ll_i]
- ELSE
- uc_scid = cur_scid
- END IF
-
- ds_pay.Retrieve(uc_scid,uc_sptid,enddate,uc_moneyid)
-
- ll_row = 0
- FOR ll_j = 1 To ds_pay.RowCount()
- IF ds_pay.Object.payamt[ll_j] - ds_pay.Object.mstpayamt[ll_j] = 0 THEN CONTINUE
-
- ls_pay_i_billcode = ''
- ls_not_pay_i_billcode = ''
-
- lde_mstpayamt_tolbill = 0
- lde_payamt_tolbill = 0
-
- // ld_payamt = 0
-
- //本次已付款
- ld_payamt = ds_pay.Object.payamt[ll_j] - ds_pay.Object.mstpayamt[ll_j]
-
- ldt_paydate = ds_pay.Object.paydate[ll_j]
- ll_banktypeid = ds_pay.Object.banktypeid[ll_j]
- ls_mxdscrp = ds_pay.Object.dscrp[ll_j]
- ll_accountsid = ds_pay.Object.u_bmstpay_accountsid[ll_j]
- ll_itemid = ds_pay.Object.u_bmstpay_itemid[ll_j]
-
- ls_pay_i_billcode = ds_pay.Object.billcode[ll_j]
-
- ds_mstpaymx.Reset()
-
- ll_row = ds_mstpaymx.InsertRow(0)
- ll_pay_i = ll_row
- ds_mstpaymx.Object.billcode[ll_row] = ds_pay.Object.billcode[ll_j]
- ds_mstpaymx.Object.paydate[ll_row] = ds_pay.Object.paydate[ll_j]
- ds_mstpaymx.Object.oriamt[ll_row] = ds_pay.Object.oriamt[ll_j]
- ds_mstpaymx.Object.mainmstpayamt[ll_row] = ds_pay.Object.mstpayamt[ll_j]
- ds_mstpaymx.Object.mainpayamt[ll_row] = ds_pay.Object.payamt[ll_j]
- ds_mstpaymx.Object.payid[ll_row] = ds_pay.Object.payid[ll_j]
- // ds_mstpaymx.Object.moneyid[ll_row] = ds_pay.Object.u_bmstpay_moneyid[ll_j]
-
- ds_mstpay.Retrieve(uc_scid,uc_sptid,enddate,uc_moneyid)
-
- FOR ll_k = 1 To ds_mstpay.RowCount()
-
- IF ld_payamt <= 0 THEN EXIT
-
- IF ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k] = 0 THEN CONTINUE
-
- if ld_payamt > ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k] then
- lde_payamt_mx = ds_mstpay.Object.mstpayamt[ll_k] - ds_mstpay.Object.payamt[ll_k]
- ld_payamt = ld_payamt - lde_payamt_mx
- else
- lde_payamt_mx = ld_payamt
- ld_payamt = 0
- end if
-
- ll_row = ds_mstpaymx.InsertRow(0)
- ds_mstpaymx.Object.billcode[ll_row] = ds_mstpay.Object.billcode[ll_k]
- ds_mstpaymx.Object.paydate[ll_row] = ds_mstpay.Object.paydate[ll_k]
- ds_mstpaymx.Object.oriamt[ll_row] = ds_mstpay.Object.oriamt[ll_k]
- ds_mstpaymx.Object.mainmstpayamt[ll_row] = ds_mstpay.Object.mstpayamt[ll_k]
- ds_mstpaymx.Object.mainpayamt[ll_row] = ds_mstpay.Object.payamt[ll_k]
- ds_mstpaymx.Object.payid[ll_row] = ds_mstpay.Object.payid[ll_k]
- // ds_mstpaymx.Object.moneyid[ll_row] = ds_mstpay.Object.u_bmstpay_moneyid[ll_k]
-
- ds_mstpaymx.Object.mstpayamt[ll_row] = 0
- //明细分配已付
- ds_mstpaymx.Object.payamt[ll_row] = lde_payamt_mx
-
- ls_not_pay_i_billcode += ds_mstpay.Object.billcode[ll_k] + ','
- lde_payamt_tolbill += lde_payamt_mx
- NEXT
-
- //总分配已收
- lde_mstpayamt_tolbill = ds_mstpaymx.Object.mainpayamt[ll_pay_i] - ds_mstpaymx.Object.mainmstpayamt[ll_pay_i] - ld_payamt
- ds_mstpaymx.Object.payamt[ll_pay_i] = 0 - lde_mstpayamt_tolbill
-
- // FOR i = 1 To ds_mstpaymx.RowCount()
- // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] < 0 THEN
- // ll_pay_i = i
- // ls_pay_i_billcode = ds_mstpaymx.Object.billcode[i]
- // ELSE
- // ls_not_pay_i_billcode = ls_not_pay_i_billcode + Trim(ds_mstpaymx.Object.billcode[i])+','
- // END IF
- // NEXT
-
- ls_not_pay_i_billcode = Left(ls_not_pay_i_billcode,Len(ls_not_pay_i_billcode) - 1 )
-
- ls_not_pay_i_billcode = left(ls_not_pay_i_billcode,250)
- ls_pay_i_billcode = left(ls_pay_i_billcode,250)
-
-
- FOR i = 1 To ds_mstpaymx.RowCount()
- IF i = ll_pay_i THEN
- ds_mstpaymx.Object.relbillcode[i] = ls_not_pay_i_billcode
- ELSE
- ds_mstpaymx.Object.relbillcode[i] = ls_pay_i_billcode
- END IF
- NEXT
-
- // payamt = 0
- // FOR i = 1 To ds_mstpaymx.RowCount()
- // payamt = payamt - (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // ds_mstpaymx.Object.payamt[i] = (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // NEXT
- // ds_mstpaymx.AcceptText()
- //
- // //第二次循环:根据可分配判断正负,修正相关结余(正-负、负-正)
- // IF payamt < 0 THEN //不够分配
- // FOR i = ds_mstpaymx.RowCount() To 1 Step - 1
- //
- // If (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i]) <= 0 THEN CONTINUE
- //
- // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] + payamt < 0 THEN
- // ds_mstpaymx.Object.payamt[i] = 0
- // payamt = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // ELSE
- // ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // payamt = 0
- // END IF
- // NEXT
- // ELSE // 分配有剩
- // FOR i = ds_mstpaymx.RowCount() To 1 Step - 1
- // If (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i]) >= 0 THEN CONTINUE
- //
- // IF ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i] + payamt > 0 THEN
- // ds_mstpaymx.Object.payamt[i] = 0
- // payamt = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // ELSE
- // ds_mstpaymx.Object.payamt[i] = payamt + (ds_mstpaymx.Object.mstpayamt[i] - ds_mstpaymx.Object.payamt[i])
- // payamt = 0
- // END IF
- // NEXT
- // END IF
- ds_mstpaymx.AcceptText()
-
- // ls_dsdate = ldt_paydate
- // ls_dsdscrp = ls_mxdscrp
-
- String arg_msg = ''
- IF uo_bill.newbegin() = 0 THEN
- arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
- GOTO _next_spt
- END IF
-
- uo_bill.opemp = publ_operator
- uo_bill.paydate = ldt_paydate
- uo_bill.relcode = ''
- uo_bill.inrep = publ_operator
- uo_bill.banktypeid = ll_banktypeid
- uo_bill.dscrp = ''
- uo_bill.sptid = uc_sptid
- uo_bill.mstpayamt = lde_mstpayamt_tolbill
- uo_bill.payamt = lde_payamt_tolbill
- uo_bill.accountsid = ll_accountsid
- uo_bill.itemid = ll_itemid
- uo_bill.buildtype = 1
- uo_bill.moneyid = uc_moneyid
-
- FOR i = 1 To ds_mstpaymx.RowCount()
- IF ds_mstpaymx.Object.mstpayamt[i] <> 0 Or ds_mstpaymx.Object.payamt[i] <> 0 THEN
- IF uo_bill.acceptmx(ds_mstpaymx.Object.payid[i],&
- ds_mstpaymx.Object.billcode[i],&
- ds_mstpaymx.Object.mstpayamt[i],&
- ds_mstpaymx.Object.payamt[i],&
- ds_mstpaymx.Object.oriamt[i],&
- ds_mstpaymx.Object.mstpayamt[i],&
- ds_mstpaymx.Object.payamt[i],&
- ds_mstpaymx.Object.relbillcode[i],&
- arg_msg) = 0 THEN
- arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
- GOTO _next_spt
- END IF
- END IF
- NEXT
-
- IF uo_bill.Save_ds(arg_msg,True) = 0 THEN
- arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'对数失败,'+arg_msg +'~r~n'
- GOTO _next_spt
- END IF
-
- IF sys_option_mustpay_auditing = 1 then
- IF uo_bill.auditing(uo_bill.buybillid,publ_operator,arg_msg,true)=0 then
- arg_msg_all = arg_msg_all + '供应商:'+ls_sptname+'审核失败,'+arg_msg +'~r~n'
- GOTO _next_spt
- END IF
- END IF
-
-
- //已收款没有被对完,即代表没有应收款再对,跳出功能.
- IF ld_payamt > 0 THEN EXIT
- NEXT
- _next_spt:
- NEXT
- Destroy uo_bill
- Destroy ds_pay
- Destroy ds_mstpay
- IF Trim(arg_msg_all) <> '' THEN
- OpenWithParm(w_message_err,arg_msg_all)
- else
- MessageBox('系统提示','自动对数操作完成')
- END IF
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- event ue_date1();//IF THIS.Text = "本日" THEN
- em_firstday.text = string(today(),"yyyy-mm-dd")
- em_endday.text = string(today(),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本周" THEN
- // int li_DayNum
- // li_DayNum = DayNumber(today())
- // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
- // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本月" THEN
- // int li_Month, li_Year, li_Days
- // li_Month = Month(today())
- // li_Year = Year(today())
- // li_Days = days_in_month(li_Month, li_Year)
- // em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
- // em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
- //END IF
- end event
- event ue_date2();//IF THIS.Text = "本日" THEN
- // em_firstday.text = string(today(),"yyyy-mm-dd")
- // em_endday.text = string(today(),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本周" THEN
- int li_DayNum
- li_DayNum = DayNumber(today())
- em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
- em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本月" THEN
- // int li_Month, li_Year, li_Days
- // li_Month = Month(today())
- // li_Year = Year(today())
- // li_Days = days_in_month(li_Month, li_Year)
- // em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
- // em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
- //END IF
- end event
- event ue_date3();//IF THIS.Text = "本日" THEN
- // em_firstday.text = string(today(),"yyyy-mm-dd")
- // em_endday.text = string(today(),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本周" THEN
- // int li_DayNum
- // li_DayNum = DayNumber(today())
- // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
- // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本月" THEN
- int li_Month, li_Year, li_Days
- li_Month = Month(today())
- li_Year = Year(today())
- li_Days = days_in_month(li_Month, li_Year)
- em_firstday.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
- em_endday.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
- //END IF
- end event
- event ue_date4();//IF THIS.Text = "本日" THEN
- // em_firstday.text = string(today(),"yyyy-mm-dd")
- // em_endday.text = string(today(),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本周" THEN
- // int li_DayNum
- // li_DayNum = DayNumber(today())
- // em_firstday.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd")
- // em_endday.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd")
- //ELSEIF THIS.Text = "本月" THEN
- Int li_Month, li_Year, li_Days
- li_Month = Month(Today())
- li_Year = Year(Today())
- IF li_Month = 1 THEN
- li_Month = 12
- li_Year = li_Year - 1
- ELSE
- li_Month -= 1
- END IF
- li_Days = days_in_month(li_Month, li_Year)
- em_firstday.Text = String(Date(li_Year, li_Month, 1),"yyyy-mm-dd")
- em_endday.Text = String(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd")
- //END IF
- end event
- public subroutine wf_refresh_balc ();
- Long li_row
- Long ll_sptid,ll_scid,ll_moneyid
- Decimal li_new_balc
- li_row = dw_pageretr.GetRow()
- IF li_row <= 0 THEN RETURN
- ll_sptid = dw_pageretr.Object.sptid[li_row]
- ll_moneyid = dw_pageretr.Object.v_spt_balcamt_moneyid[li_row]
- IF sys_option_scid_msttake_mstpay = 1 THEN
- ll_scid = dw_pageretr.Object.v_spt_balcamt_scid [li_row]
- ELSE
- ll_scid = -1
- END IF
- SELECT sum(v_spt_balcamt.spt_balcamt)
- INTO :li_new_balc
- FROM v_spt_balcamt
- WHERE ( v_spt_balcamt.sptid = :ll_sptid )
- And ( v_spt_balcamt.moneyid = :ll_moneyid )
- And ( v_spt_balcamt.scid = :ll_scid OR :ll_scid = -1);
- IF sqlca.SQLCode <> 0 THEN RETURN
- IF IsNull(li_new_balc) THEN li_new_balc = 0.00
- dw_pageretr.Object.v_spt_balcamt_spt_balcamt[li_row] = li_new_balc
- dw_pageretr.Object.amt[li_row] = round(li_new_balc * dw_pageretr.Object.rate[li_row],2)
-
- end subroutine
- public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of
- //days in 11 of the 12 months. February is, of course, the problem.
- //In a leap year February has 29 days, otherwise 28.
- Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31}
- // Get the number of days per month for a non leap year.
- li_DaysInMonth = li_Days[Month]
- // Check for a leap year.
- If Month = 2 Then
- // If the year is a leap year, change the number of days.
- // Leap Year Calculation:
- // Year divisible by 4, but not by 100, unless it is also divisible by 400
- If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then
- li_DaysInMonth = 29
- End If
- End If
- //Return the number of days in the relevant month
- Return li_DaysInMonth
- end function
- public function integer wf_dispamt ();Int rslt = 0
- Long row
- dw_mstpay.AcceptText()
- row = dw_mstpay.GetRow()
- IF row > 0 And dw_mstpay.GetColumnName( ) = 'checkdata' THEN
- IF dw_mstpay.Object.checkdata[row] = 0 THEN
- ins_mstpayamt = ins_mstpayamt+dw_mstpay.Object.mstpayamt[row]
- ins_payamt = ins_payamt+dw_mstpay.Object.payamt[row]
- ELSE
- ins_mstpayamt = ins_mstpayamt - dw_mstpay.Object.mstpayamt[row]
- ins_payamt = ins_payamt - dw_mstpay.Object.payamt[row]
- END IF
- st_mstpayamt.Text = '应收金额:'+String(ins_mstpayamt,'####0.##')
- st_payamt.Text = '已收金额:'+String(ins_payamt,'####0.##')
- st_balcamt.Text = '结余金额:'+String(ins_mstpayamt - ins_payamt,'####0.##')
- IF ins_mstpayamt > ins_payamt THEN
- st_balcamt.TextColor = RGB(253,13,31)
- ELSE
- st_balcamt.TextColor = RGB(0,0,0)
- END IF
- ELSE
- wf_initdisp()
- END IF
- RETURN rslt
- end function
- public subroutine wf_initdisp ();ins_mstpayamt = 0
- ins_payamt = 0
- st_mstpayamt.Text = '应付金额:0'
- st_payamt.Text = '已付金额:0'
- st_balcamt.Text = '结余金额:0'
- end subroutine
- on w_mustpay.create
- int iCurrent
- call super::create
- this.dw_mstpay=create dw_mstpay
- this.cbx_ifshowall=create cbx_ifshowall
- this.st_3=create st_3
- this.em_firstday=create em_firstday
- this.st_4=create st_4
- this.em_endday=create em_endday
- this.cb_retrieve=create cb_retrieve
- this.cb_2=create cb_2
- this.cb_3=create cb_3
- this.dw_mstpaymx=create dw_mstpaymx
- this.ddlb_1=create ddlb_1
- this.cb_autofinish=create cb_autofinish
- this.cb_4=create cb_4
- this.ddlb_2=create ddlb_2
- this.cb_reset=create cb_reset
- this.st_6=create st_6
- this.ddlb_3=create ddlb_3
- this.st_2=create st_2
- this.st_5=create st_5
- this.cb_1=create cb_1
- this.cbx_all=create cbx_all
- this.pb_em1=create pb_em1
- this.pb_em2=create pb_em2
- this.pb_2=create pb_2
- this.cb_pay=create cb_pay
- this.st_payamt=create st_payamt
- this.st_mstpayamt=create st_mstpayamt
- this.st_balcamt=create st_balcamt
- this.ln_bar=create ln_bar
- this.ln_bar2=create ln_bar2
- this.r_bar=create r_bar
- this.ln_1=create ln_1
- this.ln_2=create ln_2
- this.ln_5=create ln_5
- this.ln_6=create ln_6
- this.ln_3=create ln_3
- this.ln_4=create ln_4
- this.st_amtdisp=create st_amtdisp
- this.cbx_1=create cbx_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_mstpay
- this.Control[iCurrent+2]=this.cbx_ifshowall
- this.Control[iCurrent+3]=this.st_3
- this.Control[iCurrent+4]=this.em_firstday
- this.Control[iCurrent+5]=this.st_4
- this.Control[iCurrent+6]=this.em_endday
- this.Control[iCurrent+7]=this.cb_retrieve
- this.Control[iCurrent+8]=this.cb_2
- this.Control[iCurrent+9]=this.cb_3
- this.Control[iCurrent+10]=this.dw_mstpaymx
- this.Control[iCurrent+11]=this.ddlb_1
- this.Control[iCurrent+12]=this.cb_autofinish
- this.Control[iCurrent+13]=this.cb_4
- this.Control[iCurrent+14]=this.ddlb_2
- this.Control[iCurrent+15]=this.cb_reset
- this.Control[iCurrent+16]=this.st_6
- this.Control[iCurrent+17]=this.ddlb_3
- this.Control[iCurrent+18]=this.st_2
- this.Control[iCurrent+19]=this.st_5
- this.Control[iCurrent+20]=this.cb_1
- this.Control[iCurrent+21]=this.cbx_all
- this.Control[iCurrent+22]=this.pb_em1
- this.Control[iCurrent+23]=this.pb_em2
- this.Control[iCurrent+24]=this.pb_2
- this.Control[iCurrent+25]=this.cb_pay
- this.Control[iCurrent+26]=this.st_payamt
- this.Control[iCurrent+27]=this.st_mstpayamt
- this.Control[iCurrent+28]=this.st_balcamt
- this.Control[iCurrent+29]=this.ln_bar
- this.Control[iCurrent+30]=this.ln_bar2
- this.Control[iCurrent+31]=this.r_bar
- this.Control[iCurrent+32]=this.ln_1
- this.Control[iCurrent+33]=this.ln_2
- this.Control[iCurrent+34]=this.ln_5
- this.Control[iCurrent+35]=this.ln_6
- this.Control[iCurrent+36]=this.ln_3
- this.Control[iCurrent+37]=this.ln_4
- this.Control[iCurrent+38]=this.st_amtdisp
- this.Control[iCurrent+39]=this.cbx_1
- end on
- on w_mustpay.destroy
- call super::destroy
- destroy(this.dw_mstpay)
- destroy(this.cbx_ifshowall)
- destroy(this.st_3)
- destroy(this.em_firstday)
- destroy(this.st_4)
- destroy(this.em_endday)
- destroy(this.cb_retrieve)
- destroy(this.cb_2)
- destroy(this.cb_3)
- destroy(this.dw_mstpaymx)
- destroy(this.ddlb_1)
- destroy(this.cb_autofinish)
- destroy(this.cb_4)
- destroy(this.ddlb_2)
- destroy(this.cb_reset)
- destroy(this.st_6)
- destroy(this.ddlb_3)
- destroy(this.st_2)
- destroy(this.st_5)
- destroy(this.cb_1)
- destroy(this.cbx_all)
- destroy(this.pb_em1)
- destroy(this.pb_em2)
- destroy(this.pb_2)
- destroy(this.cb_pay)
- destroy(this.st_payamt)
- destroy(this.st_mstpayamt)
- destroy(this.st_balcamt)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- destroy(this.r_bar)
- destroy(this.ln_1)
- destroy(this.ln_2)
- destroy(this.ln_5)
- destroy(this.ln_6)
- destroy(this.ln_3)
- destroy(this.ln_4)
- destroy(this.st_amtdisp)
- destroy(this.cbx_1)
- end on
- event resize;call super::resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- ln_1.endx = this.width
- ln_2.endx = this.width
- r_bar.width = this.width
- long w_width,w_height
- w_width = 3600
- w_height = 2300
-
- if newwidth < w_width then this.width = w_width
- if newheight < w_height then this.height = w_height
- dw_pageretr.height=this.height - (w_height - 1785)
- dw_mstpay.height=this.height - (w_height - 1104)
- dw_mstpay.width=this.width - (w_width - 2082)
- dw_mstpaymx.width=this.width - (w_width - 2082)
- dw_mstpaymx.y=this.height - (w_height - 1500)
- end event
- event open;call super::open;uo_pay= create uo_mustpay
- em_firstday.text=string(today(),'yyyy-mm')+'-01'
- em_endday.text=string(today(),'yyyy-mm-dd')
- cb_retrieve.triggerevent(clicked!)
- end event
- event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
- Boolean cb_func_enabled,cb_retrieve_enabled
-
- cb_nextpage_enabled = cb_nextpage.Enabled
- cb_retrieveall_enabled = cb_retrieveall.Enabled
-
- cb_func_enabled = cb_func.Enabled
-
- cb_nextpage.Enabled = FALSE
- cb_retrieveall.Enabled = FALSE
-
- cb_func.Enabled = FALSE
- SetPointer(HourGlass!)
- Int ls_ifshowall
- IF cbx_ifshowall.Checked THEN
- ls_ifshowall = 0
- ELSE
- ls_ifshowall = 1
- END IF
- IF sys_option_scid_msttake_mstpay = 1 THEN
- dw_pageretr.Retrieve(ls_ifshowall,cur_scid_arr,sys_user_spttype,ins_moneyid)
- ELSE
- dw_pageretr.Retrieve(ls_ifshowall,sys_user_spttype,ins_moneyid)
- END IF
- IF dw_pageretr.RowCount() > 0 AND dw_pageretr.GetRow() = 0 THEN dw_pageretr.SetRow(1)
- SetPointer(Arrow!)
- THIS.TriggerEvent('retrieve_pay')
- THIS.TriggerEvent("retrieve_paymx")
- wf_refresh_balc()
-
- cb_nextpage.Enabled = cb_nextpage_enabled
- cb_retrieveall.Enabled = cb_retrieveall_enabled
-
- cb_func.Enabled = cb_func_enabled
- end event
- event ue_before_open;call super::ue_before_open;IF sys_option_scid_msttake_mstpay = 1 THEN
- dw_pageretr.DataObject = 'dw_mstpay_spt_index'
- ELSE
- dw_pageretr.DataObject = 'dw_mstpay_spt_index_not_scid'
- END IF
- dw_pageretr.TriggerEvent(Constructor!)
- em_pagerowno.TriggerEvent(Constructor!)
- dw_mstpay.SetTransObject(sqlca)
- dw_mstpaymx.SetTransObject(sqlca)
- if_ue_retr=true
- if_ue_filter=true
- if_ue_sort=true
- end event
- event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
- ls_newselect = Lower(ori_oldselect)
- //messagebox("",string(sle_usual_query.Text))
- IF Trim(sle_usual_query.Text) <> '' THEN
- IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- ls_querystrpart = "(u_spt.sptcode like '%"+Trim(sle_usual_query.Text)+"%') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%')"
- ELSE
- ls_querystrpart = "(u_spt.sptcode like '"+Trim(sle_usual_query.Text)+"') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%') "
- END IF
-
- IF Pos(ls_newselect," where ") <> 0 and Pos(ls_newselect," group by")<>0 THEN
- ls_newselect = ls_newselect+"having ("+ls_querystrpart+')'
- ELSEIF Pos(ls_newselect," where ") <> 0 THEN
- ls_newselect = ls_newselect+"AND ("+ls_querystrpart+')'
-
- ELSE
- ls_newselect = ls_newselect+"where ("+ls_querystrpart+')'
-
- END IF
- //messagebox("",ls_newselect)
- END IF
- wf_retrieveuc(dw_pageretr,ls_newselect,1)
- THIS.TriggerEvent('retrieve_pageretr')
- end event
- event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
- if trim(sle_usual_query.text)<>'' then
- if pos(trim(sle_usual_query.text),'%')=0 then
- //obj_expr=obj_expr+'( sptcode like "%'+trim(sle_usual_query.text)+'%" )'
- obj_expr=obj_expr+"(u_spt.sptcode like '%"+Trim(sle_usual_query.Text)+"%') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%')"
- else
- //obj_expr=obj_expr+'( sptcode like "'+trim(sle_usual_query.text)+'" )'
- obj_expr=obj_expr+"(u_spt.sptcode like '"+Trim(sle_usual_query.Text)+"') or (u_spt.name like '%"+Trim(sle_usual_query.Text)+"%') "
- end if
- end if
- dw_pageretr.setfilter(obj_expr)
- dw_pageretr.setredraw(false)
- dw_pageretr.filter()
- if dw_pageretr.rowcount()>=1 then
- dw_pageretr.selectrow(0,false)
- dw_pageretr.selectrow(1,true)
- end if
- dw_pageretr.setredraw(true)
- end event
- event user_key;call super::user_key;IF KeyDown(KeyF1!) THEN
- this.TriggerEvent("ue_help")
- end if
- end event
- type cb_func from w_publ_pageretr`cb_func within w_mustpay
- integer x = 151
- integer y = 0
- integer width = 151
- integer height = 164
- end type
- type cb_exit from w_publ_pageretr`cb_exit within w_mustpay
- integer x = 1344
- integer y = 0
- integer width = 151
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type sle_usual_query from w_publ_pageretr`sle_usual_query within w_mustpay
- integer x = 343
- integer y = 192
- integer width = 549
- integer height = 84
- end type
- event sle_usual_query::modified;//messagebox("","123")
- IF retrieve_all or retrmode=0 THEN
- // PARENT.TRIGGEREVENT("ue_usual_query_filt")
- ELSE
- PARENT.TRIGGEREVENT("ue_usual_query_RETR")
- END IF
- end event
- type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_mustpay
- integer x = 1851
- integer width = 142
- integer height = 164
- string normalpicname = "p1.ico"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type em_pagerowno from w_publ_pageretr`em_pagerowno within w_mustpay
- integer x = 1559
- integer y = 44
- integer width = 288
- end type
- type dw_pageretr from w_publ_pageretr`dw_pageretr within w_mustpay
- integer y = 388
- integer width = 1467
- integer height = 1612
- string title = "供应商摘要"
- string dataobject = "dw_mstpay_spt_index"
- end type
- event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;cb_retrieve.triggerevent(clicked!)
- wf_initdisp()
- end event
- event dw_pageretr::clicked;call super::clicked;IF dwo.Name = "ch" THEN
- THIS.SetTabOrder("ch" , 10)
- ELSE
- THIS.SetTabOrder("ch" , 0)
- END IF
- end event
- type st_1 from w_publ_pageretr`st_1 within w_mustpay
- integer x = 18
- integer y = 212
- integer width = 343
- string text = "编号/名称含"
- alignment alignment = center!
- end type
- type cb_nextpage from w_publ_pageretr`cb_nextpage within w_mustpay
- integer x = 1993
- integer width = 64
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type dw_mstpay from u_dw_rbtnfilter within w_mustpay
- integer x = 1472
- integer y = 388
- integer width = 2062
- integer height = 940
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "供应商应付帐"
- string dataobject = "dw_mstpay_index"
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- boolean border = false
- boolean livescroll = false
- borderstyle borderstyle = stylebox!
- boolean rbutton_filter_use = true
- boolean titleclick_sort_use = true
- end type
- event clicked;call super::clicked;IF row > 0 THEN THIS.SetRow(row)
- end event
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- PARENT.TriggerEvent("retrieve_paymx")
- end event
- event rbuttondown;call super::rbuttondown;//String str_clickedobjecttype
- //String column_name,column_text_name
- //Long FindRow, FindPage
- //boolean lb_title = false
- //IF titleclick_sort_use THEN
- // str_clickedobjecttype = Left(dwo.TYPE,4)
- //
- // IF str_clickedobjecttype = 'text' THEN
- // column_text_name = dwo.Name
- //
- // IF Len(column_text_name) >= 3 AND Right(column_text_name,2) = '_t' THEN
- // column_name = Left(column_text_name,Len(column_text_name) - 2)
- // ELSE
- // GOTO cend
- // END IF
- //
- // IF Left(Describe(column_name+'.type'),4) <> 'colu' AND &
- // Left(Describe(column_name+'.type'),4) <> 'comp' THEN
- // RETURN
- // END IF
- // IF curDW_sortstr = column_name+' A ' THEN
- // curDW_sortstr = column_name+' D '
- // ELSE
- // curDW_sortstr = column_name+' A '
- // END IF
- // lb_title = true
- // ELSE
- // curDW_sortstr = ''
- // END IF
- //
- // IF curDW_sortstr <> '' THEN
- // THIS.SetSort(curDW_sortstr)
- // THIS.SetRedraw (FALSE)
- // THIS.Sort()
- // THIS.SetRedraw (TRUE)
- // END IF
- //END IF
- //
- //cend:
- //if lb_title then return
- //IF row > 0 THEN THIS.SetRow(row)
- //
- //arg_ins_xpos = xpos
- //arg_ins_ypos = ypos +50
- //arg_ins_dwname = dwo.Name
- //arg_ins_dwrow = row
- //arg_ins_dwtype = dwo.TYPE
- //String ls_name
- //ls_name = THIS.GetColumnName( )
- //IF row > 0 AND arg_ins_dwtype <> 'datawindow' THEN
- // arg_ins_dwdata = String(dwo.primary[row])
- //END IF
- //
- //
- //m_mstpay m_print
- //m_print = CREATE m_mstpay
- //m_print.m_0.PopMenu(THIS.X + THIS.PointerX() + 50,THIS.Y + THIS.PointerY() + 50)
- end event
- event dwnkey;call super::dwnkey;parent.postevent('user_key')
- end event
- event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_view_bill')
- end event
- event itemchanged;call super::itemchanged;wf_dispamt()
- end event
- type cbx_ifshowall from checkbox within w_mustpay
- integer x = 901
- integer y = 208
- integer width = 608
- 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;parent.triggerevent('retrieve_pageretr')
- end event
- type st_3 from statictext within w_mustpay
- integer x = 2226
- integer y = 292
- integer width = 201
- 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
- boolean enabled = false
- string text = "日期从:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type em_firstday from editmask within w_mustpay
- integer x = 2418
- integer y = 276
- integer width = 384
- integer height = 92
- integer taborder = 110
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- event rbuttondown;s_calender_arg s_calender
- s_calender.PointerX = THIS.PointerX()
- s_calender.PointerY = THIS.PointerY()
- s_calender.X = THIS.X
- s_calender.Y = THIS.Y
- OpenWithParm(w_calendar,s_calender)
- THIS.Text = String(id_date_selected)
- end event
- type st_4 from statictext within w_mustpay
- integer x = 2903
- integer y = 292
- integer width = 105
- 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
- boolean enabled = false
- string text = "到:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type em_endday from editmask within w_mustpay
- integer x = 3008
- integer y = 276
- integer width = 384
- integer height = 92
- integer taborder = 120
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- maskdatatype maskdatatype = datemask!
- string mask = "yyyy-mm-dd"
- boolean spin = true
- end type
- event rbuttondown;s_calender_arg s_calender
- s_calender.PointerX = THIS.PointerX()
- s_calender.PointerY = THIS.PointerY()
- s_calender.X = THIS.X
- s_calender.Y = THIS.Y
- OpenWithParm(w_calendar,s_calender)
- THIS.Text = String(id_date_selected)
- end event
- type cb_retrieve from uo_imflatbutton within w_mustpay
- integer width = 151
- integer height = 164
- integer taborder = 50
- boolean bringtotop = true
- string text = "刷新"
- string normalpicname = "refresh.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('retrieve_pay')
- parent.triggerevent("retrieve_paymx")
- wf_refresh_balc()
- wf_initdisp()
- //wf_dispamt()
- end event
- type cb_2 from uo_imflatbutton within w_mustpay
- integer x = 306
- integer width = 192
- integer height = 164
- integer taborder = 60
- boolean bringtotop = true
- string text = "新建&A"
- string normalpicname = "new.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_add')
- end event
- type cb_3 from uo_imflatbutton within w_mustpay
- integer x = 494
- integer width = 192
- integer height = 164
- integer taborder = 60
- boolean bringtotop = true
- string text = "删除&D"
- string normalpicname = "delete.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_del')
- end event
- type dw_mstpaymx from u_dw_rbtnfilter within w_mustpay
- integer x = 1472
- integer y = 1324
- integer width = 2062
- integer height = 672
- integer taborder = 50
- boolean bringtotop = true
- boolean titlebar = true
- string title = "应付帐明细帐"
- string dataobject = "dw_mstpaymx_index"
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- boolean border = false
- borderstyle borderstyle = stylebox!
- end type
- type ddlb_1 from uo_ddlb_scid within w_mustpay
- integer x = 343
- integer y = 292
- integer width = 549
- integer height = 768
- integer taborder = 40
- boolean bringtotop = true
- end type
- event selectionchanged;call super::selectionchanged;
- cur_scid = THIS.uo_scid
- cur_scid_arr = THIS.uo_scid_arr
- IF sys_option_scid_msttake_mstpay = 1 THEN
- PARENT.TriggerEvent('retrieve_pageretr')
- END IF
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- event constructor;call super::constructor;cur_scid = THIS.uo_scid
- cur_scid_arr = THIS.uo_scid_arr
- this.text='[0]总部'
- end event
- type cb_autofinish from uo_imflatbutton within w_mustpay
- integer x = 1152
- integer width = 192
- integer height = 164
- integer taborder = 50
- boolean bringtotop = true
- string text = "对单&F"
- string normalpicname = "update.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_buybill_auto')
- end event
- type cb_4 from uo_imflatbutton within w_mustpay
- boolean visible = false
- integer x = 1152
- integer width = 192
- integer height = 164
- integer taborder = 30
- boolean bringtotop = true
- string text = "查单据"
- string normalpicname = "find2.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_view_bill')
- end event
- type ddlb_2 from dropdownlistbox within w_mustpay
- integer x = 1714
- integer y = 292
- integer width = 507
- integer height = 284
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "[全部]"
- boolean sorted = false
- string item[] = {"未结清","已结清","[全部]"}
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;IF Index = 1 THEN
- finishflag = 0
- ELSEIF Index = 2 THEN
- finishflag = 1
- ELSEIF Index = 3 THEN
- finishflag = -1
- END IF
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- type cb_reset from uo_imflatbutton within w_mustpay
- boolean visible = false
- integer x = 1344
- integer width = 242
- integer height = 164
- integer taborder = 60
- boolean bringtotop = true
- string text = "支出单&S"
- string normalpicname = "update.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;if not f_power_ind(639) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- if cur_id <= 0 then
- messagebox('提示','请选择供应商',information!,ok!)
- return
- end if
- if cur_scid < 0 then
- messagebox('提示','请选择分部',information!,ok!)
- return
- end if
- s_edit_index_tran s_open_tran
- s_open_tran.b_long=cur_id
- s_open_tran.b_string = ''
- s_open_tran.b_decimal = 0
- s_open_tran.c_long = cur_scid
- openwithparm(w_buybill,s_open_tran)
- wf_refresh_balc()
- parent.triggerevent('retrieve_pay')
- end event
- type st_6 from statictext within w_mustpay
- integer x = 1559
- integer y = 212
- integer width = 133
- integer height = 48
- 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 = "币种"
- alignment alignment = center!
- boolean focusrectangle = false
- end type
- type ddlb_3 from dropdownlistbox within w_mustpay
- integer x = 1714
- integer y = 192
- integer width = 507
- integer height = 380
- integer taborder = 50
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean sorted = false
- borderstyle borderstyle = stylelowered!
- end type
- event constructor;Long ll_moneyid,i
- String ls_name
- DECLARE getmx CURSOR FOR
- SELECT moneyid,Name FROM cw_currency Order By moneyid ;
- OPEN getmx;
- DO WHILE sqlca.SQLCode = 0
- FETCH getmx INTO :ll_moneyid,:ls_name ;
- IF sqlca.SQLCode <> 0 THEN EXIT
- THIS.AddItem(ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']')
- i++
- if i=1 then
- this.text=ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']'
- ins_moneyid=ll_moneyid
- end if
- LOOP
- CLOSE getmx;
- THIS.AddItem('全部'+Fill(' ',50)+'['+String(-1)+']')
- end event
- event selectionchanged; ins_moneyid=Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
- parent.triggerevent('retrieve_pageretr')
- cb_retrieve.triggerevent(clicked!)
- end event
- type st_2 from statictext within w_mustpay
- integer x = 1559
- integer y = 308
- integer width = 133
- integer height = 48
- 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 = "状态"
- alignment alignment = center!
- boolean focusrectangle = false
- end type
- type st_5 from statictext within w_mustpay
- integer x = 210
- integer y = 304
- integer width = 133
- integer height = 48
- 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 = "分部"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type cb_1 from uo_imflatbutton within w_mustpay
- integer x = 878
- integer width = 274
- integer height = 164
- integer taborder = 70
- boolean bringtotop = true
- string text = "辅助功能"
- string normalpicname = "other.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
- String menustr
- menustr = "Text=查单据~tEvent=ue_view_bill"
- menustr = menustr + "|" + "Text=-"
- menustr = menustr + "|" + "Text=对单~tEvent=ue_buybill_auto"
- menustr = menustr + "|" + "Text=自动对单~tEvent=ue_buybill_auto_p"
- menustr = menustr + "|" + "Text=-"
- menustr = menustr + "|" + "Text=辅助建立供应商对数单~tEvent=ue_create_buybill"
- menustr = menustr + "|" + "Text=辅助建立供应商付款单~tEvent=ue_create_sptamt"
- menustr = menustr + "|" + "Text=辅助建立供应商费用单~tEvent=ue_create_reissue_spt"
- IF Len(Trim(menustr)) <> 0 THEN
- dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
- dmPopupMenu.mf_BuildMenu(THIS, menustr)
- dmPopupMenu.mf_PopMenu()
- DESTROY dmPopupMenu
- END IF
- end event
- type cbx_all from checkbox within w_mustpay
- integer y = 300
- integer width = 229
- 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;Long i
- dw_pageretr.SetRedraw(FALSE)
- IF THIS.Checked THEN
- FOR i = 1 TO dw_pageretr.RowCount()
- dw_pageretr.Object.ch[i] = 1
- NEXT
- ELSE
- FOR i = 1 TO dw_pageretr.RowCount()
- dw_pageretr.Object.ch[i] = 0
- NEXT
- END IF
- dw_pageretr.SetRedraw(TRUE)
- end event
- type pb_em1 from picturebutton within w_mustpay
- integer x = 2802
- integer y = 276
- integer width = 101
- integer height = 92
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string picturename = "date.BMP"
- alignment htextalign = left!
- end type
- event clicked;em_firstday.triggerevent(rbuttondown!)
- end event
- type pb_em2 from picturebutton within w_mustpay
- integer x = 3392
- integer y = 276
- integer width = 101
- integer height = 92
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string picturename = "date.BMP"
- alignment htextalign = left!
- end type
- event clicked;em_endday.triggerevent(rbuttondown!)
- end event
- type pb_2 from picturebutton within w_mustpay
- integer x = 3493
- integer y = 276
- integer width = 101
- integer height = 92
- integer taborder = 50
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string picturename = "date1.BMP"
- alignment htextalign = left!
- end type
- event clicked;m_Dfc_Control_PopupMenu dmPopupMenu
- string menustr
- menustr="Text=本日~tEvent=ue_date1"
- menustr = menustr + "|" + "Text=本周~tEvent=ue_date2"
- menustr = menustr + "|" + "Text=本月~tEvent=ue_date3"
- menustr = menustr + "|" + "Text=上月~tEvent=ue_date4"
-
- if len(trim(menustr))<>0 then
- dmPopupMenu = Create m_Dfc_Control_PopupMenu
- dmPopupMenu.mf_BuildMenu(This, menustr)
- dmPopupMenu.mf_PopMenu()
- Destroy dmPopupMenu
- end if
- end event
- type cb_pay from uo_imflatbutton within w_mustpay
- integer x = 690
- integer width = 192
- integer height = 164
- integer taborder = 70
- boolean bringtotop = true
- string text = "付款&A"
- string normalpicname = "audit.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_pay')
- end event
- type st_payamt from statictext within w_mustpay
- integer x = 2674
- integer y = 20
- integer width = 562
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "已付金额:12345678.90"
- boolean focusrectangle = false
- end type
- event constructor;this.backcolor = 14215660
- end event
- type st_mstpayamt from statictext within w_mustpay
- integer x = 2098
- integer y = 20
- integer width = 562
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "应付金额:12345678.90"
- boolean focusrectangle = false
- end type
- event constructor;this.backcolor = 14215660
- end event
- type st_balcamt from statictext within w_mustpay
- integer x = 2103
- integer y = 96
- integer width = 869
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "结余金额:12345678.90"
- boolean focusrectangle = false
- end type
- event constructor;this.backcolor = 14215660
- end event
- type ln_bar from line within w_mustpay
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 176
- integer endx = 3429
- integer endy = 176
- end type
- type ln_bar2 from line within w_mustpay
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 180
- integer endx = 3429
- integer endy = 180
- end type
- type r_bar from rectangle within w_mustpay
- long linecolor = 16777215
- long fillcolor = 1073741824
- integer x = 3200
- integer width = 73
- integer height = 172
- end type
- event constructor;this.fillcolor = 14215660
- this.linecolor = 14215660
- this.x = -1
- this.y = -1
- this.height = ln_bar2.beginy - 5
- end event
- type ln_1 from line within w_mustpay
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 380
- integer endx = 3429
- integer endy = 380
- end type
- type ln_2 from line within w_mustpay
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 380
- integer endx = 3429
- integer endy = 380
- end type
- type ln_5 from line within w_mustpay
- long linecolor = 268435456
- integer beginx = 1522
- integer endx = 1522
- integer endy = 176
- end type
- type ln_6 from line within w_mustpay
- long linecolor = 16777215
- integer beginx = 1527
- integer endx = 1527
- integer endy = 180
- end type
- type ln_3 from line within w_mustpay
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = 1527
- integer beginy = 176
- integer endx = 1527
- integer endy = 380
- end type
- type ln_4 from line within w_mustpay
- long linecolor = 268435456
- integer linethickness = 4
- integer beginx = 1522
- integer beginy = 176
- integer endx = 1522
- integer endy = 380
- end type
- type st_amtdisp from statictext within w_mustpay
- integer x = 2085
- integer y = 12
- integer width = 1157
- integer height = 160
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean border = true
- boolean focusrectangle = false
- end type
- event constructor;this.backcolor = 14215660
- end event
- type cbx_1 from checkbox within w_mustpay
- integer x = 2240
- integer y = 204
- integer width = 229
- 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;Long i
- dw_mstpay.SetRedraw(FALSE)
- IF THIS.Checked THEN
- FOR i = 1 TO dw_mstpay.RowCount()
- IF dw_mstpay.Object.finishflag[i]=0 then
- dw_mstpay.Object.checkdata[i] = 1
- end if
- NEXT
- ELSE
- FOR i = 1 TO dw_mstpay.RowCount()
- dw_mstpay.Object.checkdata[i] = 0
- NEXT
- END IF
- dw_mstpay.SetRedraw(TRUE)
- end event
|