コード例 #1
0
        public virtual FSCreatedDoc PressSave(int batchID, BeforeSaveDelegate beforeSave)
        {
            if (Base.Document.Current == null)
            {
                throw new SharedClasses.TransactionScopeException();
            }

            if (beforeSave != null)
            {
                beforeSave(Base);
            }

            Base.Save.Press();

            ARInvoice arInvoiceRow = Base.Document.Current;

            var fsCreatedDocRow = new FSCreatedDoc()
            {
                BatchID        = batchID,
                PostTo         = ID.Batch_PostTo.AR,
                CreatedDocType = arInvoiceRow.DocType,
                CreatedRefNbr  = arInvoiceRow.RefNbr
            };

            return(fsCreatedDocRow);
        }
コード例 #2
0
ファイル: RequestCommon.cs プロジェクト: muzeyc/CommonBaseUI
        /// <summary>
        /// 检索类型的提交
        /// </summary>
        /// <param name="url"></param>
        /// <param name="reqModel"></param>
        /// <param name="beforeSaveCallBack">保存确认之后,请求后台之前触发的回调</param>
        /// <param name="afterResponseCallBack">回调函数</param>
        /// <param name="message">替换消息,不为空的时候报该消息</param>
        /// <returns></returns>
        public void PostSaveEx(string url, object reqModel, BeforeSaveDelegate beforeSaveCallBack = null, AfterResponseDelegate afterResponseCallBack = null, string message = null)
        {
            _BeforeSave    = beforeSaveCallBack;
            _AfterResponse = afterResponseCallBack;
            this.Url       = url;
            this.ReqModel  = reqModel;
            string msg = message.IsNullOrEmpty() ? "是否保存?" : message;

            FormCommon.ShowDialog(msg, AfterSaveCallBack);
        }
コード例 #3
0
        public virtual FSCreatedDoc PressSave(int batchID, List <DocLineExt> docLines, BeforeSaveDelegate beforeSave)
        {
            if (Base.Document.Current == null)
            {
                throw new SharedClasses.TransactionScopeException();
            }

            if (beforeSave != null)
            {
                beforeSave(Base);
            }

            APInvoiceEntryExternalTax TaxGraphExt = Base.GetExtension <APInvoiceEntryExternalTax>();

            if (TaxGraphExt != null)
            {
                TaxGraphExt.SkipTaxCalcAndSave();
            }
            else
            {
                Base.Save.Press();
            }

            string docType = Base.Document.Current.DocType;
            string refNbr  = Base.Document.Current.RefNbr;

            // Reload APInvoice to get the current value of IsTaxValid
            Base.Clear();
            Base.Document.Current = PXSelect <APInvoice, Where <APInvoice.docType, Equal <Required <APInvoice.docType> >, And <APInvoice.refNbr, Equal <Required <APInvoice.refNbr> > > > > .Select(Base, docType, refNbr);

            APInvoice apInvoiceRow = Base.Document.Current;

            var fsCreatedDocRow = new FSCreatedDoc()
            {
                BatchID        = batchID,
                PostTo         = ID.Batch_PostTo.AP,
                CreatedDocType = apInvoiceRow.DocType,
                CreatedRefNbr  = apInvoiceRow.RefNbr
            };

            return(fsCreatedDocRow);
        }
コード例 #4
0
        public virtual FSCreatedDoc PressSave(int batchID, List <DocLineExt> docLines, BeforeSaveDelegate beforeSave)
        {
            if (Base.Document.Current == null)
            {
                throw new SharedClasses.TransactionScopeException();
            }

            if (beforeSave != null)
            {
                beforeSave(Base);
            }

            Base.Save.Press();

            if (docLines != null && docLines.Count > 0)
            {
                FSSrvOrdType fsSrvOrdTypeRow = docLines[0].fsSrvOrdType;

                if (fsSrvOrdTypeRow != null && fsSrvOrdTypeRow.ReleaseProjectTransactionOnInvoice == true)
                {
                    Base.ReleaseDocument(Base.Document.Current);
                }
            }

            var fsCreatedDocRow = new FSCreatedDoc()
            {
                BatchID        = batchID,
                PostTo         = ID.Batch_PostTo.PM,
                CreatedDocType = Base.Document.Current.Module,
                CreatedRefNbr  = Base.Document.Current.RefNbr
            };

            return(fsCreatedDocRow);
        }
コード例 #5
0
        public virtual FSCreatedDoc PressSave(int batchID, List <DocLineExt> docLines, BeforeSaveDelegate beforeSave)
        {
            if (Base.issue.Current == null)
            {
                throw new SharedClasses.TransactionScopeException();
            }

            if (beforeSave != null)
            {
                beforeSave(Base);
            }

            Base.Save.Press();

            INRegister inRegisterRow = Base.issue.Current != null ? Base.issue.Current : Base.issue.Select();

            if (docLines != null && docLines.Count > 0)
            {
                FSSrvOrdType fsSrvOrdTypeRow = docLines[0].fsSrvOrdType;

                if (fsSrvOrdTypeRow != null && fsSrvOrdTypeRow.ReleaseIssueOnInvoice == true)
                {
                    if (inRegisterRow.Hold == true)
                    {
                        Base.issue.Cache.SetValueExtIfDifferent <INRegister.hold>(inRegisterRow, false);

                        inRegisterRow = Base.issue.Update(inRegisterRow);
                    }

                    Base.release.Press();
                }
            }

            string docType = Base.issue.Current.DocType;
            string refNbr  = Base.issue.Current.RefNbr;

            var fsCreatedDocRow = new FSCreatedDoc()
            {
                BatchID        = batchID,
                PostTo         = ID.Batch_PostTo.IN,
                CreatedDocType = inRegisterRow.DocType,
                CreatedRefNbr  = inRegisterRow.RefNbr
            };

            return(fsCreatedDocRow);
        }