123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026 |
- $PBExportHeader$w_initbalance.srw
- forward
- global type w_initbalance from w_publ_base
- end type
- type dw_1 from u_dw_rbtnfilter within w_initbalance
- end type
- type ddlb_1 from dropdownlistbox within w_initbalance
- end type
- type cb_save from uo_imflatbutton within w_initbalance
- end type
- type sle_1 from singlelineedit within w_initbalance
- end type
- type st_2 from statictext within w_initbalance
- end type
- type cb_1 from uo_imflatbutton within w_initbalance
- end type
- type ddlb_2 from dropdownlistbox within w_initbalance
- end type
- type cbx_yl from checkbox within w_initbalance
- end type
- type ddlb_yl from dropdownlistbox within w_initbalance
- end type
- type cbx_1 from checkbox within w_initbalance
- end type
- type cb_2 from uo_imflatbutton within w_initbalance
- end type
- type cb_psetup from uo_imflatbutton within w_initbalance
- end type
- type cb_mod from uo_imflatbutton within w_initbalance
- end type
- type cb_view from uo_imflatbutton within w_initbalance
- end type
- type st_1 from statictext within w_initbalance
- end type
- type ln_bar from line within w_initbalance
- end type
- type ln_bar2 from line within w_initbalance
- end type
- type r_bar from rectangle within w_initbalance
- end type
- type ln_1 from line within w_initbalance
- end type
- type ln_2 from line within w_initbalance
- end type
- end forward
- global type w_initbalance from w_publ_base
- integer width = 3611
- integer height = 2380
- string title = "帐务数据初始化"
- boolean maxbox = true
- windowstate windowstate = maximized!
- long backcolor = 80269524
- dw_1 dw_1
- ddlb_1 ddlb_1
- cb_save cb_save
- sle_1 sle_1
- st_2 st_2
- cb_1 cb_1
- ddlb_2 ddlb_2
- cbx_yl cbx_yl
- ddlb_yl ddlb_yl
- cbx_1 cbx_1
- cb_2 cb_2
- cb_psetup cb_psetup
- cb_mod cb_mod
- cb_view cb_view
- st_1 st_1
- ln_bar ln_bar
- ln_bar2 ln_bar2
- r_bar r_bar
- ln_1 ln_1
- ln_2 ln_2
- end type
- global w_initbalance w_initbalance
- type variables
- string subid
- int hstype[]
- boolean if_hswb=false
- uo_init uo_initbalance
- end variables
- forward prototypes
- public function integer wf_face ()
- end prototypes
- public function integer wf_face ();Long ls_index
- ls_index = ddlb_1.FindItem (ddlb_1.Text, 0 )
- IF ls_index <= 0 THEN RETURN 0
- cb_save.Enabled = dw_edit_mode
- ddlb_1.Enabled = NOT dw_edit_mode
- cb_view.Enabled = NOT dw_edit_mode
- IF dw_edit_mode THEN
-
- cb_mod.Text = '放弃'
- cb_mod.normalpicname = 'Undo.bmp'
-
- CHOOSE CASE hstype[ls_index]
- CASE 0
- dw_1.SetTabOrder('cw_initbalance_debit',10)
- dw_1.SetTabOrder('cw_initbalance_credit',20)
- dw_1.SetTabOrder('cw_initbalance_balance',30)
- dw_1.SetTabOrder('cw_initbalance_plhavedone',40)
- CASE 1
- dw_1.SetTabOrder('cw_initbalance_rawdebit',10)
- dw_1.SetTabOrder('cw_initbalance_debit',20)
- dw_1.SetTabOrder('cw_initbalance_rawcredit',30)
- dw_1.SetTabOrder('cw_initbalance_credit',40)
- dw_1.SetTabOrder('cw_initbalance_rawbalance',50)
- dw_1.SetTabOrder('cw_initbalance_balance',60)
- CASE 2
- dw_1.SetTabOrder('cw_initbalance_damount',10)
- dw_1.SetTabOrder('cw_initbalance_camount',20)
- dw_1.SetTabOrder('cw_initbalance_bamount',30)
- END CHOOSE
- ELSE
- cb_mod.Text = '修改'
- cb_mod.normalpicname = 'OPEN.bmp'
- CHOOSE CASE hstype[ls_index]
- CASE 0
- dw_1.SetTabOrder('cw_initbalance_debit',0)
- dw_1.SetTabOrder('cw_initbalance_credit',0)
- dw_1.SetTabOrder('cw_initbalance_balance',0)
- dw_1.SetTabOrder('cw_initbalance_plhavedone',0)
- CASE 1
- dw_1.SetTabOrder('cw_initbalance_rawdebit',0)
- dw_1.SetTabOrder('cw_initbalance_debit',0)
- dw_1.SetTabOrder('cw_initbalance_rawcredit',0)
- dw_1.SetTabOrder('cw_initbalance_credit',0)
- dw_1.SetTabOrder('cw_initbalance_rawbalance',0)
- dw_1.SetTabOrder('cw_initbalance_balance',0)
- CASE 2
- dw_1.SetTabOrder('cw_initbalance_damount',0)
- dw_1.SetTabOrder('cw_initbalance_camount',0)
- dw_1.SetTabOrder('cw_initbalance_bamount',0)
- END CHOOSE
-
- END IF
- cb_mod.of_init_draw()
- cb_mod.of_paint()
- cb_mod.TriggerEvent('ue_textchange')
- RETURN 1
- end function
- on w_initbalance.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.ddlb_1=create ddlb_1
- this.cb_save=create cb_save
- this.sle_1=create sle_1
- this.st_2=create st_2
- this.cb_1=create cb_1
- this.ddlb_2=create ddlb_2
- this.cbx_yl=create cbx_yl
- this.ddlb_yl=create ddlb_yl
- this.cbx_1=create cbx_1
- this.cb_2=create cb_2
- this.cb_psetup=create cb_psetup
- this.cb_mod=create cb_mod
- this.cb_view=create cb_view
- this.st_1=create st_1
- 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
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.ddlb_1
- this.Control[iCurrent+3]=this.cb_save
- this.Control[iCurrent+4]=this.sle_1
- this.Control[iCurrent+5]=this.st_2
- this.Control[iCurrent+6]=this.cb_1
- this.Control[iCurrent+7]=this.ddlb_2
- this.Control[iCurrent+8]=this.cbx_yl
- this.Control[iCurrent+9]=this.ddlb_yl
- this.Control[iCurrent+10]=this.cbx_1
- this.Control[iCurrent+11]=this.cb_2
- this.Control[iCurrent+12]=this.cb_psetup
- this.Control[iCurrent+13]=this.cb_mod
- this.Control[iCurrent+14]=this.cb_view
- this.Control[iCurrent+15]=this.st_1
- this.Control[iCurrent+16]=this.ln_bar
- this.Control[iCurrent+17]=this.ln_bar2
- this.Control[iCurrent+18]=this.r_bar
- this.Control[iCurrent+19]=this.ln_1
- this.Control[iCurrent+20]=this.ln_2
- end on
- on w_initbalance.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.ddlb_1)
- destroy(this.cb_save)
- destroy(this.sle_1)
- destroy(this.st_2)
- destroy(this.cb_1)
- destroy(this.ddlb_2)
- destroy(this.cbx_yl)
- destroy(this.ddlb_yl)
- destroy(this.cbx_1)
- destroy(this.cb_2)
- destroy(this.cb_psetup)
- destroy(this.cb_mod)
- destroy(this.cb_view)
- destroy(this.st_1)
- destroy(this.ln_bar)
- destroy(this.ln_bar2)
- destroy(this.r_bar)
- destroy(this.ln_1)
- destroy(this.ln_2)
- end on
- event open;call super::open;//hstype[]
- //0:本位币
- //1:外币
- //2:数量
- //3:试算平衡
- String ls_subid,ls_name,ls_moneyname,ins_moneyname
- Long ls_moneyid
- Dec ls_rate
- Int itmx = 0,ls_hswb
- //1.查本位币
- SELECT cw_currency.name INTO :ls_moneyname FROM cw_currency
- WHERE cw_currency.native = 1
- and (cw_currency.accsetid = :sys_accsetid or cw_currency.accsetid = 0 );
- IF sqlca.SQLCode <> 0 THEN
- ls_moneyname = ''
- END IF
- ins_moneyname = ls_moneyname
- ddlb_1.AddItem('--'+ls_moneyname+'--')
- ddlb_2.AddItem('')
- itmx++
- hstype[itmx] = 0
- //2.查外币
- DECLARE money_cur CURSOR FOR
- SELECT cw_currency.moneyid,cw_currency.name,cw_currency.rate
- FROM cw_currency
- WHERE cw_currency.native = 0
- Order By cw_currency.moneyid;
-
- OPEN money_cur;
- FETCH money_cur INTO :ls_moneyid,:ls_moneyname,:ls_rate;
- DO WHILE sqlca.SQLCode = 0
- itmx++
- hstype[itmx] = 1
- ddlb_1.AddItem('--'+ls_moneyname+'--')
- ddlb_2.AddItem('['+String(ls_moneyid)+']'+String(ls_rate,'#.00##'))
- FETCH money_cur INTO :ls_moneyid,:ls_moneyname,:ls_rate;
- LOOP
- CLOSE money_cur;
- //3.数量
- ddlb_1.AddItem('--数量--')
- ddlb_2.AddItem('')
- itmx++
- hstype[itmx] = 2
- //4.试算平衡
- ddlb_1.AddItem('--试算平衡--')
- ddlb_2.AddItem('')
- itmx++
- hstype[itmx] = 3
- ////////////////
- //ddlb_1.selectitem('--'+ls_moneyname+'--',1)
- ddlb_1.Text = '--'+ins_moneyname+'--'
- ddlb_1.TriggerEvent(SelectionChanged!)
- uo_initbalance = CREATE uo_init
- end event
- event 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
- dw_1.Width = THIS.Width - dw_1.X - 40
- dw_1.Height = THIS.Height - dw_1.Y - 150
- end event
- event close;destroy uo_initbalance
- end event
- event closequery;IF dw_edit_mode THEN
- Int ls_row = 0
- dw_1.AcceptText()
- ls_row = dw_1.GetNextModified(0, Primary!)+&
- dw_1.GetNextModified(0, Filter!)+dw_1.DeletedCount()
- IF ls_row > 0 THEN
- IF MessageBox('是否保存','单据数据已经改变,是否先保存?',Question!,YesNo!,1 ) = 1 THEN
- RETURN 1
- END IF
- END IF
- END IF
- end event
- type cb_func from w_publ_base`cb_func within w_initbalance
- boolean visible = false
- integer x = 1074
- integer y = 800
- end type
- type cb_exit from w_publ_base`cb_exit within w_initbalance
- integer x = 1317
- integer width = 165
- integer height = 172
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- type dw_1 from u_dw_rbtnfilter within w_initbalance
- integer y = 308
- integer width = 3447
- integer height = 1724
- integer taborder = 60
- boolean bringtotop = true
- string dataobject = "dw_initbalance_native"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean rbutton_filter_use = true
- end type
- event itemchanged;IF dw_1.DataObject = 'dw_initbalance_wb' THEN
- Decimal ls_rate
- ls_rate = Dec(sle_1.Text)
- IF dw_1.GetRow() <= 0 THEN RETURN
- dw_1.AcceptText()
- IF cbx_1.Checked THEN
- CHOOSE CASE dwo.Name
- CASE 'cw_initbalance_rawdebit'
- dw_1.Object.cw_initbalance_debit[dw_1.GetRow()] = Round(Dec(dw_1.Object.cw_initbalance_rawdebit[dw_1.GetRow()]) * ls_rate,2)
- CASE 'cw_initbalance_rawcredit'
- dw_1.Object.cw_initbalance_credit[dw_1.GetRow()] = Round(dw_1.Object.cw_initbalance_rawcredit[dw_1.GetRow()] * ls_rate ,2)
- CASE 'cw_initbalance_rawbalance'
- dw_1.Object.cw_initbalance_balance[dw_1.GetRow()] = Round(dw_1.Object.cw_initbalance_rawbalance[dw_1.GetRow()] * ls_rate ,2)
- END CHOOSE
- END IF
- END IF
- end event
- event rowfocuschanged;if currentrow<=0 then return
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end event
- type ddlb_1 from dropdownlistbox within w_initbalance
- integer x = 411
- integer y = 200
- integer width = 654
- integer height = 960
- integer taborder = 70
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean sorted = false
- boolean vscrollbar = true
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;String mod_str = '',ls_rate
- Long ls_sit,ls_moneyid
- Dec sum_ydebit,sum_ycrebit,sum_debit,sum_crebit,sum_mdebit,sum_mcrebit
- IF IsNull(Index) THEN
- Index = ddlb_1.FindItem (ddlb_1.Text, 0 )
- END IF
- ddlb_2.SelectItem(Index)
- IF Index <= 0 THEN RETURN
- CHOOSE CASE hstype[Index]
- CASE 0
- dw_1.DataObject = 'dw_initbalance_native'
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(sys_accsetid)
- st_2.Visible = FALSE
- cb_save.Visible = TRUE
- cb_mod.Visible = TRUE
- sle_1.Visible = FALSE
- CASE 1
- ls_moneyid = Long(Mid ( ddlb_2.Text,Pos(ddlb_2.Text,'[') + 1,Pos(ddlb_2.Text,']') - Pos(ddlb_2.Text,'[') - 1 ))
- ls_rate = Mid(ddlb_2.Text,Pos(ddlb_2.Text,']') + 1)
- dw_1.DataObject = 'dw_initbalance_wb'
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(sys_accsetid,ls_moneyid)
- st_2.Visible = TRUE
- cb_save.Visible = TRUE
- cb_mod.Visible = TRUE
- sle_1.Visible = TRUE
- st_2.Text = '初始汇率:'
- sle_1.Text = ls_rate
- CASE 2
- dw_1.DataObject = 'dw_initbalance_qty'
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(sys_accsetid)
- st_2.Visible = FALSE
- cb_save.Visible = TRUE
- cb_mod.Visible = TRUE
- sle_1.Visible = FALSE
- CASE 3
- dw_1.DataObject = 'dw_initbalance_balance'
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(sys_accsetid)
- st_2.Visible = FALSE
- cb_save.Visible = FALSE
- cb_mod.Visible = FALSE
- sle_1.Visible = TRUE
-
- sum_ydebit = dw_1.Object.sum_ydebit[1]
- sum_ycrebit = dw_1.Object.sum_ydebit[1]
- sum_debit = dw_1.Object.sum_debit[1]
- sum_crebit = dw_1.Object.sum_crebit[1]
- sum_mdebit = dw_1.Object.sum_mdebit[1]
- sum_mcrebit = dw_1.Object.sum_mcrebit[1]
-
-
-
- IF String(sum_ydebit,'###0.00') <> String(sum_ycrebit,'###0.00') OR String(sum_debit,'###0.00') <> String(sum_crebit,'###0.00') OR String(sum_mdebit,'###0.00') <> String(sum_mcrebit,'###0.00') THEN
- sle_1.Text = '试算表不平衡!'
- sle_1.TextColor = RGB(255,0,0)
- ELSE
- sle_1.Text = '试算表平衡,可以开帐'
- sle_1.TextColor = RGB(0,100,255)
- END IF
- END CHOOSE
- //cw_subject_dcflag
- //yrawbalance
- //cw_inititembala_rawdebit
- //cw_inititembala_rawcredit
- //cw_inititembala_rawbalance
- //ybalance
- //cw_inititembala_debit
- //cw_inititembala_credit
- //cw_inititembala_balance
- end event
- type cb_save from uo_imflatbutton within w_initbalance
- integer width = 165
- integer height = 172
- integer taborder = 30
- boolean bringtotop = true
- boolean enabled = false
- string text = "保存"
- string normalpicname = "save.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;IF MessageBox ("IF","是否确定要保存当前帐务初始化数据吗?",Question!,YesNo! ) = 2 THEN RETURN
- Long i,cnt,ls_itemid,ls_index,ls_moneyid
- Decimal ls_ydebit,ls_ycredit,ls_mdebit,ls_mcredit,ls_debit,ls_credit,ls_balance,ls_plhavedone
- Decimal ls_yrawdebit,ls_yrawcredit,ls_mrawdebit,ls_mrawcredit,ls_rawdebit,ls_rawcredit,ls_rawbalance
- Decimal ls_damount,ls_camount,bamount
- String ls_subid
- Int ls_dcflag
- Long ll_moneyid
- Boolean if_commit = FALSE
- String arg_msg
- ls_index = ddlb_1.FindItem (ddlb_1.Text, 0 )
- IF ls_index <= 0 THEN
- MessageBox(publ_operator,'没有可保存的数据')
- RETURN
- END IF
- dw_1.SetFilter('')
- dw_1.Filter()
- dw_1.AcceptText()
- cnt = dw_1.RowCount()
- IF cnt <= 0 THEN
- MessageBox(publ_operator,'没有可保存的数据')
- RETURN
- END IF
- Open(w_sys_wait)
- CHOOSE CASE hstype[ls_index]
- CASE 0 //0:本位币
- ll_moneyid = 0
-
- IF uo_initbalance.uof_clear_initbalance(0,arg_msg,ll_moneyid) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,'保存数据失败 >>' + arg_msg)
- RETURN
- END IF
-
- FOR i = 1 TO cnt
- ls_subid = dw_1.Object.cw_subject_subid[i]
- ls_dcflag = dw_1.Object.cw_subject_dcflag[i]
-
- ls_debit = dw_1.Object.cw_initbalance_debit[i]
- ls_credit = dw_1.Object.cw_initbalance_credit[i]
- ls_balance = dw_1.Object.cw_initbalance_balance[i]
- ls_plhavedone = dw_1.Object.cw_initbalance_plhavedone[i]
- IF ls_dcflag = 0 THEN
- IF dw_1.Object.cw_initbalance_balance[i] < 0 THEN
- ls_ydebit = 0 - dw_1.Object.ybalance[i]
- ls_ycredit = 0
- ls_mdebit = 0 - dw_1.Object.cw_initbalance_balance[i]
- ls_mcredit = 0
- ELSE
- ls_ydebit = 0
- ls_ycredit = dw_1.Object.ybalance[i]
- ls_mdebit = 0
- ls_mcredit = dw_1.Object.cw_initbalance_balance[i]
- END IF
- ELSEIF ls_dcflag = 1 THEN
- IF dw_1.Object.cw_initbalance_balance[i] < 0 THEN
- ls_ydebit = 0
- ls_ycredit = 0 - dw_1.Object.ybalance[i]
- ls_mdebit = 0
- ls_mcredit = 0 - dw_1.Object.cw_initbalance_balance[i]
- ELSE
- ls_ydebit = dw_1.Object.ybalance[i]
- ls_ycredit = 0
- ls_mdebit = dw_1.Object.cw_initbalance_balance[i]
- ls_mcredit = 0
- END IF
- END IF
-
- IF uo_initbalance.initbalance(ls_subid,ls_ydebit,ls_ycredit,ls_mdebit,ls_mcredit,ls_debit,ls_credit,ls_balance,ls_plhavedone, &
- ls_yrawdebit,ls_yrawcredit,ls_mrawdebit,ls_mrawcredit,ls_rawdebit,ls_rawcredit,ls_rawbalance,&
- arg_msg,FALSE) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
- NEXT
-
- IF uo_initbalance.p_update_subid_p(arg_msg) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,'保存数据失败 >>' + arg_msg)
- RETURN
- END IF
- CASE 1 //1:外币
- ll_moneyid = Long(Mid ( ddlb_2.Text,Pos(ddlb_2.Text,'[') + 1,Pos(ddlb_2.Text,']') - Pos(ddlb_2.Text,'[') - 1 ))
-
- IF uo_initbalance.uof_clear_initbalance(1,arg_msg,ll_moneyid) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,'保存数据失败 >>' + arg_msg)
- RETURN
- END IF
-
- FOR i = 1 TO cnt
- ls_subid = dw_1.Object.cw_subject_subid[i]
- ls_dcflag = dw_1.Object.cw_subject_dcflag[i]
-
- ls_debit = dw_1.Object.cw_initbalance_debit[i]
- ls_credit = dw_1.Object.cw_initbalance_credit[i]
- ls_balance = dw_1.Object.cw_initbalance_balance[i]
- ls_plhavedone = 0
- IF ls_dcflag = 0 THEN
- ls_ydebit = 0
- ls_ycredit = dw_1.Object.ybalance[i]
- ls_mdebit = 0
- ls_mcredit = dw_1.Object.cw_initbalance_balance[i]
- ELSEIF ls_dcflag = 1 THEN
- ls_ydebit = dw_1.Object.ybalance[i]
- ls_ycredit = 0
- ls_mdebit = dw_1.Object.cw_initbalance_balance[i]
- ls_mcredit = 0
- END IF
-
- ls_rawdebit = dw_1.Object.cw_initbalance_rawdebit[i]
- IF IsNull(ls_rawdebit) THEN ls_rawdebit = 0
- ls_rawcredit = dw_1.Object.cw_initbalance_rawcredit[i]
- IF IsNull(ls_rawcredit) THEN ls_rawcredit = 0
- ls_rawbalance = dw_1.Object.cw_initbalance_rawbalance[i]
- IF IsNull(ls_rawbalance) THEN ls_rawbalance = 0
-
- IF ls_dcflag = 0 THEN
- ls_yrawdebit = 0
- ls_yrawcredit = dw_1.Object.yrawbalance[i]
- ls_mrawdebit = 0
- ls_mrawcredit = dw_1.Object.cw_initbalance_rawbalance[i]
- ELSEIF ls_dcflag = 1 THEN
- ls_yrawdebit = dw_1.Object.yrawbalance[i]
- ls_yrawcredit = 0
- ls_mrawdebit = dw_1.Object.cw_initbalance_rawbalance[i]
- ls_mrawcredit = 0
- END IF
-
-
- IF uo_initbalance.initbalance(ls_subid,ls_ydebit,ls_ycredit,ls_mdebit,ls_mcredit,ls_debit,ls_credit,ls_balance,ls_plhavedone, &
- ls_yrawdebit,ls_yrawcredit,ls_mrawdebit,ls_mrawcredit,ls_rawdebit,ls_rawcredit,ls_rawbalance,&
- arg_msg,FALSE) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
- NEXT
-
- IF uo_initbalance.p_update_subid_p(arg_msg) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,'保存数据失败 >>' + arg_msg)
- RETURN
- END IF
- CASE 2 //2.数量
- FOR i = 1 TO cnt
- ls_subid = dw_1.Object.cw_subject_subid[i]
-
- ls_damount = dw_1.Object.cw_initbalance_damount[i]
- ls_camount = dw_1.Object.cw_initbalance_camount[i]
- bamount = dw_1.Object.cw_initbalance_bamount[i]
-
- IF i = cnt THEN
- if_commit = TRUE
- ELSE
- if_commit = FALSE
- END IF
-
-
- IF uo_initbalance.initbalance_qty(ls_subid,ls_damount,ls_camount,bamount,arg_msg,if_commit) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
-
- IF uo_initbalance.p_update_subid_p_qty(arg_msg) = 0 THEN
- Close(w_sys_wait)
- MessageBox(publ_operator,'保存数据失败 >>' + arg_msg)
- RETURN
- END IF
- NEXT
- END CHOOSE
- Close(w_sys_wait)
- dw_edit_mode = NOT dw_edit_mode
- wf_face()
- MessageBox(publ_operator,'数据保存成功')
- //1.
- //cw_subject_subid
- //cw_subject_dcflag
- //cw_initbalance_debit
- //cw_initbalance_credit
- //cw_initbalance_balance
- //cw_initbalance_plhavedone
- //ybalance
- //2.
- //cw_subject_subid
- //cw_subject_dcflag
- //cw_initbalance_rawdebit
- //cw_initbalance_rawbalance
- //cw_initbalance_rawbalance
- //cw_initbalance_debit
- //cw_initbalance_credit
- //cw_initbalance_balance
- //yrawbalance
- //ybalance
- //3.
- //cw_subject_subid
- //cw_subject_dcflag
- //cw_initbalance_damount
- //cw_initbalance_debit
- //cw_initbalance_camount
- //cw_initbalance_credit
- //cw_initbalance_bamount
- //cw_initbalance_balance
- //yqtybalance
- //ybalance
- end event
- type sle_1 from singlelineedit within w_initbalance
- integer x = 1522
- integer y = 196
- integer width = 649
- integer height = 92
- integer taborder = 40
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean autohscroll = false
- boolean displayonly = true
- borderstyle borderstyle = stylelowered!
- end type
- type st_2 from statictext within w_initbalance
- integer x = 1115
- integer y = 212
- integer width = 393
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- boolean enabled = false
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type cb_1 from uo_imflatbutton within w_initbalance
- integer x = 603
- integer width = 165
- integer height = 172
- integer taborder = 130
- boolean bringtotop = true
- string text = "打印"
- string normalpicname = "print.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;IF DW_1.ROWCOUNT()>=1 THEN
- cbx_YL.CHECKED=TRUE
- cbx_YL.TriggerEvent(CLICKED!)
- openwithparm(w_sys_printpagesetting,dw_1)
- ELSE
- MESSAGEBOX(publ_operator,'数据窗口中没有任何记录,不能打印!')
- END IF
- end event
- type ddlb_2 from dropdownlistbox within w_initbalance
- boolean visible = false
- integer x = 535
- integer y = 764
- integer width = 480
- integer height = 420
- 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
- boolean vscrollbar = true
- borderstyle borderstyle = stylelowered!
- end type
- type cbx_yl from checkbox within w_initbalance
- integer x = 1618
- integer y = 52
- integer width = 206
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "预览"
- end type
- event clicked;ddlb_yl.enabled = this.checked
- if this.checked then
- dw_1.selectrow(0,false)
- if lower(dw_1.object.datawindow.print.preview) = 'yes' then return
- dw_1.object.datawindow.print.preview = 'yes'
- dw_1.object.datawindow.print.duplex = 2
- dw_1.object.datawindow.print.preview.rulers = "yes"
- else
- if lower(dw_1.object.datawindow.print.preview) = 'no' then return
- dw_1.object.datawindow.print.preview = 'no'
- end if
- end event
- event constructor;this.backcolor = 14215660
- end event
- type ddlb_yl from dropdownlistbox within w_initbalance
- integer x = 1842
- integer y = 48
- integer width = 261
- integer height = 532
- integer taborder = 80
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- string text = "适当大小"
- boolean vscrollbar = true
- string item[] = {"100%","75%","50%","25%","200%","150%"}
- borderstyle borderstyle = stylelowered!
- end type
- event constructor;if THIS.TotalItems ( )>=1 then THIS.SelectItem(1)
- end event
- event selectionchanged;dw_1.Object.DataWindow.Print.Preview.Zoom = INTEGER(LEFT(TRIM(this.text),LEN(TRIM(this.text)) - 1))
- dw_1.object.DataWindow.Print.Preview = 'yes'
- end event
- type cbx_1 from checkbox within w_initbalance
- integer x = 2190
- integer y = 204
- integer width = 576
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 67108864
- string text = "外币自动按汇率计算"
- boolean checked = true
- end type
- type cb_2 from uo_imflatbutton within w_initbalance
- integer x = 1042
- integer width = 274
- integer height = 172
- integer taborder = 100
- boolean bringtotop = true
- string text = "数据发送"
- string normalpicname = "find.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;OPENWITHPARM(w_sentdataout,DW_1)
- end event
- type cb_psetup from uo_imflatbutton within w_initbalance
- integer x = 768
- integer width = 274
- integer height = 172
- integer taborder = 120
- boolean bringtotop = true
- string text = "页面设置"
- string normalpicname = "PRINTFLD.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;OpenWithParm(w_sys_printpage_value,DW_1)
- //PRINTSETUP()
- end event
- type cb_mod from uo_imflatbutton within w_initbalance
- integer x = 165
- integer width = 165
- integer height = 172
- integer taborder = 90
- boolean bringtotop = true
- string text = "修改"
- string normalpicname = "open.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;IF dw_edit_mode THEN
- IF MessageBox ("询问","是否确定要放弃保存当前数据?",Question!,YesNo! ) = 2 THEN RETURN
- END IF
- dw_1.SetFilter('')
- dw_1.Filter()
- dw_edit_mode = NOT dw_edit_mode
- wf_face()
- end event
- type cb_view from uo_imflatbutton within w_initbalance
- integer x = 329
- integer width = 274
- integer height = 172
- integer taborder = 90
- boolean bringtotop = true
- string text = "查看期初"
- string normalpicname = "PREVIEW.BMP"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;open(w_initbalance_rpt)
- end event
- type st_1 from statictext within w_initbalance
- integer x = 23
- integer y = 216
- integer width = 389
- 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 = 67108864
- string text = "核算项目科目:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ln_bar from line within w_initbalance
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 176
- integer endx = 3323
- integer endy = 176
- end type
- type ln_bar2 from line within w_initbalance
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 180
- integer endx = 3323
- integer endy = 180
- end type
- type r_bar from rectangle within w_initbalance
- long linecolor = 16777215
- long fillcolor = 1073741824
- integer x = 2747
- 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_initbalance
- long linecolor = 268435456
- integer linethickness = 4
- integer beginy = 300
- integer endx = 3323
- integer endy = 300
- end type
- type ln_2 from line within w_initbalance
- long linecolor = 16777215
- integer linethickness = 4
- integer beginy = 304
- integer endx = 3323
- integer endy = 304
- end type
|