审计署 计算机审计中级科目表及字段名及课后练习

更新时间:2024-01-03 12:23:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

1、运用的主要会计科目: (1)101 现金 (2)102 银行存款 (3)113 应收账款 (4)221 应交税金

(5)501 主营业务收入(U8系统999帐套用的是“产品销售收入”) (6)502 主营业务成本(U8系统999帐套用的是“产品销售成本”) (7)504 主营业务税金及附加(U8系统999帐套用的是“产品销售税金及附加”)

2、运用的会计科目

(1)借:101 现金 借:102 银行存款 贷:102 银行存款 贷:101 现金 (2) 借:101 现金/102 银行存款/113应收账款 贷:501 产品销售收入 221 应交税金

如果发生退货,上述科目发生额为负值 (3) 借:502 产品销售成本 贷:137 产成品等

(4) 借:504 产品销售税金及附加 贷:221 应交税金等科目 3、运用的业务数据

销售发票<——>销售发货<——>销售订单 4、需要记住的数据表名(用友U8的999帐套) (1)科目代码表:code (2)凭证表:gl_accvouch (3)科目余额表:gl_accsum (4)销售发票主表:salebillvouch (5)销售发票子表:salebillvouchs (6)发货单主表:dispatchlist (7)发货单子表:dispatchlists (8)销售订单主表:So_somain (9)销售订单子表:so_sodetails

科目表(code)字段及业务理解 ccode 科目编码-处理账务和描述状态 ccode-name 科目名称--对科目编码的描述 igrade 科目级次 --用于科目发生额的汇总

bproperty 科目方向--描述本科目的增减或者流入和流出 bend 是否末级科目--用于记录发生业务的科目

科目余额表(gl_accsum) ccode 科目代码, iperiod 会计期间, cbegind_c 期初余额方向, mb 期初余额, md 借方发生额合计, mc 贷方发生额合计, cendd_c 期末余额方向, me 期末余额

凭证表(gl_accvouch) i_id, ---自动编号(顺序号) iperiod,---会计期间 csign, ---凭证类别 ino_id, --- 凭证号 inid, ---分录序号 dbill_date, --- 制单日期 idoc, --附件张数 cbill, ---制单人 ccheck,----审核人 cbook,---记账人

ibook,---记账标志--为‘1’表示已记账 iflag,---作废标记--null表示为空即为不作废 cdigest,---摘要 --简要说明业务内容 ccode, -----科目编码---用于账户核算 md, ---借方金额--业务发生数

mc, ---贷方金额--业务发生数 ccode_equal, ---对方科目 coutbillsign,---外部单据类别-- coutid --外部单据号

一、销售发货单主表(dispatchlist)字段及业务理解 select * from dispatchlist select

DLID --发货单连接号 cdlcode ---发货单号 cvouchtype ---发货单类型 cstcode --销售类型编码 ddate --发货日期 cdepcode --部门编号 cpersoncode --人员编号 SBVID ---发票id csbvcode --发票编号 csocode --订单号 ccuscode --客户号 from dispatchlist order by 1

二、销售发货单子表(dispatchlists)字段及业务理解

select * from dispatchlists select

DLID --发货单连接号 cwhcode --仓库编码 cinvcode --存货编码 iquantity, --数量

inatmoney, --无税金额 inattax, --税金

inatsum --本币含税金额 inatunitprice --本币单价

from dispatchlists order by 1

三、主子表连接字段 (DLID) select

DLID --发货单连接号 cdlcode ---发货单号 cvouchtype ---发货单类型 cstcode --销售类型编码 ddate --发货日期 cdepcode --部门编号 cpersoncode --人员编号 SBVID ---发票id csbvcode --发票编号 csocode --订单号 ccuscode --客户号 DLID --发货单连接号 cwhcode --仓库编码 cinvcode --存货编码 iquantity, --数量

inatmoney, --无税金额 inattax, --税金

