示例#1
0
        private static decimal?Get付款理论值(IRepository rep, 普通票 票, 普通箱 箱, 付款合同费用项 htfyx)
        {
            decimal?d = null;

            switch (htfyx.付款合同费用项类型)
            {
            case 付款合同费用项类型.理论值计算:
                d = (箱 != null) ? Get理论值金额(rep, htfyx, 箱) : Get理论值金额(rep, htfyx, 票);
                break;

            case 付款合同费用项类型.报销:
                decimal?sum = null;
                foreach (业务费用 i in 票.费用)
                {
                    bool b = i.费用项编号 == htfyx.费用项编号 && i.收付标志 == 收付标志.付 &&
                             i.金额.HasValue;
                    if (b && 箱 != null)
                    {
                        b &= i.箱Id == 箱.ID;
                    }
                    if (b && i.凭证费用明细 != null)
                    {
                        if (!sum.HasValue)
                        {
                            sum = 0;
                        }
                        sum += i.金额.Value;
                    }
                }
                if (sum.HasValue)
                {
                    d = sum;
                }
                break;

            default:
                throw new ArgumentException("Invalid " + htfyx.付款合同费用项类型);
            }
            return(d);
        }
示例#2
0
 private static decimal? Get付款理论值(IRepository rep, 普通票 票, 普通箱 箱, 付款合同费用项 htfyx)
 {
     decimal? d = null;
     switch (htfyx.付款合同费用项类型)
     {
         case 付款合同费用项类型.理论值计算:
             d = (箱 != null) ? Get理论值金额(rep, htfyx, 箱) : Get理论值金额(rep, htfyx, 票);
             break;
         case 付款合同费用项类型.报销:
             decimal? sum = null;
             foreach (业务费用 i in 票.费用)
             {
                 bool b = i.费用项编号 == htfyx.费用项编号 && i.收付标志 == 收付标志.付
                     && i.金额.HasValue;
                 if (b && 箱 != null)
                 {
                     b &= i.箱Id == 箱.ID;
                 }
                 if (b && i.凭证费用明细 != null)
                 {
                     if (!sum.HasValue)
                     {
                         sum = 0;
                     }
                     sum += i.金额.Value;
                 }
             }
             if (sum.HasValue)
             {
                 d = sum;
             }
             break;
         default:
             throw new ArgumentException("Invalid " + htfyx.付款合同费用项类型);
     }
     return d;
 }