匹配明细报表各主要字段取值逻辑(收货单)

by zhengyj 2013.12.26 08:45

注:脚本执行有风险,对于客户正式环境请在研发指导下执行。

原暂估(未税)金额:
case
    when Receivement0.ReceivementType = 1 and Receivement0.RejectMode = 1
    then RcvLine.RtnDeductEvaluationMnyAC * ( -1 )
    when Receivement0.ReceivementType = 1 and Receivement0.RejectMode = 0
    then RcvLine.EvaluationMnyAC * ( -1 )
    //when PriceSource0.Code != 10
    //then RcvLine.EvaluationMnyAC
    else RcvLine_EvaluationMnyAC//RcvLine.TotalNetMnyAC
end as OldEstimateMny
原暂估(未税)金额Fc:case when Receivement0.ReceivementType = 1 then RcvLineCosts0.TotalNetMny * ( -1 ) else RcvLineCosts0.TotalNetMny end as OldEstimateMnyFC

原暂估税额:
case when Receivement0.ReceivementType = 1
  then
  case when Receivement0.RejectMode = 1
       then RcvLine.RtnDeductTaxAC * ( -1 )
       else RcvLine.RejectTaxMnyAC * ( -1 )
  end
  else RcvLine.TotalTaxAC
end as OldEstimateTaxMnyAC
原暂估税额FC:case when Receivement0.ReceivementType = 1 then RcvLineCosts0.TaxMny * ( -1 ) else RcvLineCosts0.TaxMny end as OldEstimateTaxMnyFC[错误!]
修改为:
  //StringBuilder sb = new StringBuilder();
           // sb.Append(" case when " + EstimateDetailMatchRcvDs.ReceivementType + " = 1");
           // sb.Append(" then ");
            //sb.Append(" case when " + EstimateDetailMatchRcvDs.RejectMode + " = 1");
            //sb.Append(" then " + EstimateDetailMatchRcvDs.RcvLine_RtnDeductTaxFC + "* (-1)");
            //sb.Append(" else " + EstimateDetailMatchRcvDs.RcvLine_RejectTaxMnyFC + "* (-1)");
            //sb.Append(" end ");
            //sb.Append(" else " + EstimateDetailMatchRcvDs.);
            //sb.Append(" end ");

 sb.Append(" case when RcvLine.KITRcvMode = 0 and RcvLine.KitParentLine > 0 ");
            sb.Append(" then null ");
            sb.Append(" when " + EstimateDetailMatchRcvDs.ReceivementType + " = 1");
            sb.Append(" then ");
            sb.Append(EstimateDetailMatchRcvDs.RcvLineCosts_TaxMny + "* (-1)"); //以下注掉修改是在暂估价税合计修改的基础上确定的_2011.02.24
            //sb.Append(" case when " + EstimateDetailMatchRcvDs.RejectMode + " = 1");
            //sb.Append(" then " + EstimateDetailMatchRcvDs.RcvLine_RtnDeductTaxFC + "* (-1)");
            //sb.Append(" else " + EstimateDetailMatchRcvDs.RcvLine_RejectTaxMnyFC + "* (-1)");
            //sb.Append(" end ");
            sb.Append(" else " + EstimateDetailMatchRcvDs.RcvLineCosts_TaxMny);
            sb.Append(" end ");

含税金额_20110926_新增
【含税金额:case when Receivement0.ReceivementType = 1 then RcvLine.RejectMnyAC * ( -1 ) else RcvLine.TotalMnyAC end as TotalMnyAC(RcvLine_TotalMnyAC),
含税金额FC:case when Receivement0.ReceivementType = 1 then RcvLine.RejectMnyFC * ( -1 ) else RcvLine.TotalMnyFC end as TotalMnyFC(RcvLine_TotalMnyAC)】

修改为如下价税合计

价税合计:case when Receivement0.ReceivementType = 1 then RcvLine.RejectMnyAC * ( -1 ) else
//case when PriceSource0.Code != 10 then RcvLine.TotalMnyAC else 暂估未税金额+暂估税额 end
RcvLine.TotalMnyAC end as TotalMnyAC,
价税合计FC:case when Receivement0.ReceivementType = 1 then RcvLine.RejectMnyFC * ( -1 ) else
//case when PriceSource0.Code != 10 then RcvLine.TotalMnyFC else 暂估未税金额+暂估税额 end
RcvLine.TotalMnyFC end as TotalMnyFC,

 