inatsum --本币含税金额 inatunitprice --本币单价 from dispatchlist a join dispatchlists b on a.DLID=b. DLID

---发票主表(salebillvouch)字段及业务理解 select * from salebillvouch select

SBVID --发票ID

csbvcode --发票编号 cvouchtype --发票类型 cstcode --销售类型编码 ddate --开票日期 cdepcode --部门编号 cpersoncode --人员编号 csocode --订单编号 ccuscode --客户编号 from salebillvouch order by 1

二、发票子表(salebillvouchs)字段及业务理解 select * from salebillvouchs select

SBVID --发票ID cwhcode --仓库编码 cinvcode --存货编号 iquantity, --数量 inatunitprice, --无税单价 inatmoney, --无税金额 inattax, --税金 inatsum --含税金额 from salebillvouchs order by 1

--主子表连接(SBVID) select

SBVID --发票ID csbvcode --发票编号 cvouchtype --发票类型 cstcode --销售类型编码 ddate --开票日期 cdepcode --部门编号 cpersoncode --人员编号

csocode --订单编号 ccuscode --客户编号 SBVID --发票ID cwhcode --仓库编码 cinvcode --存货编号 iquantity, --数量 inatunitprice, --无税单价 inatmoney, --无税金额 inattax, --税金 inatsum --含税金额

from salebillvouch a join salebillvouchs b on a.SBVID=b.SBVID order by 1

--一、销售订单主表so_somain 字段及业务理解 select *

cstcode --销售类型代码 ddate --订单日期 csocode --订单号 ccuscode --客户编号 cdepcode --部门编号 from so_somain

--二、销售订单子表(so_sodatails)字段及业务理解 select * from so_sodetails select

csocode, ---订单号 cinvcode, ---存货编码 dpredate, --预发货日期 iquantity, --数量 inatunitprice, --无税单价 inatmoney, --无税金额 inattax, --税金 inatsum --含税金额

from so_sodetails order by csocode

--三、主子表的连接 csocode select

cstcode, --销售类型代码 ddate, --订单日期 a.csocode, --订单号 ccuscode, --客户编号 cdepcode, --部门编号 cinvcode, ---存货编码 dpredate, --预发货日期 iquantity, --数量 inatunitprice, --无税单价 inatmoney, --无税金额 inattax, --税金 inatsum --含税金额

from so_somain a join so_sodetails b on a.csocode=b.csocode 第六章: --第一题

-----------------------------------------------------------------------------------------------

--1利用凭证表查询收字月份号凭证 select * from gl_accvouch

where csign='收' and iperiod=10 and ino_id='2'

--select *

--from gl_accvouch a join gl_accvouch b on a.iperiod=b.iperiod and a.csign=b.csign and a.ino_id=b.ino_id

--where a.csign='收' and a.iperiod=10 and b.ino_id='2' --2检索出所有现金支出在元以上的记录/凭证 select * from gl_accvouch

where ccode like '101' and mc<0

select * from dbo.GL_accvouch

where iperiod=10 and csign='付' and ino_id=12

select * from code where ccode='203'

select * from gl_accvouch

where ccode='203' and mc>10000

--3cname字段记录了业务经手人,请以该字段为分组依据,计算各位经手人的现金支出金额和业务笔数

select cname,count(mc),sum(mc) from gl_accvouch where ccode like '101' and mc<>0 group by cname

select * from gl_accvouch where cname IS NULL

select * from gl_accvouch

where iperiod=10 and csign='收' and ino_id=2 --4检索出现金支出为整万元的记录 select * from gl_accvouch where ccode like '101' and mc>0

and cast(mc/1000.00 as int)=mc/1000.00 --5计算出各月的现金支出合计数

select iperiod,sum(mc) from GL_accvouch where ccode like '101' group by iperiod

