找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

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

[求助] U821升级U810.1报错

[复制链接]
发表于 2012-12-10 15:50:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
是哪个字段,改哪个表?求高人指点

错误信息:
-2147217900
列名 'cInvM_Unit' 无效。
执行如下语句时出错:

CREATE PROCEDURE Sa_MoveSaleProfit(   /* 取得销售毛利分析数据存储过程  */

@chrtable  varchar(200) = null ,  /*保存销售毛利分析明细账*/
@chrWhere1  varchar(255) =null ,     /* 查询条件名称,不包括日期条件 */
@chrStartDate varchar (200)=null,  /* 分析上期日期区间*/
@chrEndDate varchar (200)=null,  /* 分析本期日期区间*/
@chrDate  varchar (200)=null ,/* 总的日期区间 */
@chrBZ varchar(30)   /* 币种条件 */
)
AS
declare @chrSQL varchar(4000)
declare @chrCost varchar(50)
declare @chrWhere varchar(1000)
declare @chrCostWhere varchar(300)
declare @chrstartdate1 varchar (50)
/*   取得除去日期的条件  */
if  ltrim(rtrim(@chrwhere1 ))  = 'newReport_ParameterFromTempTable'
  begin
   /*条件参数通过临时表传递 */
   set @chrCostWhere = (select name from tempdb..newReportParameter )
  end
else  /*条件参数直接传递  */
  begin  
   set @chrCostWhere  = rtrim(ltrim(@chrwhere1))
  end
/*构造收入条件和成本条件  */
set  @chrwhere  = @chrCostWhere
if  not (@chrbz is null ) and ltrim(rtrim(@chrbz)) <> ''  
  if  not(@chrwhere is null  ) and  ltrim(rtrim(@chrWhere)) <> ''
   set @chrwhere = @chrwhere + ' and ' + @chrBZ