原暂估(未税)费用额:case when ( PriceSource0.Code != 10 or Receivement0.ReceivementType = 1 ) then 0 else RcvLine.TotalNetFeeAC end as OCOMMoney_Fee
原暂估(未税)费用额FC :case when ( PriceSource0.Code != 10 or Receivement0.ReceivementType = 1 ) then 0 else RcvLineCosts0.TotalNetFee end as OMFCMoney_Fee

暂估费用税额:case when ( PriceSource0.Code != 10 or Receivement0.ReceivementType = 1 ) then 0 else RcvLine.RcvFee.FeeTaxAC end as OCOMMoney_FeeTax
暂估费用税额FC:case when ( PriceSource0.Code != 10 or Receivement0.ReceivementType = 1 ) then 0 else RcvLine.RcvFee.FeeTaxFC end as OMFCMoney_FeeTax
修改记录1:梁素萍,郑玉锦和阎峰确认:不需要判断价税来源
原暂估(未税)费用额:case when ( Receivement0.ReceivementType = 1 ) then 0 else RcvLine.TotalNetFeeAC end as OCOMMoney_Fee
原暂估(未税)费用额FC :case when ( Receivement0.ReceivementType = 1 ) then 0 else RcvLineCosts0.TotalNetFee end as OMFCMoney_Fee

暂估费用税额:case when ( Receivement0.ReceivementType = 1 ) then 0 else RcvLine.RcvFee.FeeTaxAC end as OCOMMoney_FeeTax
暂估费用税额FC:case when ( Receivement0.ReceivementType = 1 ) then 0 else RcvLine.RcvFee.FeeTaxFC end as OMFCMoney_FeeTax

暂估费用价税合计:原暂估(未税)费用额 + 暂估费用税额
暂估费用价税合计FC:原暂估(未税)费用额FC + 暂估费用税额Fc

 

匹配未税费用额AC:[PMMatchedDetail0.MatchedFeeAC as PMMatchedDetail_MatchedFeeAC] PMMatchedDetail0.MatchedFeeAC - PMMatchedDetail0.MatchedFeeTaxAC as MatchedFeeAC
匹配未税费用额FC:PMMatchedDetail0.FeeExcTaxFC as PMMatchedDetail_FeeExcTaxFC

匹配费用税额:PMMatchedDetail0.MatchedFeeTaxAC as PMMatchedDetail_MatchedFeeTaxAC
匹配费用税额FC:PMMatchedDetail0.FeeTaxFC as PMMatchedDetail_MatchedFeeFC
匹配费用价税合计:[匹配费用额 + 匹配费用税额 as MatchedTotalFeeAC]PMMatchedDetail0.MatchedFeeAC as MatchedTotalFeeAC
匹配费用价税合计FC:匹配费用额FC + 匹配费用税额FC as MatchedTotalFeeFC


匹配(未税)金额:case when Receivement0.ReceivementType = 1 and PMMatchedDetail0.MatchedQtyPU > 0 then PMMatchedDetail0.MatchedMoneyExcTaxAC * ( -1 ) else PMMatchedDetail0.MatchedMoneyExcTaxAC end as PMMatchedDetail_MatchedMoneyExcTaxAC,
匹配(未税)金额FC: case when Receivement0.ReceivementType = 1 and PMMatchedDetail0.MatchedQtyPU > 0 then PMMatchedDetail0.MatchedAmountExTaxFC * ( -1 ) else PMMatchedDetail0.MatchedAmountExTaxFC end as PMMatchedDetail_MatchedAmountExTaxFC

匹配税额:case when Receivement0.ReceivementType = 1 and PMMatchedDetail0.MatchedQtyPU > 0 then PMMatchedDetail0.MatchedTaxAC * ( -1 ) else PMMatchedDetail0.MatchedTaxAC end as PMMatchedDetail_MatchedTaxAC,
匹配税额FC: case when Receivement0.ReceivementType = 1 and PMMatchedDetail0.MatchedQtyPU > 0 then PMMatchedDetail0.MatchedTaxFC * ( -1 ) else PMMatchedDetail0.MatchedTaxFC end as PMMatchedDetail_MatchedTaxFC
匹配价税合计AC:MatchedTotalMnyAC
匹配价税合计FC:MatchedTotalMnyFC


未匹配费用额:runningvalue(Fields!OCOMMoney_Fee.Value,Sum,"RcvLine_ID")-runningvalue(Fields!PMMatchedDetail_MatchedFeeAC.Value,Sum,"RcvLine_ID")
未匹配费用额FC:runningvalue(Fields!OMFCMoney_Fee.Value,Sum,"RcvLine_ID")-runningvalue(Fields!PMMatchedDetail_FeeExcTaxFC.Value,Sum,"RcvLine_ID")