--6创建一个视图,视图中包含以下内容供审计人员浏览查看(期间,凭证类别,凭证号,科目代码,摘要,借方金额,贷方金额,对方科目

create view st(期间,凭证类别,凭证号,科目代码,摘要,借方金额,贷方金额,对方科目)

as

select iperiod,csign,ino_id,ccode,cdigest,md,mc,ccode_equal from GL_accvouch

--7检索出摘要中包含“劳务”、“费用”等内容的记录 select * from GL_accvouch

where cdigest like '%劳务%' or cdigest like '%费用%'

--8截止测试中关注期前期后事项,请检索出月份的主营业务收入明细记录 select * from code

where ccode_name like '%收入%' select * from GL_accvouch

where iperiod=12 and ccode like '501%'

--9审计人员为检查凭证表的有效、完整性,对凭证文件借方发生额、贷方发生额进行求和,以检查借贷方是否平衡

select sum(md),sum(mc) from GL_accvouch

select iperiod,csign,ino_id,sum(md),sum(mc) from gl_accvouch group by iperiod,csign,ino_id having sum(mc)<>sum(md)

select * from gl_accvouch where ccode like '102%'

where iperiod=0 and csign='付' and ino_id=18

select * from code where ccode='11902'

--10汇总出各总账科目借贷方合计发生额

select left(ccode,3),sum(md),sum(mc) from gl_accvouch group by left(ccode,3) order by left(ccode,3)

select ccode,sum(md),sum(mc) from gl_accvouch

where len(ccode)=3 group by ccode --第二题

select * from gl_accsum order by ccode

--()检索出各总账科目的年初余额 select ccode,cbegind_c,mb from gl_accsum

where len(ccode)=3 and iperiod =1 order by ccode

--(2)检索出各总账科目的各月借贷方发生额 select ccode,iperiod,md,mc from gl_accsum where len(ccode)=3 order by ccode

--(3)检索出销售收入与销售成本科目各月发生额,供审计人员对比分析 select a.ccode ,a.iperiod, a.md,a.mc,b.ccode ,b.iperiod, b.md,b.mc from gl_accsum a join gl_accsum b on a.iperiod=b.iperiod

where a.ccode like '501%' and b.ccode like '502%'

select mc,md from

where ccode like '501%' and b.ccode like '502%'

--(3)检索出销售收入贷方与销售成本科目借方各月发生额,供审计人员对比分析

select a.ccode ,a.iperiod,a.mc,b.ccode ,b.md

from gl_accsum a join gl_accsum b on a.iperiod=b.iperiod where a.ccode like '501%' and b.ccode like '502%'

select mc,ccode ,md,iperiod from dbo.GL_accsum

where ccode like '501%' or ccode like '502%' --(4)检索出各总账科目的年末余额

select ccode,cendd_c,me from gl_accsum where len(ccode)=3 and iperiod=12

select * from gl_accsum

where len(ccode)=3 and cbegind_c not like cendd_c

select ccode,cbegind_c,me from gl_accsum

where len(ccode)=3 and iperiod =12 order by ccode

--(5)检索出收入科目(总账和明细账科目)各月贷方发生额 --(查找哪些科目编码是收入科目) select ccode,ccode_name from code where ccode_name like '%收入%' -- 检索收入科目各月贷方发生额 select ccode,iperiod, mc from gl_accsum where ccode like '501'

or ccode like '511' or ccode like '541'

--(6)检索出销售收入与销售成本(总账)科目各月发生额

select a.ccode,a.iperiod,a.md,a.mc,b.ccode,b.iperiod,b.md,b.mc from gl_accsum a join gl_accsum b on a.iperiod=b.iperiod

where a.ccode like '501' and b.ccode like '502' 年末余

--()检索出应收账款(总账和明细账)科目的额

select me,ccode,cbegind_c from dbo.GL_accsum

where ccode like '113%' and iperiod=12

select ccode,ccode_name from code

where ccode_name like '%应收%'

select ccode,me,cendd_c from gl_accsum

where ccode like '113%' and iperiod =12

select iperiod,cbegind_c,mb,md,mc,md-mc 发生额, me,cendd_c from gl_accsum where ccode like '113' order by iperiod

------------------------------------------------------------------------------------------------------- --第三题

select * from gl_accvouch select * from code --P235.第三题

--(1)创建一个视图,视图中包含以下内容供审计人员浏览查看,(期间、凭证类型、凭证号、科目代码、科目名称、 --摘要、借方金额、贷方金额、对方科目)

create view a_1(期间,凭证类型,凭证号,科目代码,科目名称,摘要,借方金额,贷方金额,对方科目) as select

a.iperiod,a.csign,ino_id,a.ccode,b.ccode_name,a.cdigest,a.md,a.mc,a.ccode_equal

from gl_accvouch a join code b on a.ccode=b.ccode

select * from a_1

order by 期间,凭证类型,凭证号,科目代码

--(2)创建一个视图,视图中包含以下内容供审计人员浏览查看, --(总账科目代码,总账科目名称,年初余额方向,

--年初余额) select * from code select * from gl_accsum

create view a_2(总账科目代码,总账科目名称,年初余额方向,年初余额) as

select a.ccode,a.ccode_name,b.cbegind_c,b.mb from code a join gl_accsum b on a.ccode=b.ccode

where len(b.ccode)=3 and b.iperiod=1 第七章

第七章习题

--/*278页第一题:整理生成新的科目代码表,要求包含三个字段(ccode科目代码,科目名称,科目末级标志)。 科目代码的级次结构为.*/

select km.ccode,km.bend,kmqc=k1.ccode_name+ case when len(km.ccode)>3 then '\\'+k2.ccode_name else '' end+ case when len(km.ccode)>6 then '\\'+k3.ccode_name else '' end+ case when len(km.ccode)>10 then '\\'+k4.ccode_name else '' end from CODE km

join CODE k1 on left(km.ccode,3)=k1.ccode join CODE k2 on left(km.ccode,6)=k2.ccode join CODE k3 on left(km.ccode,10)=k3.ccode join CODE k4 on left(km.ccode,14)=k4.ccode ORDER BY km.CCODE

--2、检索出月份登记主营业务收入科目的记账凭证

select a.* from gl_accvouch a join gl_accvouch b on a.iperiod=b.iperiod and a.csign=b.csign and a.ino_id=b.ino_id

where b.iperiod=11 and b.ccode like '501%' order by a.iperiod,a.csign,a.ino_id,a.inid

--3.(检索出所有通过应收帐款科目核算主营业务收入的记帐凭证)表C用于查询输出符合条件的凭证内容;表A用于设置借方检索条件,表B用于设置贷方检

索条件

if (select object_id('a2')) is not null drop table a2

select c.* from gl_accvouch a join gl_accvouch b on a.csign=b.csign and a.iperiod=b.iperiod and a.ino_id=b.ino_id join gl_accvouch c

on c.csign=a.csign and c.iperiod=a.iperiod and c.ino_id=a.ino_id where b.ccode like '501%' and b.mc<>0 and a.ccode like '113%' and a.md<>0

--第四题:查找出确认收入时漏记税款的记录(确认收入时,未同时计提应交税金的记录)

--分析:即做记帐凭证时,贷收入而未同时贷应交税金的记录

if (select object_id('a_501')) is not null drop VIEW a_501

create view a_501 as

select * from gl_accvouch

where ccode like '501%' and mc<>0 go

if (select object_id('a_221')) is not null drop VIEW a_221

create view a_221 as

select * from gl_accvouch

where ccode like '221%' and mc<>0

select * from gl_accvouch

where ccode like '221%' and mc<>0

select a.* from a_501 a left join a_221 b

on a.csign=b.csign and a.iperiod=b.iperiod and a.ino_id=b.ino_id

where b.ccode is null

------------------------------------------------------------------------------------------------- P278.第五题

/*审计人员为检查所转换数据的有效完整,需要汇总出凭证文件(gl_accvouch)中各科目的各月发生额

与余额文件(gl_accsum)相关科目的发生额进行一致性检查。 请编写程序完成。*/

select * from gl_accvouch select * from gl_accsum

create view a_3 --凭证表数据

as

select ccode,iperiod,sum(md) summd,sum(mc) summc from gl_accvouch

group by iperiod,ccode ORDER BY iperiod,ccode --全连接

select a.ccode 科目代码,a.iperiod 余额表会计期间 ,b.iperiod 凭证表会计期间,md 余额表借方合计,mc 余额表贷方合计,

isnull(summd,0) 凭证表借方合计,isnull(summc,0) 凭证表贷方合计 from gl_accsum a

full join a_3 b on a.ccode=b.ccode and a.iperiod=b.iperiod where isnull(a.md,0)<>isnull(b.summd,0) or

isnull(a.mc,0)<>isnull(b.summc,0) --or a.ccode is null--or b.ccode is null

order by a.ccode,a.iperiod,b.iperiod P278.第六题

--从gl_accvouch表中检索计算出各月的销售收入、销售成本、税金(产品销售税金及附加,并计算各月的销售毛利率。

--毛利率=(销售收入-isnull销售成本-isnull税金)/销售收入) select * from gl_accvouch

select * from code where ccode_name like '%税金%'

create view a_sr

as

select ccode,iperiod,sum(mc) sum_shouru from gl_accvouch where ccode=501

group by ccode,iperiod

create view a_cb as

select ccode,iperiod,sum(md) sum_chengben from gl_accvouch where ccode=502

group by ccode,iperiod

create view a_sj as

select ccode,iperiod,sum(md) sum_shuijin from gl_accvouch where ccode=504

group by ccode,iperiod

select isnull(a.iperiod,isnull(b.iperiod,c.iperiod)) 月份,isnull(sum_shouru,0) 收入, isnull(sum_chengben,0) 成本, isnull(sum_shuijin,0) 税金, 毛利率=case

when isnull(sum_shouru,0)=0 then 9999 else

(isnull(sum_shouru,0)-isnull(sum_chengben,0)-isnull(sum_shuijin,0))/isnull(sum_shouru,0) end

from a_sr a

full join a_cb b on a.iperiod=b.iperiod full join a_sj c on a.iperiod=c.iperiod

/*7.审计人员为了进行帐表核对,需要根据帐户主文件(gl_accsum)中所记录的年初余额

和交易文件(gl_accvouch)中所记录的交易数据,汇总计算出各总帐科目的年

初余额和年末余额

--查询结果中应包括三个字段(科目代码,年初余额,年末余额),其中余额的方向通过金额的正负来表示。*/

if(select object_id('v_jye')) is not null drop view v_jye go

create view v_jye as

select left(ccode,3) ccode1,sum(md)-sum(mc) jyje from gl_accvouch

group by left(ccode,3)

select * from v_jye

if(select object_id('v_nc')) is not null drop view v_nc go

create view v_nc as

select top 100 percent ccode, ncje=

case when cbegind_c='借' then mb else mb*(-1) end from gl_accsum

where len(ccode)=3 and iperiod=1 order by ccode

select a.ccode,a.ncje,isnull(a.ncje,0)+isnull(b.jyje,0) nmje

from v_nc a

full join v_jye b on a.ccode=b.ccode1 order by a.ccode

P278第八题

--8.计算各月通过赊销方式实现的销售收入

select a.iperiod,sum(a.mc) from gl_accvouch a join gl_accvouch b on

a.iperiod=b.iperiod and a.csign=b.csign and

a.ino_id=b.ino_id

where b.ccode like '113%' and a.ccode like '501%' group by a.iperiod

select a.iperiod,sum(a.mc) from gl_accvouch a join gl_accvouch b on

a.iperiod=b.iperiod and a.csign=b.csign and a.ino_id=b.ino_id

join gl_accvouch c on

c.iperiod=b.iperiod and c.csign=b.csign and c.ino_id=b.ino_id

where b.ccode like '113%' and c.ccode like '501%' group by a.iperiod

第九章

--P320第一题检查发货单是否连续编号(断号、重号)dispatchlist --断号

select * from dispatchlist

select cvouchtype,max(cdlcode) 发货单号,min(cdlcode) 最大号,count(distinct cdlcode) 计数

from dispatchlist group by cvouchtype

having cast(max(cdlcode)as int)- cast(min(cdlcode) as int)+1<>count(distinct cdlcode) --重号

select cvouchtype,cdlcode,count(*) from dispatchlist group by cvouchtype,cdlcode having count(*)>1

-- P320第二题检索出所有未登记主营业务收入明细账的发票 if (select object_id('v_501')) is not null drop view v_501

create view v_501 as

select * from gl_accvouch where ccode like '501%'

select a.* from salebillvouch a

left join v_501 b on a.cvouchtype=b.coutbillsign and a.csbvcode=b.coutid where b.coutid is null

-- P320第三题审计人员为检查主营业务收入记账金额是否准确, --将主营业务收入明细账与相关发票金额进行核对

if (select object_id('v_fp')) is not null drop view v_fp

create view v_fp as

select a.cvouchtype,a.csbvcode,sum(b.inatmoney) fpje from salebillvouch a join salebillvouchs b on a.sbvid=b.sbvid

group by a.cvouchtype,a.csbvcode

select

a.iperiod,a.csign,a.ino_id,b.cvouchtype,b.csbvcode,a.mc,b.fpje

from gl_accvouch a

join v_fp b on a.coutbillsign=b.cvouchtype and a.coutid=b.csbvcode

where a.ccode like '501%' and a.mc<>b.fpje

-- P320第四题检查每笔业务从发货到记账凭证制单之间相差天数,结果按相差天数降序排列 select

c.iperiod,c.csign,c.ino_id,c.ccode,a.ddate,c.dbill_date, datediff(day,a.ddate,c.dbill_date) as ts from dispatchlist a

join salebillvouch b on a.sbvid=b.sbvid join gl_accvouch c

on b.cvouchtype=c.coutbillsign and b.csbvcode=c.coutid --where c.ccode like '501%'

order by datediff(day,a.ddate,c.dbill_date) desc

select distinct

c.iperiod,c.csign,c.ino_id,c.ccode,a.ddate,c.dbill_date, datediff(day,a.ddate,c.dbill_date) as ts from dispatchlist a

join salebillvouch b on a.sbvid=b.sbvid join gl_accvouch c

on b.cvouchtype=c.coutbillsign and b.csbvcode=c.coutid --where c.ccode like '501%'

order by datediff(day,a.ddate,c.dbill_date) desc

-- P320第五题

/*5 发票中登记了销售商品的价格,通过检查商品最高售价与最低售价之比,可以发现异常的销售行为。

检索计算出各种商品销售的最高售价与最低售价之比,查询结果包括(商品代码(存货编码cinvcode)、最高售价最低售价比),结果按上述比率降序排列*/

select cinvcode 商品代

码,max(inatunitprice)/min(inatunitprice) 售价金额比 from salebillvouchs group by cinvcode

order by max(inatunitprice)/min(inatunitprice) desc -- P320第六题检查主营业务收入明细账记录中所登记发票是否连续编号(断号、重号) --断号

select

iperiod,coutbillsign,max(coutid),min(coutid),count(distinct coutid)

from gl_accvouch

where ccode like '501%' --and mc<>0 group by coutbillsign,iperiod --重号

select coutbillsign,coutid,count(*) from gl_accvouch

where ccode like '501%' --and mc<>0 group by coutbillsign,coutid having count(*)>1

本文来源:https://www.bwwdw.com/article/j5ox.html

Top