找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
楼主: yejia1222

采购入库单不能保存提示:找不到存储过程USP_STCheckVouchDate

[复制链接]
发表于 2015-6-26 14:21:28 | 显示全部楼层
yj540058005 发表于 2011-12-16 16:16
这问题是09年碰到的 ,  就是找个没有问题的账套  去数据库中复制个相同的存储方式到有问题的账套中 就OK 了 ...

请问 如何复制?
回复

使用道具 举报

发表于 2015-6-26 15:34:46 | 显示全部楼层
复制此
create procedure [dbo].[USP_STCheckVouchDate]
(@cVouchType as varchar(5),@TableName as nvarchar(400))
as

        select id into #a from rdrecord where 1=0
        exec ('insert into #a  select distinct id from '+@TableName)

        if @cVouchType='10'
        begin
                select cinvcode,ddate,impoids,isnull(brelated,0) as brelated into #P
                        from rdrecord a with (nolock)
                        inner join rdrecords b with (nolock) on a.id =b.id
                        where a.id in (select id from #a)  and isnull(impoids,0) <>0
               
                insert into #STCheckVouchDate (cinvcode,dstdate,doridate,error)
                        select a.cinvcode,a.ddate,b.relsdate,
                                replace(
                                        replace(
                                                replace( e.enumname,'{0}',a.cinvcode),
                                                '{1}',convert(varchar(10),a.ddate,121))
                                 ,'{2}',convert(varchar(10),b.relsdate,121))
                        from #P a inner join mom_orderdetail b with (nolock) on a.impoids=b.modid
                                and a.brelated=0
                                left join v_aa_enum e with (nolock) on e.enumtype='ST.CheckoriDate' and EnumCode='MO'
                        where a.ddate<b.relsdate
               
                insert into #STCheckVouchDate (cinvcode,dstdate,doridate,error)
                        select a.cinvcode,a.ddate,c.relsdate,
                                replace(
                                        replace(
                                                replace( e.enumname,'{0}',a.cinvcode),
                                                '{1}',convert(varchar(10),a.ddate,121))
                                 ,'{2}',convert(varchar(10),c.relsdate,121))
                        from #P a inner join mom_moallocate b with (nolock)
                                        on a.impoids=b.AllocateId and a.brelated=1
                                inner join mom_orderdetail c with (nolock) on b.modid=c.modid
                                left join v_aa_enum e with (nolock) on e.enumtype='ST.CheckoriDate' and EnumCode='MO'
                        where a.ddate<c.relsdate
               
               
               
                return
        end
        if @cVouchType='11'
        begin
                select cinvcode,ddate,impoids into #M from rdrecord a with (nolock)
                        inner join rdrecords b with (nolock) on a.id =b.id
                        where a.id in (select id from #a)  and isnull(impoids,0) <>0
                insert into #STCheckVouchDate (cinvcode,dstdate,doridate,error)
                        select a.cinvcode,a.ddate,c.relsdate,
                                replace(
                                        replace(
                                                replace( e.enumname,'{0}',a.cinvcode),
                                                '{1}',convert(varchar(10),a.ddate,121))
                                 ,'{2}',convert(varchar(10),c.relsdate,121))
                        from #M a inner join mom_moallocate b with (nolock) on a.impoids=b.AllocateId
                                inner join mom_orderdetail c with (nolock) on b.modid=c.modid
                                left join v_aa_enum e with (nolock) on e.enumtype='ST.CheckoriDate' and EnumCode='MO'
                        where a.ddate<c.relsdate
               
                return               
        end
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-5-19 12:32 , Processed in 0.019411 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表