/// <summary>
        /// 给单头赋值
        /// </summary>
        /// <param name="headDto"></param>
        /// <param name="doc"></param>
        private void SetPrePaymentHead(PrePaymentHeadDTO headDto, UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePayment doc)
        {
            doc.DocumentTypeKey = headDto.DocumentType;
            doc.SrcDocType      = EnumBE.PrePaySrcDocTypeEnum.PO;
            doc.CurrencyKey     = headDto.Currency;
            doc.SupplierKey     = headDto.Supplier;
            doc.POOrgKey        = headDto.POOrg;
            doc.BusinessDate    = DateTime.Today;
            doc.DeptKey         = headDto.Dept;
            doc.BuyerKey        = headDto.Buyer;
            doc.PrePayDate      = doc.BusinessDate;

            if (headDto.POOrg != null)
            {
                doc.AccountPeriod = PubHelperExtend.GetSOBAccountingPeriod(doc.BusinessDate, headDto.POOrg.GetEntity().ID);
            }
        }
        /// <summary>
        /// 创建红字的预付款通知单
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="headDto"></param>
        private long CreatePrePayment(UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePayment doc, PrePaymentHeadDTO headDto)
        {
            UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePayment head = UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePayment.Create();
            head.DocumentTypeKey = headDto.DocumentType;
            head.SrcDocType      = EnumBE.PrePaySrcDocTypeEnum.PO;
            head.CurrencyKey     = doc.CurrencyKey;
            head.SupplierKey     = doc.SupplierKey;
            head.POOrgKey        = doc.POOrgKey;
            head.BusinessDate    = DateTime.Today;
            head.DeptKey         = doc.DeptKey;
            head.BuyerKey        = doc.BuyerKey;
            head.PrePayDate      = head.BusinessDate;

            if (doc.POOrg != null)
            {
                head.AccountPeriod = PubHelperExtend.GetSOBAccountingPeriod(head.BusinessDate, doc.POOrg.ID);
            }

            head.SrcPrePayDocID = doc.ID;
            head.SrcPrePayDocNo = doc.DocNo;

            int lineNum = 10;//行号

            foreach (PrePaymentLineDTO lineDto in headDto.PrePaymentLineDTOs)
            {
                UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePaymentLine line = UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePaymentLine.Create(head);
                line.LineNum     = lineNum;
                line.SrcPOKey    = lineDto.PurchaseOrder;
                line.PrePayMoney = lineDto.ThisRedMoney;
                line.ActualMoeny = lineDto.ThisRedMoney;

                UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePaymentLine oldLine = UFIDA.U9.Cust.GS.FI.PrePaymentBE.PrePaymentLine.Finder.FindByID(lineDto.SrcPrePayLineID);
                if (oldLine != null)
                {
                    oldLine.SumRedFlushMoney = oldLine.SumRedFlushMoney + lineDto.ThisRedMoney;

                    if (oldLine.SrcPO != null)
                    {
                        UpdatePORedMoney(oldLine.SrcPO.ID, lineDto.ThisRedMoney);
                    }
                }
            }
            return(head.ID);
        }