123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733 |
- $PBExportHeader$w_accset_info.srw
- forward
- global type w_accset_info from w_publ_base
- end type
- type tab_accsetinfo from tab within w_accset_info
- end type
- type tabpage_1 from userobject within tab_accsetinfo
- end type
- type dw_1 from datawindow within tabpage_1
- end type
- type tabpage_1 from userobject within tab_accsetinfo
- dw_1 dw_1
- end type
- type tabpage_2 from userobject within tab_accsetinfo
- end type
- type dw_2 from datawindow within tabpage_2
- end type
- type dw_credenceword_index from datawindow within tabpage_2
- end type
- type cb_4 from uo_imflatbutton within tabpage_2
- end type
- type cb_5 from uo_imflatbutton within tabpage_2
- end type
- type tabpage_2 from userobject within tab_accsetinfo
- dw_2 dw_2
- dw_credenceword_index dw_credenceword_index
- cb_4 cb_4
- cb_5 cb_5
- end type
- type tabpage_3 from userobject within tab_accsetinfo
- end type
- type em_1 from editmask within tabpage_3
- end type
- type st_2 from statictext within tabpage_3
- end type
- type dw_3 from datawindow within tabpage_3
- end type
- type cb_2 from uo_imflatbutton within tabpage_3
- end type
- type cb_7 from uo_imflatbutton within tabpage_3
- end type
- type tabpage_3 from userobject within tab_accsetinfo
- em_1 em_1
- st_2 st_2
- dw_3 dw_3
- cb_2 cb_2
- cb_7 cb_7
- end type
- type tabpage_4 from userobject within tab_accsetinfo
- end type
- type dw_4 from datawindow within tabpage_4
- end type
- type tabpage_4 from userobject within tab_accsetinfo
- dw_4 dw_4
- end type
- type tab_accsetinfo from tab within w_accset_info
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- tabpage_4 tabpage_4
- end type
- type cb_1 from uo_imflatbutton within w_accset_info
- end type
- end forward
- global type w_accset_info from w_publ_base
- integer width = 2167
- integer height = 1344
- string title = "帐套选项"
- boolean minbox = false
- long backcolor = 80269524
- tab_accsetinfo tab_accsetinfo
- cb_1 cb_1
- end type
- global w_accset_info w_accset_info
- type variables
- datawindow dw1,dw2,dw3,dw4
- uo_accset uo_newaccset
- s_subject_array ins_s_subject
- datastore ds_initsubject
- end variables
- forward prototypes
- public function integer wf_import_subject (ref string arg_msg)
- public function integer wf_get_subject (long arg_cropid, ref string arg_msg)
- end prototypes
- public function integer wf_import_subject (ref string arg_msg);String ls_filename
- ds_initsubject = CREATE datastore
- ds_initsubject.DataObject = "d_subjectdata_import"
- ds_initsubject.SetTransObject(sqlca)
- ls_filename = sys_cur_path +'initdata.dbf'
- IF NOT FileExists ( ls_filename ) THEN
- arg_msg = '初始化科目失败,没有找到科目文件'
- RETURN 0
- END IF
- IF ds_initsubject.ImportFile ( ls_filename ) <= 0 THEN
- arg_msg = '初始化科目失败,导入科目数据失败或文件中没有相应企业的科目'
- RETURN 0
- END IF
- RETURN 1
- end function
- public function integer wf_get_subject (long arg_cropid, ref string arg_msg);Long rslt = 1,itmxt = 0,i
- ds_initsubject.SetFilter('croptypeid = '+ String(arg_cropid))
- ds_initsubject.Filter( )
- IF ds_initsubject.RowCount() > 0 THEN
- FOR i = 1 To ds_initsubject.RowCount()
- itmxt++
- ins_s_subject.croptypeid[itmxt] = ds_initsubject.Object.croptypeid[i]
- ins_s_subject.subid[itmxt] = ds_initsubject.Object.subid[i]
- ins_s_subject.Name[itmxt] = ds_initsubject.Object.Name[i]
- ins_s_subject.dcflag[itmxt] = ds_initsubject.Object.dcflag[i]
- ins_s_subject.detailflag[itmxt] = ds_initsubject.Object.detailflag[i]
- ins_s_subject.hswb[itmxt] = ds_initsubject.Object.hswb[i]
- ins_s_subject.moneyid[itmxt] = ds_initsubject.Object.moneyid[i]
- ins_s_subject.hsqty[itmxt] = ds_initsubject.Object.hsqty[i]
- ins_s_subject.unit[itmxt] = ds_initsubject.Object.unit[i]
- ins_s_subject.hsdept[itmxt] = ds_initsubject.Object.hsdept[i]
- ins_s_subject.hsemp[itmxt] = ds_initsubject.Object.hsemp[i]
- ins_s_subject.hsitem[itmxt] = ds_initsubject.Object.hsitem[i]
- ins_s_subject.hstrader[itmxt] = ds_initsubject.Object.hstrader[i]
- ins_s_subject.attrflag[itmxt] = ds_initsubject.Object.attrflag[i]
- ins_s_subject.specialcode[itmxt] = ds_initsubject.Object.specialcode[i]
- ins_s_subject.relevantid[itmxt] = ds_initsubject.Object.relevantid[i]
- IF IsNull(ds_initsubject.Object.relevantid[i]) THEN
- MessageBox("","")
- END IF
- NEXT
- END IF
- RETURN rslt
- end function
- on w_accset_info.create
- int iCurrent
- call super::create
- this.tab_accsetinfo=create tab_accsetinfo
- this.cb_1=create cb_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.tab_accsetinfo
- this.Control[iCurrent+2]=this.cb_1
- end on
- on w_accset_info.destroy
- call super::destroy
- destroy(this.tab_accsetinfo)
- destroy(this.cb_1)
- end on
- event open;call super::open;Long cnt = 0
- String arg_msg
- uo_newaccset = CREATE uo_accset
- IF wf_import_subject(arg_msg) = 0 THEN
- MessageBox(publ_operator, arg_msg)
- Close(This)
- END IF
- SELECT count(*) INTO :cnt
- From cw_accset;
- IF sqlca.SQLCode <> 0 THEN
- cnt = 0
- END IF
- IF cnt = 0 THEN
- INSERT INTO cw_accset
- (accsetid,accsetname,step1,step2,step3,step4,step5,step6,ifnewsubid)
- VALUES
- (11,'000',4,3,3,3,3,2,1);
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示','建立帐套失败,原因:'+arg_msg)
- ELSE
- //取科目
- IF wf_get_subject(0,arg_msg) = 0 THEN
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
-
- uo_newaccset.accsetid = 11
- IF uo_newaccset.subject_arrray(ins_s_subject,arg_msg,False) = 0 THEN
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
-
- COMMIT;
- END IF
- END IF
- dw1 = tab_accsetinfo.tabpage_1.dw_1
- dw2 = tab_accsetinfo.tabpage_2.dw_2
- dw3 = tab_accsetinfo.tabpage_3.dw_3
- dw4 = tab_accsetinfo.tabpage_4.dw_4
- dw1.SetTransObject(sqlca)
- dw2.SetTransObject(sqlca)
- dw3.SetTransObject(sqlca)
- dw4.SetTransObject(sqlca)
- tab_accsetinfo.tabpage_2.dw_credenceword_index.SetTransObject(sqlca)
- dw1.Retrieve(sys_accsetid)
- dw2.Retrieve(sys_accsetid)
- tab_accsetinfo.tabpage_3.cb_2.TriggerEvent(Clicked!) //retrieve dw3)
- Int li_ifstart
- IF sys_accsetbegin THEN
- li_ifstart = 1
- ELSE
- li_ifstart = 0
- END IF
- dw4.Retrieve(sys_accsetid,li_ifstart)
- tab_accsetinfo.tabpage_2.dw_credenceword_index.Retrieve(sys_accsetid)
- end event
- event close;call super::close;Destroy uo_accset
- end event
- type cb_func from w_publ_base`cb_func within w_accset_info
- boolean visible = false
- integer x = 1783
- integer y = 1184
- boolean enabled = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_accset_info
- integer x = 1120
- integer y = 1116
- end type
- type tab_accsetinfo from tab within w_accset_info
- integer x = 46
- integer y = 24
- integer width = 2043
- integer height = 1068
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 80269524
- boolean raggedright = true
- integer selectedtab = 1
- tabpage_1 tabpage_1
- tabpage_2 tabpage_2
- tabpage_3 tabpage_3
- tabpage_4 tabpage_4
- end type
- on tab_accsetinfo.create
- this.tabpage_1=create tabpage_1
- this.tabpage_2=create tabpage_2
- this.tabpage_3=create tabpage_3
- this.tabpage_4=create tabpage_4
- this.Control[]={this.tabpage_1,&
- this.tabpage_2,&
- this.tabpage_3,&
- this.tabpage_4}
- end on
- on tab_accsetinfo.destroy
- destroy(this.tabpage_1)
- destroy(this.tabpage_2)
- destroy(this.tabpage_3)
- destroy(this.tabpage_4)
- end on
- type tabpage_1 from userobject within tab_accsetinfo
- integer x = 18
- integer y = 112
- integer width = 2007
- integer height = 940
- long backcolor = 80269524
- string text = "企业信息"
- long tabtextcolor = 33554432
- long tabbackcolor = 80269524
- string picturename = "Custom092!"
- long picturemaskcolor = 553648127
- dw_1 dw_1
- end type
- on tabpage_1.create
- this.dw_1=create dw_1
- this.Control[]={this.dw_1}
- end on
- on tabpage_1.destroy
- destroy(this.dw_1)
- end on
- type dw_1 from datawindow within tabpage_1
- integer x = 87
- integer y = 40
- integer width = 1824
- integer height = 876
- integer taborder = 30
- boolean bringtotop = true
- string dataobject = "dw_accset_info"
- boolean border = false
- boolean livescroll = true
- end type
- type tabpage_2 from userobject within tab_accsetinfo
- integer x = 18
- integer y = 112
- integer width = 2007
- integer height = 940
- long backcolor = 80269524
- string text = "帐套参数"
- long tabtextcolor = 33554432
- long tabbackcolor = 80269524
- string picturename = "EditFuncDeclare!"
- long picturemaskcolor = 553648127
- dw_2 dw_2
- dw_credenceword_index dw_credenceword_index
- cb_4 cb_4
- cb_5 cb_5
- end type
- on tabpage_2.create
- this.dw_2=create dw_2
- this.dw_credenceword_index=create dw_credenceword_index
- this.cb_4=create cb_4
- this.cb_5=create cb_5
- this.Control[]={this.dw_2,&
- this.dw_credenceword_index,&
- this.cb_4,&
- this.cb_5}
- end on
- on tabpage_2.destroy
- destroy(this.dw_2)
- destroy(this.dw_credenceword_index)
- destroy(this.cb_4)
- destroy(this.cb_5)
- end on
- type dw_2 from datawindow within tabpage_2
- integer x = 32
- integer y = 88
- integer width = 1065
- integer height = 780
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_accset_info2"
- boolean border = false
- boolean livescroll = true
- end type
- type dw_credenceword_index from datawindow within tabpage_2
- integer x = 1134
- integer y = 88
- integer width = 594
- integer height = 780
- integer taborder = 40
- boolean bringtotop = true
- string dataobject = "dw_credenceword_index"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_4 from uo_imflatbutton within tabpage_2
- integer x = 1737
- integer y = 124
- integer width = 233
- integer height = 96
- integer taborder = 40
- boolean bringtotop = true
- string text = "增加"
- end type
- event clicked;long li_row
- li_row=dw_credenceword_index.insertrow(0)
- dw_credenceword_index.object.accsetid[li_row]=sys_accsetid
- end event
- type cb_5 from uo_imflatbutton within tabpage_2
- integer x = 1737
- integer y = 224
- integer width = 233
- integer height = 96
- integer taborder = 40
- boolean bringtotop = true
- string text = "删除"
- end type
- event clicked;long li_row
- li_row=dw_credenceword_index.getrow()
- if li_row=0 then
- messagebox(publ_operator,'没有可删除凭证字')
- return
- end if
- dw_credenceword_index.deleterow(li_row)
- end event
- type tabpage_3 from userobject within tab_accsetinfo
- integer x = 18
- integer y = 112
- integer width = 2007
- integer height = 940
- long backcolor = 80269524
- string text = "会计月历"
- long tabtextcolor = 33554432
- long tabbackcolor = 80269524
- string picturename = "Custom023!"
- long picturemaskcolor = 553648127
- em_1 em_1
- st_2 st_2
- dw_3 dw_3
- cb_2 cb_2
- cb_7 cb_7
- end type
- on tabpage_3.create
- this.em_1=create em_1
- this.st_2=create st_2
- this.dw_3=create dw_3
- this.cb_2=create cb_2
- this.cb_7=create cb_7
- this.Control[]={this.em_1,&
- this.st_2,&
- this.dw_3,&
- this.cb_2,&
- this.cb_7}
- end on
- on tabpage_3.destroy
- destroy(this.em_1)
- destroy(this.st_2)
- destroy(this.dw_3)
- destroy(this.cb_2)
- destroy(this.cb_7)
- end on
- type em_1 from editmask within tabpage_3
- integer x = 366
- integer y = 48
- integer width = 370
- 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
- borderstyle borderstyle = stylelowered!
- string mask = "####"
- boolean spin = true
- end type
- event constructor;IF sys_accsetbegin THEN
- This.Text = Left(String(sys_curyearmon),4)
- ELSE
- IF sys_startyearmon = 0 THEN
- This.Text = String(Today(),'yyyy')
- ELSE
- This.Text = Left(String(sys_startyearmon),4)
- END IF
- END IF
- end event
- event modified;cb_2.triggerevent(clicked!)
- end event
- type st_2 from statictext within tabpage_3
- integer x = 82
- integer y = 68
- integer width = 283
- 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
- boolean enabled = false
- string text = "会计年度:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type dw_3 from datawindow within tabpage_3
- integer x = 841
- integer y = 12
- integer width = 1015
- integer height = 916
- integer taborder = 30
- boolean bringtotop = true
- string dataobject = "dw_accset_info3"
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- type cb_2 from uo_imflatbutton within tabpage_3
- integer x = 741
- integer y = 48
- integer width = 91
- integer height = 92
- integer taborder = 50
- boolean bringtotop = true
- string text = ".."
- end type
- event clicked;dw_3.retrieve(sys_accsetid,long(em_1.text))
- end event
- type cb_7 from uo_imflatbutton within tabpage_3
- integer x = 430
- integer y = 156
- integer width = 384
- integer height = 92
- integer taborder = 50
- boolean bringtotop = true
- string text = "重新生成月历"
- end type
- event clicked;Long next_y,ll_cnt_next_y
- s_calendar s_calendar_array[]
- String arg_msg
- IF MessageBox (publ_operator,"是否确定要重置月历?(选择确定后先删除原月历,再重新生成新的月历)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- next_y = Long(Left(em_1.Text,4))
- DELETE FROM cw_calendar Where accsetid = :sys_accsetid;
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示','删除原月历失败,'+arg_msg)
- RETURN
- END IF
- f_init_calendar_array(next_y,s_calendar_array[])
- Long k
- FOR k = 1 TO UpperBound(s_calendar_array)
- INSERT INTO cw_calendar(accsetid,cmonth,sdate,edate)
- Values(:sys_accsetid,:s_calendar_array[k].cmonth,:s_calendar_array[k].sdate,:s_calendar_array[k].edate);
- IF sqlca.SQLCode <> 0 THEN
- arg_msg = String(s_calendar_array[k].cmonth)+',加入新月历失败,'+sqlca.SQLErrText
- ROLLBACK;
- MessageBox('提示',arg_msg)
- RETURN
- END IF
- NEXT
- COMMIT;
- MessageBox('提示','操作完成')
- //日志
- String ls_code
- ls_code = publ_operator
- f_setsysoplog('重置月历','重置月历,用户:'+ls_code,arg_msg,TRUE)
- //--
- cb_2.TriggerEvent(Clicked!)
- end event
- type tabpage_4 from userobject within tab_accsetinfo
- integer x = 18
- integer y = 112
- integer width = 2007
- integer height = 940
- long backcolor = 80269524
- string text = "凭证选项"
- long tabtextcolor = 33554432
- long tabbackcolor = 80269524
- string picturename = "Start!"
- long picturemaskcolor = 553648127
- dw_4 dw_4
- end type
- on tabpage_4.create
- this.dw_4=create dw_4
- this.Control[]={this.dw_4}
- end on
- on tabpage_4.destroy
- destroy(this.dw_4)
- end on
- type dw_4 from datawindow within tabpage_4
- integer x = 233
- integer y = 104
- integer width = 1330
- integer height = 736
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_accset_info4"
- boolean border = false
- boolean livescroll = true
- end type
- type cb_1 from uo_imflatbutton within w_accset_info
- integer x = 617
- integer y = 1116
- integer width = 311
- integer height = 96
- integer taborder = 30
- boolean bringtotop = true
- string normalpicname = "ok.bmp"
- end type
- event clicked;String ls_errmsg
- dw1.AcceptText()
- IF dw1.UPDATE() = -1 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",保存企业信息操作失败!",Exclamation!,OK!)
- RETURN
- END IF
- dw2.AcceptText()
- IF dw2.UPDATE() = -1 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",保存帐套代号信息操作失败!",Exclamation!,OK!)
- RETURN
- END IF
- tab_accsetinfo.tabpage_2.dw_credenceword_index.AcceptText()
- IF tab_accsetinfo.tabpage_2.dw_credenceword_index.UPDATE() = -1 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",保存帐套参数操作失败!",Exclamation!,OK!)
- RETURN
- END IF
- dw3.AcceptText()
- IF dw3.UPDATE() = -1 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",保存会计月历操作失败!",Exclamation!,OK!)
- RETURN
- END IF
- dw4.AcceptText()
- IF dw4.UPDATE() = -1 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",保存凭证选项操作失败!",Exclamation!,OK!)
- RETURN
- END IF
- IF NOT sys_accsetbegin THEN
-
- s_calendar l_s_calendar[]
- Long arg_year
- String arg_msg
- arg_year = dw4.Object.startyear[1]
- f_init_calendar_array(arg_year,l_s_calendar[])
-
- DELETE FROM cw_calendar Where accsetid = :sys_accsetid;
- IF sqlca.SQLCode <> 0 THEN
- ls_errmsg = "因为网络或其他原因>"+sqlca.SQLErrText
- ROLLBACK;
- MessageBox (publ_operator,ls_errmsg+",删除原日历操作失败!",Exclamation!,OK!)
- RETURN
- END IF
-
-
- uo_accset uo_newaccset
- uo_newaccset = CREATE uo_accset
-
- uo_newaccset.accsetid = sys_accsetid
-
- IF uo_newaccset.new_calendar(l_s_calendar[],arg_msg,FALSE) = 0 THEN
- MessageBox(publ_operator,arg_msg)
- RETURN
- END IF
-
- DESTROY uo_newaccset
-
- END IF
- COMMIT;
- MessageBox(publ_operator,'帐套选项保存成功,系统将退出,请重新进入系统')
- HALT
- end event
|