未匹配费用税额:暂估费用税额-匹配费用税额
未匹配费用税额FC:暂估费用税额Fc-匹配费用税额FC
未匹配费用价税合计:暂估费用价税合计-匹配费用价税合计
未匹配费用价税合计FC:暂估费用价税合计Fc-匹配费用价税合计FC

未匹配金额:runningvalue(Fields!OldEstimateMny.Value,Sum,"RcvLine_ID")-runningvalue(Fields!PMMatchedDetail_MatchedMoneyExcTaxAC.Value,Sum,"RcvLine_ID")
未匹配金额FC:runningvalue(Fields!OldEstimateMnyFC.Value,Sum,"RcvLine_ID")-runningvalue(Fields!PMMatchedDetail_MatchedAmountExTaxFC.Value,Sum,"RcvLine_ID")
未匹配税额:暂估税额-匹配税额
未匹配税额FC:暂估税额Fc-匹配税额FC
未匹配价税合计:暂估价税合计-匹配价税合计
未匹配价税合计FC:暂估价税合计Fc-匹配价税合计FC

 


匹配明细表调入单部分:
1.原暂估数量金额部分
原暂估数量:TransInSubLine.PriceUomQty as QtyPU,

原暂估未税金额AC:TransInSubLine.NetMoney as OldEstimateMny,
原暂估未税金额FC:TransLineSourceCost.CostAmt - TransLineSourceCost.IPVAmt as OldEstimateMnyFC,

原暂估税额AC: TransInSubLine.TaxMoney  as OldEstimateTaxMnyFC
原暂估税额FC:TransLineSourceCost.IPVAmt as OldEstimateTaxMnyFC ?
原暂估价税合计AC:TransInSubLine.TotalMoney as TotalMnyAC,
原暂估价税合计FC:TransLineSourceCost.CostAmt as TotalMnyFC, ?


2.原暂估费用数量金额部分:
原暂估未税费用额AC:null as OCOMMoney_Fee
原暂估未税费用额FC:null as OMFCMoney_Fee

原暂估费用税额AC: null as OCOMMoney_FeeTax
原暂估费用税额FC: null as OMFCMoney_FeeTax
原暂估费用价税合计AC: null as OCOMMoney_FeeTotal
原暂估费用价税合计FC: null as OMFCMoney_FeeTotal

 

3.匹配数量金额部分

匹配未税金额AC:APMatchLine0.OCOMMoney.NonTax as PMMatchedDetail_MatchedMoneyExcTaxAC
匹配未税金额FC:APMatchLineSOB0.OMFCMoney.NonTax as PMMatchedDetail_MatchedAmountExTaxFC

匹配税额AC: APMatchLine0.OCOMMoney.Tax
匹配税额FC: APMatchLineSOB0.OMFCMoney.Tax
匹配价税合计AC: APMatchLine0.OCOMMoney.NonTax + APMatchLine0.OCOMMoney.Tax
匹配价税合计FC:APMatchLineSOB0.OMFCMoney.NonTax + APMatchLineSOB0.OMFCMoney.NonTax


4.匹配费用数量金额部分

匹配未税费用AC:APMatchLine0.OCOMMoney.Fee as PMMatchedDetail_MatchedFeeAC
匹配未税费用FC:PMatchLineSOB0.OMFCMoney.Fee as PMMatchedDetail_FeeExcTaxFC


匹配费用税额AC: APMatchLine0.OCOMMoney.FeeTax
匹配费用税额FC: PMatchLineSOB0.OMFCMoney.FeeTax
匹配费用价税合计AC: APMatchLine0.OCOMMoney.Fee + APMatchLine0.OCOMMoney.FeeTax
匹配费用价税合计FC:PMatchLineSOB0.OMFCMoney.Fee + PMatchLineSOB0.OMFCMoney.FeeTax


!2010.12.24:由于匹配明细表调入单部分税额和价税合计本币取不到,阎峰同意将这些字段显示成空

原暂估税额FC:null as OldEstimateTaxMnyFC
原暂估价税合计FC:null as TotalMnyFC

匹配税额FC: null

匹配价税合计FC:null

 

 

 

Tags:

添加评论



biuquote
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading


RecentComments

评论 RSS

Statistics

989 篇文章
0 个单页
653587 条评论
11 次评分
233967 次访问
访问统计开始于 2019年12月15日
平均日访问 5441 次
当前 101 人在线