资源预览内容
第1页 / 共52页
第2页 / 共52页
第3页 / 共52页
第4页 / 共52页
第5页 / 共52页
第6页 / 共52页
第7页 / 共52页
第8页 / 共52页
第9页 / 共52页
第10页 / 共52页
亲,该文档总共52页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
账务处理系统程序设计参考答案1、科目维护表单(ZW11.SCX) FORM1数据环境:KJKM.DBF (指定主控索引KMM) KMYE.DBF 两个表以独占方式打开FORMSET INIT代码:PUBLIC KM1,N1,N2 THISFORMSET.FORM2.HIDE THISFORMSET.FORM3.HIDE THISFORMSET.FORM4.HIDE SET DELE ONFORM1:会计科目维护 COMMAND1 (新增)CLICK代码: THISFORMSET.FORM2.SHOW COMMAND2 (删除)CLICK代码: THISFORMSET.FORM4.SHOW THISFORMSET.FORM4.TEXT1.VALUE=KJKM.KMM THISFORMSET.FORM4.TEXT2.VALUE=KJKM.MC COMMAND3 (修改)CLICK代码: THISFORMSET.FORM3.SHOW THISFORMSET.FORM3.TEXT1.VALUE=KJKM.KMM SELECT KJKM KM1=TRIM(KJKM.KMM) PZBH WITH THISFORM.TEXT1.VALUE,SR WITH THISFORM.XM.VALUE SELE PZ SCAN FOR JJE#0 OR DJE#0SELE PZDAPPE BLANREPL PZLX WITH PZBH.LX,;PZBH WITH THISFORM.TEXT1.VALUE,ZY WITH PZ.ZY,;KMM WITH PZ.KMM,JJE WITH PZ.JJE,DJE WITH PZ.DJESELE PZ ENDSCAN REPL ALL ZY WITH ,KMM WITH ,JJE WITH 0,DJE WITH 0 THISFORMSET.ZY= SELE PZBH REPL BH WITH VAL(THISFORM.TEXT1.VALUE) THISFORMSET.XSPZ THISFORM.JFHJ.VALUE=0 THISFORM.DFHJ.VALUE=0 THISFORM.MC.VALUE=SPAC(33) THISFORM.REFRESHFORM1.COMMAND2(退出)CLICK代码:SELE PZREPL ALL ZY WITH ,KMM WITH ,JJE WITH 0,DJE WITH 0RELE THISFORMSETFORM2.COMMAND1(确定)CLICK代码:THISFORMSET.FORM1.GRID1.COLUMN2.TEXT1.VALUE=KJKM.KMMTHISFORMSET.FORM1.MC.VALUE=KJKM.MC THISFORM.HIDEFORM2.GRDKJKM.COLUMN1.TEXT1(科目码)DBLCLICK代码:FORM2.GRDKJKM.COLUMN2.TEXT1(科目名称)DBLCLICK代码:(代码与COMMAND1的CLICK代码相同)5、凭证修改表单(ZW22.SCX) 6、查询记账凭证(ZW23.SCX)表单 数据环境:KJKM.DBF, PZM.DBF, PZMA.DBF 在数据环境中为KJKM表指定Order为KMM,Filter为 NOT MX 为表单添加新方法“XSPZ”,用来指定对应凭证颜色及凭证内容: DO CASECASE PZMA.PZLX=收款THISFORM.GRID1.BACKCOLOR=RGB(240,200,160)CASE PZMA.PZLX=付款THISFORM.GRID1.BACKCOLOR=RGB(0,255,0)CASE PZMA.PZLX=转帐THISFORM.GRID1.BACKCOLOR=RGB(160,200,240) ENDCASE SELE PZM SUM(PZM.JJE) TO A THISFORM.JFHJ.VALUE=A SUM(PZM.DJE) TO A THISFORM.DFHJ.VALUE=A GO TOP THISFORM.GRID1.COLUMN2.SETFOCUS()表单的INIT代码: SELE PZM SET RELA TO KMM INTO KJKM SELECT PZMA GO TOP THISFORM.XSPZ COMBO1对象 Row Source为: SELE PZLX,PZBH FROM PZMA INTO CURS PZTMPRow Source Type为:3SQL语句 ColumnCount : 2Inter Active Change代码为: SELECT PZMA LOCA FOR PZLX=PZTMP.PZLX AND PZBH=PZTMP.PZBH THISFORM.XSPZ表格对象GRID1 INIT代码:SELECT PZMSET FILT TO PZLX=PZMA.PZLX AND PZBH=PZMA.PZBHGO TOPTHIS.REFRESHGRID1.Column2.text1 GotFocus代码( 会计科目列)THISFORM.MC.VALUE=KJKM.MCTHIS.REFRESH“首张凭证”命令按钮CLICK代码:SELECT PZMAGO TOPTHISFORM.XSPZ “下一张凭证”命令按钮CLICK代码: SELECT PZMA SKIP IF EOF()GO BOTT ENDIF THISFORM.XSPZ “上一张凭证”命令按钮CLICK代码: SELECT PZMA SKIP -1 IF BOF()GO TOP ENDIF THISFORM.XSPZ “末张凭证”命令按钮CLICK代码: SELECT PZMA GO BOTT THISFORM.XSPZ “退出”命令按钮CLICK代码: RELE THISFORM7、记账凭证审核(ZW24.SCX)表单 数据环境:KJKM.DBF, PZD.DBF, PZDA.DBF 在数据环境中为KJKM表指定Order为KMM,Filter为 NOT MX 为表单添加新方法“XSPZ”,用来指定对应凭证颜色及凭证内容: DO CASECASE PZDA.PZLX=收款THISFORM.GRID1.BACKCOLOR=RGB(240,200,160)CASE PZDA.PZLX=付款THISFORM.GRID1.BACKCOLOR=RGB(0,255,0)CASE PZDA.PZLX=转帐THISFORM.GRID1.BACKCOLOR=RGB(160,200,240) ENDCASE SELE PZD SUM(PZD.JJE) TO A THISFORM.JFHJ.VALUE=A SUM(PZD.DJE) TO A THISFORM.DFHJ.VALUE=A GO TOP THISFORM.REFRESH THISFORM.GRID1.COLUMN2.SETFOCUS()表单的INIT代码:SELECT PZD SET RELA TO KMM INTO KJKM SELECT PZDA GO TOP THISFORM.XSPZ COMBO1对象 Row Source为:SELE PZLX,PZBH FROM PZDA INTO CURS PZTMPRow Source Type为:3SQL语句 ColumnCount: 2Inter Active Change代码为:SELE PZDA LOCA FOR PZLX=PZTMP.PZLX AND PZBH=PZTMP.PZBH THISFORM.XSPZ表格对象GRID1 INIT代码:SELECT PZDSET FILT TO PZLX=PZDA.PZLX AND PZBH=PZDA.PZBHGO TOPTHIS.REFRESH GRID1.Column2.text1 Got Focus代码( 会计科目列)THISFORM.MC.VALUE=KJKM.MCTHIS.REFRESH “首张凭证”命令按钮CLICK代码:SELECT PZDAGO TOP THISFORM.XSPZ “下一张凭证”命令按钮CLICK代码: SELECT PZDA SKIP IF EOF()GO BOTT ENDIF THISFORM.XSPZ “上一张凭证”命令按钮CLICK代码: SELECT PZDA SKIP -1 IF BOF()GO TOP ENDIF THISFORM.XSPZ “末张凭证”命令按钮CLICK代码: SELECT PZDA GO BOTT THISFORM.XSPZ“本凭证审核”命令按钮CLICK代码: SELECT PZDA REPL SH WITH M.XM THISFORM.REFRESH “消审”命令按钮CLICK代码: SELECT PZDA REPL SH WITH THISFORM.REFRESH “全部凭证审核”命令按钮CLICK代码: SELECT PZDA N=RECN() REPL ALL SH WITH M.XM GO N THISFORM.REFRESH “退出”命令按钮CLICK代码: RELE THISFORM8、查询总分类账(ZW31.SCX)表单 数据环境:KJKM.DBF 为KJKM表指定Order为KMM FORM OPTIONGROUP1 CLICK代码: IF THIS.VALUE=1SET FILT TO ELSESET FILT TO LEN(TRIM(KMM)=4 ENDIF GO TOP THISFORM.REFRESH9、查询日记账(ZW32.SCX)表单 数据环境:KJKM.DBF, MXZ.DBF, RJZ.DBF 在数据环境中为KJKM表指定Order为KMM RJZ表以独占方式打开创建FORM方法XSRJZ,内容如下: THISFORM.LABEL1.CAPTION=KMMC+“日记帐(已记帐凭证)“ SELE KJKM SEEK KMDM JJ=JE0 SELE MXZ COPY TO ARRA ABC FOR KMM=KMDM FIEL RQ,PZH,ZY,JJE,DJE,DFKM SELE RJZ ZAP APPE FROM ARRA ABC FIEL RQ,PZH,ZY,JJE,DJE,KMM SCANREPL JE0 WITH JJ,JE1 WITH JE0+JJE-DJEJJ=JE1 ENDSCAN GO TOP SET RELA TO KMM INTO KJKM THISFORM.REFRESHFORM INIT 代码: KMDM=“1001“ KMMC=“现金“ SET SAFE OFF &关闭警告信息 THISFORM.XSRJZ列表框LIST1的CLICK代码: SELE RJZ SET RELA TO &解除KJKM表与RJZ表间的关联 DO CASECASE THIS.VALUE=“现金“KMDM=“1001“KMMC=“现金“CASE THIS.VALUE=“工行存款“KMDM=“100201“KMMC=“工行存款“CASE THIS.VALUE=“中行存款“KMDM=“100202“KMMC=“中行存款“ ENDCASE THISFORM.XSRJZFORM GRID1 AFTERROWCOLCHANGE代码:LPARAMETERS nColIndexTHISFORM.DFKMMC.CAPTION=TRIM(KJKM.MC)THISFORM.REFRESH退出按钮CLICK代码:RELE THISFORM10、查询明细账(ZW33.SCX)表单 数据环境:KJKM.DBF, MXZ.DBF 在数据环境中为KJKM表指定Order为KMMFORM INIT 代码: SELE KJKM COPY TO DF GO TOP
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号