1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368 |
- $PBExportHeader$w_musttake.srw
- forward
- global type w_musttake from w_publ_pageretr
- end type
- type dw_msttake from u_dw_rbtnfilter within w_musttake
- end type
- type cbx_ifshowall from checkbox within w_musttake
- end type
- type st_3 from statictext within w_musttake
- end type
- type em_firstday from editmask within w_musttake
- end type
- type st_4 from statictext within w_musttake
- end type
- type em_endday from editmask within w_musttake
- end type
- type cb_retrieve from uo_imflatbutton within w_musttake
- end type
- type cb_add from uo_imflatbutton within w_musttake
- end type
- type cb_delete from uo_imflatbutton within w_musttake
- end type
- type dw_msttakemx from u_dw_rbtnfilter within w_musttake
- end type
- type ddlb_1 from uo_ddlb_scid within w_musttake
- end type
- type cb_1 from uo_imflatbutton within w_musttake
- end type
- type cb_4 from uo_imflatbutton within w_musttake
- end type
- type ddlb_2 from dropdownlistbox within w_musttake
- end type
- type ln_bar from line within w_musttake
- end type
- type ln_bar2 from line within w_musttake
- end type
- type r_bar from rectangle within w_musttake
- end type
- type ln_1 from line within w_musttake
- end type
- type ln_2 from line within w_musttake
- end type
- type ln_5 from line within w_musttake
- end type
- type ln_6 from line within w_musttake
- end type
- type st_amtdisp from statictext within w_musttake
- end type
- type st_msttakeamt from statictext within w_musttake
- end type
- type st_takeamt from statictext within w_musttake
- end type
- type st_balcamt from statictext within w_musttake
- end type
- type cb_salebill from uo_imflatbutton within w_musttake
- end type
- type ddlb_3 from dropdownlistbox within w_musttake
- end type
- type st_2 from statictext within w_musttake
- end type
- type st_5 from statictext within w_musttake
- end type
- type st_6 from statictext within w_musttake
- end type
- type cbx_ifuse from checkbox within w_musttake
- end type
- type cb_3 from uo_imflatbutton within w_musttake
- end type
- type cbx_all from checkbox within w_musttake
- end type
- type pb_em1 from picturebutton within w_musttake
- end type
- type pb_em2 from picturebutton within w_musttake
- end type
- type pb_2 from picturebutton within w_musttake
- end type
- type cb_take from uo_imflatbutton within w_musttake
- end type
- type cbx_1 from checkbox within w_musttake
- end type
- type ln_3 from line within w_musttake
- end type
- type ln_4 from line within w_musttake
- end type
- end forward
- global type w_musttake from w_publ_pageretr
- integer width = 3621
- integer height = 2444
- 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_take ( )
- event ue_salebill_auto ( )
- event ue_rbbutton ( )
- event ue_dwchild_filter ( )
- event ue_create_salebill ( )
- event ue_create_cusamt ( )
- event ue_create_reissue ( )
- event ue_salebill_auto_p ( )
- event ue_date1 ( )
- event ue_date2 ( )
- event ue_date3 ( )
- event ue_date4 ( )
- dw_msttake dw_msttake
- 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_add cb_add
- cb_delete cb_delete
- dw_msttakemx dw_msttakemx
- ddlb_1 ddlb_1
- cb_1 cb_1
- cb_4 cb_4
- ddlb_2 ddlb_2
- 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
- st_amtdisp st_amtdisp
- st_msttakeamt st_msttakeamt
- st_takeamt st_takeamt
- st_balcamt st_balcamt
- cb_salebill cb_salebill
- ddlb_3 ddlb_3
- st_2 st_2
- st_5 st_5
- st_6 st_6
- cbx_ifuse cbx_ifuse
- cb_3 cb_3
- cbx_all cbx_all
- pb_em1 pb_em1
- pb_em2 pb_em2
- pb_2 pb_2
- cb_take cb_take
- cbx_1 cbx_1
- ln_3 ln_3
- ln_4 ln_4
- end type
- global w_musttake w_musttake
- type variables
- uo_musttake uo_take
- Long cur_id,cur_takeid
- Long cur_scid = 0
- long cur_moneyid=0
- Long cur_scid_arr[]
- dec ins_msttakeamt=0
- dec ins_takeamt=0
- Int finishflag = -1
- long ins_moneyid = -1
- end variables
- forward prototypes
- public subroutine wf_refresh_balc ()
- public function integer wf_dispamt ()
- public subroutine wf_initdisp ()
- public function integer days_in_month (integer month, integer year)
- end prototypes
- event retrieve_pay();Long row,uc_relid,uc_moneyid,uc_scid
- String ls_cusname,ls_name
- DateTime firstdate,enddate
- row = dw_pageretr.GetRow()
- IF row > 0 THEN
- uc_relid = dw_pageretr.Object.cusid[row]
- uc_moneyid = dw_pageretr.Object.v_cus_balcamt_moneyid[row]
-
- IF sys_option_scid_msttake_mstpay = 1 THEN
- uc_scid = dw_pageretr.Object.v_cus_balcamt_scid[row]
- ELSE
- uc_scid = cur_scid
- END IF
-
- ls_cusname = dw_pageretr.Object.Name[row]
- ls_name = dw_pageretr.Object.cw_currency_name[row]
- dw_msttake.Title = ls_cusname+','+ls_name+'-应收帐(已结清明细不能选择)'
- dw_msttakemx.Title = ls_cusname+','+ls_name+'-应收帐明细'
-
- firstdate = DateTime(Date(em_firstday.Text),Time('00:00:00'))
- enddate = DateTime(Date(em_endday.Text),Time('23:59:59'))
-
- dw_msttake.SetRedraw (FALSE)
- dw_msttake.Retrieve(uc_scid,uc_relid,firstdate,enddate,finishflag,uc_moneyid)
- IF dw_msttake.RowCount() > 0 THEN
- dw_msttake.SelectRow(0,FALSE)
- dw_msttake.ScrollToRow(1)
- dw_msttake.SelectRow(1,TRUE)
- END IF
- dw_msttake.SetRedraw (TRUE)
- ELSE
- dw_msttake.Reset()
- END IF
- cur_id = uc_relid
- cur_moneyid = uc_moneyid
- end event
- event retrieve_paymx();long row,uc_relid=0
- row=dw_msttake.getrow()
- if row>0 then
- uc_relid=dw_msttake.object.takeid[row]
-
- dw_msttakemx.SetRedraw (false)
- dw_msttakemx.retrieve(uc_relid)
- dw_msttakemx.SetRedraw (true)
- else
- dw_msttakemx.reset()
- end if
- cur_takeid=uc_relid
- end event
- event ue_add();IF Not f_power_ind(132) 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_musttake_mod,s_open_tran)
- wf_refresh_balc()
- This.TriggerEvent('retrieve_pay')
- end event
- event ue_del();IF NOT f_power_ind(132) THEN
- MessageBox('提示','你没有使用权限!',information!,ok!)
- RETURN
- END IF
- Long takeid,lirow
- String arg_msg
- lirow = dw_msttake.GetRow()
- IF lirow = 0 THEN
- MessageBox('提示','请选定要删除的应收帐',information!,ok!)
- RETURN
- END IF
- IF MessageBox ("询问","是否确定要删除当前应收帐记录?",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- //IF dw_msttake.Object.finishflag[lirow] = 1 THEN
- // MessageBox('提示','选定的应收帐已结清,不能删除',information!,ok!)
- // RETURN
- //END IF
- takeid = dw_msttake.Object.takeid[lirow]
- IF uo_take.del_takerec (cur_scid,0,takeid, 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 = takeid
- ls_curid = cur_id
- ls_code = dw_msttake.Object.billcode[lirow]
- ls_opemp = dw_msttake.Object.opemp[lirow]
- f_setsysoplog('应收帐','应收帐删除,ID:'+String(ls_id)+',客户ID:'+String(ls_curid)+',code:'+ls_code+',建立人:'+ls_opemp,arg_msg,TRUE)
- //--
- dw_msttake.DeleteRow(lirow)
- dw_msttake.TriggerEvent(RowFocusChanged!)
- wf_refresh_balc()
- THIS.TriggerEvent('retrieve_pay')
- MessageBox('提示','删除应收帐操作成功!',information!,ok!)
- end event
- event ue_view_bill();Long row
-
- row = dw_msttake.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_msttake.Object.u_bmsttake_scid[row]
- ls_code = dw_msttake.Object.billcode[row]
- // ld_mstamt = dw_msttake.Object.msttakeamt[row]
- li_buildtype = dw_msttake.Object.buildtype[row]
-
- IF li_buildtype = 0 THEN RETURN
-
- f_open_win(ll_scid,ls_code)
-
-
- END IF
- end event
- event ue_take();if not f_power_ind(132) then
- messagebox('提示','你没有使用权限!',information!,ok!)
- return
- end if
- if cur_id <= 0 then
- messagebox('提示','请选择客户',information!,ok!)
- return
- end if
- long ll_row
- ll_row = dw_msttake.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_msttake.object.billcode[ll_row]
- s_open_tran.b_decimal = dw_msttake.object.balcamt[ll_row]
- s_open_tran.d_long=cur_moneyid
- openwithparm(w_musttake_mod,s_open_tran)
- wf_refresh_balc()
- this.triggerevent('retrieve_pay')
- end event
- event ue_salebill_auto();Long ll_rowcount
- Long ll_banktypeid
- DateTime ld_mxtakedate
- long ll_takeid
- Int j
- ld_mxtakedate = DateTime(Today(),Time(0))
- dw_msttake.AcceptText()
- ll_rowcount = dw_msttake.RowCount()
- IF ll_rowcount <= 0 THEN RETURN
- datastore ds_msttakemx
- ds_msttakemx = CREATE datastore
- ds_msttakemx.DataObject = "dw_salebillmx_index"
- ds_msttakemx.SetTransObject(sqlca)
- ds_msttakemx.Retrieve(0.1)
- //IF ds_msttakemx.RowCount() > 0 THEN
- // FOR j = 1 TO ds_msttakemx.RowCount()
- // ds_msttakemx.DeleteRow(j)
- // NEXT
- //END IF
- ds_msttakemx.AcceptText()
- Int i
- Long ll_row
- Long ll_takeamtcount
- FOR i = 1 TO ll_rowcount
-
- IF dw_msttake.Object.checkdata[i] = 0 THEN
- CONTINUE;
- END IF
-
- IF dw_msttake.Object.balcamt[i] < 0 And (dw_msttake.Object.takeamt[i] > 0 OR dw_msttake.Object.msttakeamt[i] < 0 ) THEN
- ll_takeamtcount++
- ld_mxtakedate = dw_msttake.Object.takedate[i]
- ll_banktypeid = dw_msttake.Object.u_bmsttake_banktypeid[i]
- END IF
-
-
- // IF ll_takeamtcount > 1 THEN
- // MessageBox('提示','预收款或已收款限制只能有一条',information!,ok!)
- // RETURN
- // END IF
-
- ll_row = ds_msttakemx.InsertRow(0)
- ds_msttakemx.Object.billcode[ll_row] = dw_msttake.Object.billcode[i]
- ds_msttakemx.Object.takedate[ll_row] = dw_msttake.Object.takedate[i]
- ds_msttakemx.Object.oriamt[ll_row] = dw_msttake.Object.oriamt[i]
- ds_msttakemx.Object.mainmsttakeamt[ll_row] = dw_msttake.Object.msttakeamt[i]
- ds_msttakemx.Object.maintakeamt[ll_row] = dw_msttake.Object.takeamt[i]
- ds_msttakemx.Object.takeid[ll_row] = dw_msttake.Object.takeid[i]
-
- NEXT
- ds_msttakemx.AcceptText()
- //生成相关号
- Long ll_take_i
- String ls_take_i_billcode,ls_not_take_i_billcode
- FOR i = 1 TO ds_msttakemx.RowCount()
- IF ds_msttakemx.Object.mainmsttakeamt[i] = 0 AND ds_msttakemx.Object.maintakeamt[i] <> 0 THEN
- ll_take_i = i
- ls_take_i_billcode = ds_msttakemx.Object.billcode[i]
- ELSE
- ls_not_take_i_billcode = ls_not_take_i_billcode + Trim(ds_msttakemx.Object.billcode[i])+','
- END IF
- NEXT
- ls_not_take_i_billcode = Left(ls_not_take_i_billcode,Len(ls_not_take_i_billcode) - 1 )
- ls_not_take_i_billcode = Left(ls_not_take_i_billcode, 255)
- FOR i = 1 TO ds_msttakemx.RowCount()
- IF i = ll_take_i THEN
- ds_msttakemx.Object.relbillcode[i] = ls_not_take_i_billcode
- ELSE
- ds_msttakemx.Object.relbillcode[i] = ls_take_i_billcode
- END IF
- NEXT
- //
- //第一次
- Decimal msttakeamt = 0,takeamt = 0
- FOR i = 1 TO ds_msttakemx.RowCount()
- IF msttakeamt > 0 THEN
- IF ds_msttakemx.Object.mainmsttakeamt[i] <= msttakeamt THEN
- ds_msttakemx.Object.msttakeamt[i] = ds_msttakemx.Object.mainmsttakeamt[i]
- msttakeamt = msttakeamt - ds_msttakemx.Object.mainmsttakeamt[i]
- ELSE
- ds_msttakemx.Object.msttakeamt[i] = msttakeamt
- msttakeamt = 0
- END IF
- END IF
-
- takeamt = takeamt - (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
-
- ds_msttakemx.Object.takeamt[i] = (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
- // dec ld
- // ld=ds_msttakemx.Object.takeamt[i]
- NEXT
- ds_msttakemx.AcceptText()
- //第二次循环:根据可分配判断正负,修正相关结余(正-负、负-正)
- IF takeamt < 0 THEN //不够分配 ds_msttakemx.Object.takeamt[i] 相当于单据金额变化
- FOR i = ds_msttakemx.RowCount() TO 1 STEP - 1
- If (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i]) <= 0 THEN CONTINUE
-
- IF ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i] + takeamt < 0 THEN
- ds_msttakemx.Object.takeamt[i] = 0
- takeamt = takeamt + (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
- ELSE
- ds_msttakemx.Object.takeamt[i] = takeamt + (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
- takeamt = 0
- END IF
- NEXT
- ELSE // 分配有剩
-
- FOR i = ds_msttakemx.RowCount() TO 1 STEP - 1
- If (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i]) >= 0 THEN CONTINUE //or ds_msttakemx.Object.maintakeamt[i]=0
- //if ds_msttakemx.Object.u_bmsttake_takeamt[i]=0 then continue
-
- IF ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i] + takeamt > 0 THEN
- ds_msttakemx.Object.takeamt[i] =0
- takeamt = takeamt + (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
- //ds_msttakemx.Object.takeamt[i] = takeamt// + (ds_msttakemx.Object.u_bmsttake_msttakeamt[i] - ds_msttakemx.Object.u_bmsttake_takeamt[i])
- ELSE
- ds_msttakemx.Object.takeamt[i] = takeamt + (ds_msttakemx.Object.mainmsttakeamt[i] - ds_msttakemx.Object.maintakeamt[i])
- takeamt = 0
- // ld=ds_msttakemx.Object.takeamt[i]
- END IF
- NEXT
- END IF
- ds_msttakemx.AcceptText()
- uo_salebill uo_bill
- uo_bill = CREATE uo_salebill
- String arg_msg = ''
- IF uo_bill.newbegin() = 0 THEN
- MessageBox('错误',arg_msg,stopsign!,ok!)
- RETURN
- END IF
- uo_bill.opemp = publ_operator
- uo_bill.takedate = ld_mxtakedate
- uo_bill.relcode = ''
- uo_bill.inrep = publ_operator
- uo_bill.banktypeid = ll_banktypeid
- uo_bill.dscrp = ''
- uo_bill.cusid = cur_id
- uo_bill.msttakeamt = 0
- uo_bill.takeamt = 0
- uo_bill.accountsid = 0
- uo_bill.itemid = 0
- uo_bill.buildtype = 1
- uo_bill.moneyid = ins_moneyid
- FOR i = 1 TO ds_msttakemx.RowCount()
- IF ds_msttakemx.Object.mainmsttakeamt[i] <> 0 OR ds_msttakemx.Object.maintakeamt[i] <> 0 THEN
- IF uo_bill.acceptmx(ds_msttakemx.Object.takeid[i],&
- ds_msttakemx.Object.billcode[i],&
- ds_msttakemx.Object.msttakeamt[i],&
- ds_msttakemx.Object.takeamt[i],&
- ds_msttakemx.Object.oriamt[i],&
- ds_msttakemx.Object.mainmsttakeamt[i],&
- ds_msttakemx.Object.maintakeamt[i],&
- ds_msttakemx.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
- ELSE
- FOR I = 1 TO ds_msttakemx.RowCount() //直接更新 应收账的销售单的预收款日期
- If ds_msttakemx.Object.maintakeamt[i] > 0 THEN CONTINUE
- ll_takeid = ds_msttakemx.Object.takeid[I]
- UPDATE u_bmsttake
- SET viewdate = :ld_mxtakedate
- Where takeid = :ll_takeid;
- IF sqlca.SQLCode <> 0 THEN
- ROLLBACK;
- messagebox('错误','更新预计收款日期失败')
- RETURN
- ELSE
- COMMIT;
- END IF
- NEXT
- END IF
- IF sys_option_musttake_auditing = 1 THEN
- IF uo_bill.auditing(uo_bill.salebillid,publ_operator,arg_msg,TRUE)=0 THEN
- messagebox('错误',arg_msg,stopsign!,ok!)
- RETURN
- END IF
- END IF
- MessageBox('提示','自动生成销售收入单成功,单据编号为'+uo_bill.salebillcode,information!,ok!)
- DESTROY uo_bill
- cb_retrieve.TriggerEvent(Clicked!)
- RETURN
- //dw_msttake
- end event
- event ue_rbbutton();dw_msttake.event rbbutton( dw_msttake.arg_ins_dwtype,dw_msttake.arg_ins_dwname,dw_msttake.arg_ins_dwdata,dw_msttake.arg_ins_dwrow )
- end event
- event ue_dwchild_filter();dw_msttake.setfilter('')
- dw_msttake.filter()
- end event
- event ue_create_salebill();//辅助建立客户对数单
- if not f_power_ind(640) 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_salebill_response,s_open_tran)
- wf_refresh_balc()
- this.triggerevent('retrieve_pay')
- end event
- event ue_create_cusamt();//辅助建立客户收款单
- IF Not f_power_ind(919) 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_cusamt_edit_response,s_open_tran)
- wf_refresh_balc()
- This.TriggerEvent('retrieve_pay')
- end event
- event ue_create_reissue();//辅助建立客户费用单
- IF Not f_power_ind(1020) 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_response,s_open_tran)
- wf_refresh_balc()
- This.TriggerEvent('retrieve_pay')
- end event
- event ue_salebill_auto_p();IF Not f_power_ind(1545) THEN
- MessageBox(publ_operator,"你没有权限")
- RETURN
- END IF
- IF MessageBox('确认','是否对当前选择客户自动对单?',question!,yesno!) = 2 THEN RETURN
- Long ll_i,ll_j,ll_k, row, i, j
- Long ll_row, ll_printid
- String arg_msg = ''
- String arg_msg_auditing = ''
- Long uc_scid,uc_moneyid,uc_cusid
- DateTime enddate
- Decimal ld_takeamt
- //Decimal msttakeamt = 0,takeamt = 0
- Long ll_take_i
- String ls_take_i_billcode,ls_not_take_i_billcode
- Long ll_banktypeid
- DateTime ldt_mstakedate
- String ls_mxdscrp
- Long ll_accountsid, ll_itemid
- String arg_msg_all = ''
- String ls_cusname
- Decimal lde_msttakeamt_tolbill, lde_takeamt_tolbill, lde_takeamt_mx
- uo_salebill uo_bill
- uo_bill = Create uo_salebill
- datastore ds_take,ds_msttake
- ds_take = Create datastore
- ds_take.DataObject = 'ds_msttake_index_autobill'
- ds_take.SetTransObject(sqlca)
- ds_msttake = Create datastore
- ds_msttake.DataObject = 'ds_msttake_index_autobill_mst'
- ds_msttake.SetTransObject(sqlca)
- datastore ds_msttakemx
- ds_msttakemx = Create datastore
- ds_msttakemx.DataObject = "dw_salebillmx_index"
- 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_cusid = dw_pageretr.Object.cusid[ll_i]
- uc_moneyid = dw_pageretr.Object.v_cus_balcamt_moneyid[ll_i]
- ls_cusname = dw_pageretr.Object.Name[ll_i]
-
- IF sys_option_scid_msttake_mstpay = 1 THEN
- uc_scid = dw_pageretr.Object.v_cus_balcamt_scid[ll_i]
- ELSE
- uc_scid = cur_scid
- END IF
-
- ds_take.Retrieve(uc_scid,uc_cusid,enddate,uc_moneyid)
-
- ll_row = 0
-
- j = 0
- FOR ll_j = 1 To ds_take.RowCount()
- IF ds_take.Object.takeamt[ll_j] - ds_take.Object.msttakeamt[ll_j] = 0 THEN CONTINUE
-
- ls_take_i_billcode = ''
- ls_not_take_i_billcode = ''
-
- lde_msttakeamt_tolbill = 0
- lde_takeamt_tolbill = 0
- //ld_takeamt = 0
- //本次已收款
- ld_takeamt = ds_take.Object.takeamt[ll_j] - ds_take.Object.msttakeamt[ll_j]
-
- ldt_mstakedate = ds_take.Object.takedate[ll_j]
- ll_banktypeid = ds_take.Object.u_bmsttake_banktypeid[ll_j]
- ls_mxdscrp = ds_take.Object.dscrp[ll_j]
- ll_accountsid = ds_take.Object.u_bmsttake_accountsid[ll_j]
- ll_itemid = ds_take.Object.u_bmsttake_itemid[ll_j]
- // IF ds_take.Object.buildtype[ll_j] = 1 THEN //只有手动生成才建订单收款单
- // lb_newtaskdamt = False
- // ELSE
- // lb_newtaskdamt = True
- // END IF
-
- ls_take_i_billcode = ds_take.Object.billcode[ll_j]
-
- ds_msttakemx.Reset()
-
- ll_row = ds_msttakemx.InsertRow(0)
- ll_take_i = ll_row
- ds_msttakemx.Object.billcode[ll_row] = ds_take.Object.billcode[ll_j]
- ds_msttakemx.Object.takedate[ll_row] = ds_take.Object.takedate[ll_j]
- ds_msttakemx.Object.oriamt[ll_row] = ds_take.Object.oriamt[ll_j]
- ds_msttakemx.Object.mainmsttakeamt[ll_row] = ds_take.Object.msttakeamt[ll_j]
- ds_msttakemx.Object.maintakeamt[ll_row] = ds_take.Object.takeamt[ll_j]
- ds_msttakemx.Object.takeid[ll_row] = ds_take.Object.takeid[ll_j]
- // ds_msttakemx.Object.moneyid[ll_row] = ds_take.Object.u_bmsttake_moneyid[ll_j]
-
-
- ds_msttake.Retrieve(uc_scid,uc_cusid,enddate,uc_moneyid)
-
-
- FOR ll_k = 1 To ds_msttake.RowCount()
- IF ld_takeamt <= 0 THEN EXIT
- IF ds_msttake.Object.msttakeamt[ll_k] - ds_msttake.Object.takeamt[ll_k] <= 0 THEN CONTINUE
-
- IF ld_takeamt > ds_msttake.Object.msttakeamt[ll_k] - ds_msttake.Object.takeamt[ll_k] THEN
- lde_takeamt_mx = ds_msttake.Object.msttakeamt[ll_k] - ds_msttake.Object.takeamt[ll_k]
- ld_takeamt = ld_takeamt - lde_takeamt_mx
- ELSE
- lde_takeamt_mx = ld_takeamt
- ld_takeamt = 0
- END IF
-
- ll_row = ds_msttakemx.InsertRow(0)
- ds_msttakemx.Object.billcode[ll_row] = ds_msttake.Object.billcode[ll_k]
- ds_msttakemx.Object.takedate[ll_row] = ds_msttake.Object.takedate[ll_k]
- ds_msttakemx.Object.oriamt[ll_row] = ds_msttake.Object.oriamt[ll_k]
- ds_msttakemx.Object.mainmsttakeamt[ll_row] = ds_msttake.Object.msttakeamt[ll_k]
- ds_msttakemx.Object.maintakeamt[ll_row] = ds_msttake.Object.takeamt[ll_k]
- ds_msttakemx.Object.takeid[ll_row] = ds_msttake.Object.takeid[ll_k]
- // ds_msttakemx.Object.moneyid[ll_row] = ds_msttake.Object.u_bmsttake_moneyid[ll_k]
-
- ds_msttakemx.Object.msttakeamt[ll_row] = 0
- //明细分配已收
- ds_msttakemx.Object.takeamt[ll_row] = lde_takeamt_mx
-
- ls_not_take_i_billcode += ds_msttake.Object.billcode[ll_k] + ','
- lde_takeamt_tolbill += lde_takeamt_mx
- NEXT
-
- //总分配已收
- lde_msttakeamt_tolbill = ds_msttakemx.Object.maintakeamt[ll_take_i] - ds_msttakemx.Object.mainmsttakeamt[ll_take_i] - ld_takeamt
- ds_msttakemx.Object.takeamt[ll_take_i] = 0 - lde_msttakeamt_tolbill
-
- ls_not_take_i_billcode = Left(ls_not_take_i_billcode,Len(ls_not_take_i_billcode) - 1 )
-
- ls_not_take_i_billcode = Left(ls_not_take_i_billcode,250)
- ls_take_i_billcode = Left(ls_take_i_billcode,250)
-
- FOR i = 1 To ds_msttakemx.RowCount()
- IF i = ll_take_i THEN
- ds_msttakemx.Object.relbillcode[i] = ls_not_take_i_billcode
- // lde_msttakeamt_tolbill = ds_msttakemx.Object.msttakeamt[i] - ds_msttakemx.Object.takeamt[i]
- ELSE
- ds_msttakemx.Object.relbillcode[i] = ls_take_i_billcode
- // lde_takeamt_tolbill = ds_msttakemx.Object.msttakeamt[i] - ds_msttakemx.Object.takeamt[i]
- END IF
- NEXT
-
- ds_msttakemx.AcceptText()
-
-
- IF uo_bill.newbegin() = 0 THEN
- arg_msg_all = arg_msg_all + '客户:'+ls_cusname+'对数失败,' +'~r~n'
- GOTO _next_cust
- END IF
-
- uo_bill.opemp = publ_operator
- uo_bill.takedate = ldt_mstakedate
- uo_bill.relcode = ''
- uo_bill.inrep = publ_operator
- uo_bill.banktypeid = ll_banktypeid
- uo_bill.dscrp = ''
- uo_bill.cusid = uc_cusid
- uo_bill.msttakeamt = lde_msttakeamt_tolbill
- uo_bill.takeamt = lde_takeamt_tolbill
- uo_bill.accountsid = ll_accountsid
- uo_bill.itemid = ll_itemid
- uo_bill.buildtype = 1
- uo_bill.moneyid = uc_moneyid
- //
-
- ll_printid = 0
- FOR i = 1 To ds_msttakemx.RowCount()
- IF ds_msttakemx.Object.msttakeamt[i] <> 0 Or ds_msttakemx.Object.takeamt[i] <> 0 THEN
- ll_printid++
- IF uo_bill.acceptmx(ds_msttakemx.Object.takeid[i],&
- ds_msttakemx.Object.billcode[i],&
- ds_msttakemx.Object.msttakeamt[i],&
- ds_msttakemx.Object.takeamt[i],&
- ds_msttakemx.Object.oriamt[i],&
- ds_msttakemx.Object.msttakeamt[i],&
- ds_msttakemx.Object.takeamt[i],&
- ds_msttakemx.Object.relbillcode[i],&
- arg_msg) = 0 THEN
- arg_msg_all = arg_msg_all + '客户:'+ls_cusname+'对数失败,'+arg_msg +'~r~n'
- GOTO _next_cust
- END IF
- END IF
- NEXT
-
- IF ll_printid > 0 THEN
- IF uo_bill.save_ds(arg_msg,True) = 0 THEN
- arg_msg_all = arg_msg_all + '客户:'+ls_cusname+'对数失败,'+arg_msg +'~r~n'
- GOTO _next_cust
- END IF
-
- IF sys_option_musttake_auditing = 1 then
- IF uo_bill.auditing(uo_bill.salebillid,publ_operator,arg_msg,true)=0 then
- arg_msg_all = arg_msg_all + '客户:'+ls_cusname+'审核失败,'+arg_msg +'~r~n'
- GOTO _next_cust
- END IF
- END IF
- END IF
- //COMMIT;
-
- //已收款没有被对完,即代表没有应收款再对,跳出功能.
- IF ld_takeamt > 0 THEN EXIT
- NEXT
-
- _next_cust:
- NEXT
- Destroy uo_bill
- Destroy ds_take
- Destroy ds_msttake
- 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 li_id,ll_moneyid,ll_scid
- Decimal li_new_balc
- dw_pageretr.accepttext()
- li_row = dw_pageretr.GetRow()
- IF li_row <= 0 THEN RETURN
- li_id = dw_pageretr.Object.cusid[li_row]
- ll_moneyid = dw_pageretr.Object.v_cus_balcamt_moneyid[li_row]
- IF sys_option_scid_msttake_mstpay = 1 THEN
- ll_scid = dw_pageretr.Object.v_cus_balcamt_scid[li_row]
- ELSE
- ll_scid = -1
- END IF
- SELECT sum(v_cus_balcamt.cus_balcamt)
- INTO :li_new_balc
- FROM v_cus_balcamt
- WHERE ( v_cus_balcamt.cusid = :li_id )
- And ( v_cus_balcamt.moneyid = :ll_moneyid )
- And ( v_cus_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_cus_balcamt_cus_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 wf_dispamt ();Int rslt = 0
- Long row
- dw_msttake.AcceptText()
- row = dw_msttake.GetRow()
- IF row > 0 And dw_msttake.GetColumnName( ) = 'checkdata' THEN
- IF dw_msttake.Object.checkdata[row] = 0 THEN
- ins_msttakeamt = ins_msttakeamt+dw_msttake.Object.msttakeamt[row]
- ins_takeamt = ins_takeamt+dw_msttake.Object.takeamt[row]
- ELSE
- ins_msttakeamt = ins_msttakeamt - dw_msttake.Object.msttakeamt[row]
- ins_takeamt = ins_takeamt - dw_msttake.Object.takeamt[row]
- END IF
- st_msttakeamt.Text = '应收金额:'+String(ins_msttakeamt,'####0.##')
- st_takeamt.Text = '已收金额:'+String(ins_takeamt,'####0.##')
- st_balcamt.Text = '结余金额:'+String(ins_msttakeamt - ins_takeamt,'####0.##')
- IF ins_msttakeamt > ins_takeamt 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_msttakeamt = 0
- ins_takeamt = 0
- st_msttakeamt.Text = '应收金额:0'
- st_takeamt.Text = '已收金额:0'
- st_balcamt.Text = '结余金额:0'
- 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
- on w_musttake.create
- int iCurrent
- call super::create
- this.dw_msttake=create dw_msttake
- 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_add=create cb_add
- this.cb_delete=create cb_delete
- this.dw_msttakemx=create dw_msttakemx
- this.ddlb_1=create ddlb_1
- this.cb_1=create cb_1
- this.cb_4=create cb_4
- this.ddlb_2=create ddlb_2
- 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.st_amtdisp=create st_amtdisp
- this.st_msttakeamt=create st_msttakeamt
- this.st_takeamt=create st_takeamt
- this.st_balcamt=create st_balcamt
- this.cb_salebill=create cb_salebill
- this.ddlb_3=create ddlb_3
- this.st_2=create st_2
- this.st_5=create st_5
- this.st_6=create st_6
- this.cbx_ifuse=create cbx_ifuse
- this.cb_3=create cb_3
- 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_take=create cb_take
- this.cbx_1=create cbx_1
- this.ln_3=create ln_3
- this.ln_4=create ln_4
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_msttake
- 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_add
- this.Control[iCurrent+9]=this.cb_delete
- this.Control[iCurrent+10]=this.dw_msttakemx
- this.Control[iCurrent+11]=this.ddlb_1
- this.Control[iCurrent+12]=this.cb_1
- this.Control[iCurrent+13]=this.cb_4
- this.Control[iCurrent+14]=this.ddlb_2
- this.Control[iCurrent+15]=this.ln_bar
- this.Control[iCurrent+16]=this.ln_bar2
- this.Control[iCurrent+17]=this.r_bar
- this.Control[iCurrent+18]=this.ln_1
- this.Control[iCurrent+19]=this.ln_2
- this.Control[iCurrent+20]=this.ln_5
- this.Control[iCurrent+21]=this.ln_6
- this.Control[iCurrent+22]=this.st_amtdisp
- this.Control[iCurrent+23]=this.st_msttakeamt
- this.Control[iCurrent+24]=this.st_takeamt
- this.Control[iCurrent+25]=this.st_balcamt
- this.Control[iCurrent+26]=this.cb_salebill
- this.Control[iCurrent+27]=this.ddlb_3
- this.Control[iCurrent+28]=this.st_2
- this.Control[iCurrent+29]=this.st_5
- this.Control[iCurrent+30]=this.st_6
- this.Control[iCurrent+31]=this.cbx_ifuse
- this.Control[iCurrent+32]=this.cb_3
- this.Control[iCurrent+33]=this.cbx_all
- this.Control[iCurrent+34]=this.pb_em1
- this.Control[iCurrent+35]=this.pb_em2
- this.Control[iCurrent+36]=this.pb_2
- this.Control[iCurrent+37]=this.cb_take
- this.Control[iCurrent+38]=this.cbx_1
- this.Control[iCurrent+39]=this.ln_3
- this.Control[iCurrent+40]=this.ln_4
- end on
- on w_musttake.destroy
- call super::destroy
- destroy(this.dw_msttake)
- 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_add)
- destroy(this.cb_delete)
- destroy(this.dw_msttakemx)
- destroy(this.ddlb_1)
- destroy(this.cb_1)
- destroy(this.cb_4)
- destroy(this.ddlb_2)
- 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.st_amtdisp)
- destroy(this.st_msttakeamt)
- destroy(this.st_takeamt)
- destroy(this.st_balcamt)
- destroy(this.cb_salebill)
- destroy(this.ddlb_3)
- destroy(this.st_2)
- destroy(this.st_5)
- destroy(this.st_6)
- destroy(this.cbx_ifuse)
- destroy(this.cb_3)
- destroy(this.cbx_all)
- destroy(this.pb_em1)
- destroy(this.pb_em2)
- destroy(this.pb_2)
- destroy(this.cb_take)
- destroy(this.cbx_1)
- destroy(this.ln_3)
- destroy(this.ln_4)
- 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 - 1745)
- dw_msttake.height=this.height - (w_height - 1104)
- dw_msttake.width=this.width - (w_width - 2082)
- dw_msttakemx.width=this.width - (w_width - 2082)
- dw_msttakemx.y=this.height - (w_height - 1500)
- end event
- event open;call super::open;uo_take = CREATE uo_musttake
- 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_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
- Boolean cb_priorpage_enabled,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
- Int ls_ifuse
- IF cbx_ifshowall.Checked THEN
- ls_ifshowall = 0
- ELSE
- ls_ifshowall = 1
- END IF
- IF cbx_ifuse.Checked THEN
- ls_ifuse = 1
- ELSE
- ls_ifuse = -1
- END IF
- IF sys_option_scid_msttake_mstpay = 1 THEN
- dw_pageretr.Retrieve(ls_ifshowall,cur_scid_arr,sys_option_msttake_cusarea,sys_areaid,ls_ifuse,ins_moneyid)
- ELSE
- dw_pageretr.Retrieve(ls_ifshowall,sys_option_msttake_cusarea,sys_areaid,ls_ifuse,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_msttake_cust_index'
- ELSE
- dw_pageretr.DataObject = 'dw_msttake_cust_index_not_scid'
- END IF
- dw_pageretr.TriggerEvent(Constructor!)
- em_pagerowno.TriggerEvent(Constructor!)
- dw_msttake.SetTransObject(sqlca)
- dw_msttakemx.SetTransObject(sqlca)
- if_ue_retr = TRUE
- if_ue_filter = TRUE
- if_ue_sort = TRUE
- end event
- event ue_usual_query_retr;String ls_querystrpart = ''
- ls_newselect = Lower(ori_oldselect)
- IF Trim(sle_usual_query.Text) <> '' THEN
- IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
- ls_querystrpart = "(u_cust.cuscode like '%"+Trim(sle_usual_query.Text)+"%') or (u_cust.name like '%"+Trim(sle_usual_query.Text)+"%') "
- ELSE
- ls_querystrpart = "(u_cust.cuscode like '"+Trim(sle_usual_query.Text)+"') or (u_cust.name like '"+Trim(sle_usual_query.Text)+"')"
- END IF
- //
- IF Pos(ls_newselect," where ") > 0 THEN
- IF Pos(ls_newselect," group by ") > 0 THEN
- ls_newselect = left(ls_newselect, Pos(ls_newselect," group by ") - 1) + " and ("+ls_querystrpart+')' + mid(ls_newselect, Pos(ls_newselect," group by "))
- else
- ls_newselect = ls_newselect+" and ("+ls_querystrpart+')'
- end if
-
- ELSE
- ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
- END IF
- 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+'( cuscode like "%'+Trim(sle_usual_query.Text)+'%" ) or ( name like "%'+Trim(sle_usual_query.Text)+'%" ) '
- ELSE
- obj_expr = obj_expr+'( cuscode like "'+Trim(sle_usual_query.Text)+'" ) or ( cuscode 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_musttake
- 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_musttake
- 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_musttake
- integer x = 347
- integer y = 192
- integer width = 553
- end type
- type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_musttake
- integer x = 1865
- 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_musttake
- integer x = 1586
- integer y = 44
- integer width = 279
- end type
- type dw_pageretr from w_publ_pageretr`dw_pageretr within w_musttake
- integer y = 400
- integer width = 1467
- integer height = 1740
- string title = "客户摘要"
- string dataobject = "dw_msttake_cust_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_musttake
- integer x = 14
- integer y = 212
- integer width = 343
- string text = "编号/名称含"
- alignment alignment = center!
- end type
- type cb_nextpage from w_publ_pageretr`cb_nextpage within w_musttake
- integer x = 2007
- integer width = 64
- integer height = 164
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type dw_msttake from u_dw_rbtnfilter within w_musttake
- integer x = 1472
- integer y = 400
- integer width = 2075
- integer height = 1100
- integer taborder = 20
- boolean bringtotop = true
- boolean titlebar = true
- string title = "客户应收帐"
- string dataobject = "dw_msttake_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 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_msttake m_print
- //m_print = CREATE m_msttake
- //m_print.m_0.PopMenu(THIS.X + THIS.PointerX() + 50,THIS.Y + THIS.PointerY() + 50)
- end event
- event clicked;IF row > 0 THEN
- This.SelectRow(0,False)
- This.SetRow(row)
- This.SelectRow(row,True)
- END IF
- IF dwo.Name = "checkdata" THEN
- This.SetTabOrder("checkdata", 10)
- ELSE
- This.SetTabOrder("checkdata", 0)
- END IF
- 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_musttake
- integer x = 946
- integer y = 304
- integer width = 553
- 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_musttake
- integer x = 2240
- integer y = 304
- integer width = 197
- 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
- boolean enabled = false
- string text = "日期从:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type em_firstday from editmask within w_musttake
- integer x = 2418
- integer y = 288
- 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_musttake
- integer x = 2903
- integer y = 304
- 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_musttake
- integer x = 3008
- integer y = 288
- 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_musttake
- 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_add from uo_imflatbutton within w_musttake
- integer x = 306
- integer width = 192
- integer height = 164
- integer taborder = 60
- boolean bringtotop = true
- string text = "新建&S"
- 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_delete from uo_imflatbutton within w_musttake
- 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_msttakemx from u_dw_rbtnfilter within w_musttake
- integer x = 1472
- integer y = 1500
- integer width = 2080
- integer height = 644
- integer taborder = 50
- boolean bringtotop = true
- boolean titlebar = true
- string title = "应收帐明细帐"
- string dataobject = "dw_msttakemx_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_musttake
- integer x = 347
- integer y = 288
- integer width = 553
- integer height = 1356
- integer taborder = 20
- boolean bringtotop = true
- end type
- event constructor;call super::constructor;cur_scid=this.uo_scid
- cur_scid_arr = THIS.uo_scid_arr
- //this.text='[0]总部'
- end event
- 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
- type cb_1 from uo_imflatbutton within w_musttake
- integer x = 1152
- integer width = 192
- integer height = 164
- integer taborder = 30
- 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_salebill_auto')
- end event
- type cb_4 from uo_imflatbutton within w_musttake
- boolean visible = false
- integer x = 1152
- integer width = 192
- integer height = 164
- integer taborder = 40
- 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_musttake
- integer x = 1696
- integer y = 288
- integer width = 526
- integer height = 1124
- integer taborder = 30
- 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 = -1
- ELSEIF Index = 2 THEN
- finishflag = 0
- ELSEIF Index = 3 THEN
- finishflag = 1
- END IF
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- type ln_bar from line within w_musttake
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 172
- integer endx = 3429
- integer endy = 172
- end type
- type ln_bar2 from line within w_musttake
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 176
- integer endx = 3429
- integer endy = 176
- end type
- type r_bar from rectangle within w_musttake
- long linecolor = 16777215
- long fillcolor = 1073741824
- integer x = 2866
- 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_musttake
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 388
- integer endx = 3429
- integer endy = 388
- end type
- type ln_2 from line within w_musttake
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 396
- integer endx = 3429
- integer endy = 396
- end type
- type ln_5 from line within w_musttake
- long linecolor = 268435456
- integer beginx = 1518
- integer endx = 1518
- integer endy = 176
- end type
- type ln_6 from line within w_musttake
- long linecolor = 16777215
- integer beginx = 1522
- integer endx = 1522
- integer endy = 180
- end type
- type st_amtdisp from statictext within w_musttake
- integer x = 2085
- integer y = 12
- integer width = 1157
- integer height = 160
- boolean bringtotop = true
- 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 st_msttakeamt from statictext within w_musttake
- 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_takeamt from statictext within w_musttake
- 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_balcamt from statictext within w_musttake
- 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 cb_salebill from uo_imflatbutton within w_musttake
- boolean visible = false
- integer x = 1344
- integer width = 242
- integer height = 164
- integer taborder = 40
- boolean bringtotop = true
- string text = "收入单&R"
- string normalpicname = "update.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;parent.triggerevent('ue_create_salebill')
- //if not f_power_ind(640) 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_salebill,s_open_tran)
- //
- //wf_refresh_balc()
- //parent.triggerevent('retrieve_pay')
- end event
- type ddlb_3 from dropdownlistbox within w_musttake
- integer x = 1696
- integer y = 192
- integer width = 526
- integer height = 1808
- integer taborder = 40
- 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_musttake
- 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 st_5 from statictext within w_musttake
- integer x = 1545
- 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 st_6 from statictext within w_musttake
- integer x = 1554
- 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 cbx_ifuse from checkbox within w_musttake
- integer x = 946
- integer y = 212
- 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 = "只显示有效客户"
- boolean checked = true
- end type
- event clicked;parent.triggerevent('retrieve_pageretr')
- end event
- type cb_3 from uo_imflatbutton within w_musttake
- integer x = 878
- integer width = 274
- integer height = 164
- integer taborder = 30
- 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_salebill_auto"
- menustr = menustr + "|" + "Text=自动对单~tEvent=ue_salebill_auto_p"
- menustr = menustr + "|" + "Text=-"
- menustr = menustr + "|" + "Text=辅助建立客户对数单~tEvent=ue_create_salebill"
- menustr = menustr + "|" + "Text=辅助建立客户收款单~tEvent=ue_create_cusamt"
- menustr = menustr + "|" + "Text=辅助建立客户费用单~tEvent=ue_create_reissue"
- 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_musttake
- 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_musttake
- integer x = 2802
- integer y = 288
- integer width = 101
- integer height = 92
- integer taborder = 20
- 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_musttake
- integer x = 3392
- integer y = 288
- 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_endday.triggerevent(rbuttondown!)
- end event
- type pb_2 from picturebutton within w_musttake
- integer x = 3493
- integer y = 288
- 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 = "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_take from uo_imflatbutton within w_musttake
- 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_take')
- end event
- type cbx_1 from checkbox within w_musttake
- integer x = 2245
- 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_msttake.SetRedraw(FALSE)
- IF THIS.Checked THEN
- FOR i = 1 TO dw_msttake.RowCount()
- IF dw_msttake.Object.finishflag[i]=0 then
- dw_msttake.Object.checkdata[i] = 1
- end if
- NEXT
- ELSE
- FOR i = 1 TO dw_msttake.RowCount()
- dw_msttake.Object.checkdata[i] = 0
- NEXT
- END IF
- dw_msttake.SetRedraw(TRUE)
- end event
- type ln_3 from line within w_musttake
- long linecolor = 16777215
- integer linethickness = 4
- integer beginx = 1522
- integer beginy = 188
- integer endx = 1522
- integer endy = 384
- end type
- type ln_4 from line within w_musttake
- long linecolor = 268435456
- integer linethickness = 4
- integer beginx = 1518
- integer beginy = 180
- integer endx = 1518
- integer endy = 380
- end type
|