/* 取销售系统启用日期 */
set @chrStartDate1 = (select isnull(cValue,'1900-01-01') from accinformation  where cSysid='Sa' and cName='dStartDate' )  
if  @chrstartdate1 <> ''  
begin   
  if  len(ltrim(rtrim(@chrstartdate1))) <= 8 set @chrstartdate1 = convert(varchar(10),convert(smalldatetime,@chrstartdate1,2),121)
  set @chrstartDate1 = ' and SalebillVouch.dDate>=''' + @chrstartdate1 + ''''
end   
/* 查询成本明细账,计算出成本,毛利,成本单价,销售单价,数量,金额   */
if  exists(select * from tempdb..sysobjects where name='Pr_SaleIncomefirst') drop table tempdb..Pr_SaleIncomefirst
/*  查询收入的,金额售价,售价  */
set  @chrSQL ='
SELECT
       SaleBillVouchs.AutoID AS AutoID,
       SaleBillVouchs.iQuantity AS iQuantity,
       SaleBillVouchs.iNatUnitPrice AS iNatUnitPrice,
       SaleBillVouchs.iNatMoney as iNatMoney ,
       SaleBillVouch.cExch_name as cExch_name,
       SaleBillVouch.dDate as dDate,
      
       SaleType.cSTName as cSTName ,
       Customer.cCusName as cCusName ,
       CustomerClass.cCCName as cCCname ,  
       Inventory.cInvName as cInvName ,
       Inventory.cInvStd as cInvStd ,  
       Inventory.cInvM_Unit as cInvM_Unit,
       Inventory.cInvCCode as cInvCCode,
         
       Department.cDepName as cDepName ,   
       Department.cDepCode as cDepCode ,
       SaleBillVouch.cSTCode as cSTCode,
       SaleBillVouch.cCusCode as cCusCode,
       SaleBillVouchs.cInvCode as cInvCode,
       Customer.cCCCode as cCCCode ,
       Inventory.bService as bService   
      
INTO  tempdb..Pr_SaleInComefirst
FROM SaleBillVouchs INNER JOIN SaleBillVouch On SalebillVouchs.sbvid = SalebillVouch.sbvid
  LEFT JOIN  Customer On SalebillVouch.cCusCode   = Customer.cCusCode
  LEFT JOIN  CustomerClass On Customer.cCCCode  =  CustomerClass.cCCCode  
  LEFT JOIN  SaleType On SaleBillVouch.cSTCode  = SaleType.cSTCode
  LEFT JOIN  Inventory On SaleBillVouchs.cInvCode = Inventory.cInvCode
  LEFT JOIN  Department On SaleBillVouch.cDepCode   = Department.cDepCode
WHERE isnull(Salebillvouch.cInvalider,'''')=''''
  and  isnull(Salebillvouch.cSTCode,'''') <> ''''
  ' + @chrstartdate1  /*作废发票不能计算在内,销售类型不能为空,开票日期必须大于系统起用日期 */
/*  执行存储过程,取得本期销售内容  */
if not  (@chrDate is null  ) and  ltrim(rtrim(@chrdate)) <>'' set @chrSQL  = @chrSQL + ' And ' + @chrDate
exec (@chrsql )
/*  按普通条件抽取数据 */
if  exists(select * from tempdb..sysobjects where name='Pr_SaleIncome') drop table tempdb..Pr_SaleIncome
set @chrsql  = 'Select * into tempdb..Pr_saleIncome from tempdb..Pr_saleincomefirst '
if not ( @chrwhere is null) and @chrwhere<>'' set @chrSQL = @chrSQL +' WHERE ' + @chrWhere
exec (@chrsql )

/* 计算成本明细,按发票ID号取得成本明细 */
/*数据准备*/
if  exists(select * from tempdb..sysobjects where name='Pr_SaleCostFirst') drop table  tempdb..Pr_SaleCostFirst   SELECT IA_Subsidiary.dKeepDate AS ddate,
       IA_Subsidiary.cVouType AS cvoutype,
       IA_Subsidiary.iOutCost AS iOutCost,
       case when (cWhvaluestyle='计划价法'or cWhvalueStyle='售价法') and IA_Subsidiary.bMoneyFlag=1 then
   isnull(IA_Subsidiary.iAOutPrice,0)- isnull( IA_Subsidiary.iDebitDifCost,0) + isnull( IA_Subsidiary.iCreditDifCost,0)
     else
   isnull(IA_Subsidiary.iAOutPrice ,0)
     end  
       as  iAOutPrice,   
       IA_SubSidiary.cSTCode as cSTCode,
       Customer.cCCCode as cCCCode ,
       Inventory.cInvCode as cInvCode ,  
       Inventory.cInvCCode as cInvCCode ,
       IA_Subsidiary.cCusCode AS cCusCode,
       IA_Subsidiary.cAccDep AS cDepCode,
       IA_Subsidiary.cDepCode AS cAccDep ,
       IA_Subsidiary.iMonth AS iMonth,
       IA_Subsidiary.bMoneyFlag AS bMoneyFlag,
       IA_Subsidiary.bSale AS bSale,
       IA_Subsidiary.cWhCode as cWhCode  ,  
       Warehouse.cWhValueStyle AS cWhValueStyle ,
       IA_Subsidiary.cBillCode AS cBillCode,
       IA_Subsidiary.cDLCode AS cDlCode ,
       IA_Subsidiary.iAOutQuantity as iAOutQuantity ,
       SaleType.cSTName as cSTName ,
       Customer.cCusName as cCusName ,
       CustomerClass.cCCName as cCCname ,  
       Inventory.cInvName as cInvName ,
       Inventory.cInvStd as cInvStd ,  
       Inventory.cInvM_Unit as cInvM_Unit,
        
       Department.cDepName as cDepName  ,
       Inventory.bService  as bService   
  
       INTO tempdb..Pr_SaleCostfirst
       FROM IA_Subsidiary LEFT JOIN Warehouse ON IA_Subsidiary.cWhCode = Warehouse.cWhCode
         LEFT JOIN Customer On IA_Subsidiary.cCusCode  = Customer.cCusCode
   LEFT JOIN Inventory On IA_SubSidiary.cInvCode = Inventory.cInvCode  
   LEFT JOIN Department On IA_SubSidiary.cAccDep = Department.cDepCode
   LEFT JOIN  CustomerClass On Customer.cCCCode  =  CustomerClass.cCCCode  
   LEFT JOIN  SaleType On IA_SubSidiary.cSTCode  = SaleType.cSTCode
       WHERE bRdFlag=0  AND (cVouType in ('26','27','28','29','32') or (cVoutype='21' and Ia_subsidiary.bSale=1 ) )
发表于 2012-12-10 16:06:23 | 显示全部楼层
楼主这是升到哪个版本报的错?可联系我Q86772610解决
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-10 17:35:04 | 显示全部楼层
本帖最后由 Syhwq 于 2012-12-10 17:37 编辑

'cInvM_Unit' 是计量单位的字段,是不是发票视图?
回复 点赞 拍砖

使用道具 举报

发表于 2013-9-16 13:53:15 | 显示全部楼层
赶紧给我下载要用呢
回复 点赞 拍砖

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 09:11 , Processed in 0.057258 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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