コード例 #1
0
ファイル: ExpenseClaimEntry.cs プロジェクト: JeffJave/Ipevo
        protected void _(Events.RowPersisting <TWNManualGUIExpense> e)
        {
            if (Base.ExpenseClaimCurrent.Current == null)
            {
                return;
            }

            tWNGUIValidation.CheckCorrespondingInv(Base, e.Row.GUINbr, e.Row.VATInCode);

            if (tWNGUIValidation.errorOccurred.Equals(true))
            {
                e.Cache.RaiseExceptionHandling <TWNManualGUIExpense.gUINbr>(e.Row, e.Row.GUINbr, new PXSetPropertyException(tWNGUIValidation.errorMessage, PXErrorLevel.RowError));
            }

            decimal taxSum = 0;

            foreach (TWNManualGUIExpense row in manGUIExpense.Cache.Cached)
            {
                taxSum += row.TaxAmt.Value;
            }

            if (!taxSum.Equals(Base.ExpenseClaimCurrent.Current.CuryTaxTotal))
            {
                throw new PXException(TWMessages.ChkTotalGUIAmt);
            }
        }
コード例 #2
0
ファイル: APInvoiceEntry.cs プロジェクト: JeffJave/Ipevo
        protected void _(Events.RowPersisting <TWNManualGUIAPBill> e)
        {
            if (Base.Document.Current == null)
            {
                return;
            }

            tWNGUIValidation.CheckCorrespondingInv(Base, e.Row.GUINbr, e.Row.VATInCode);

            if (tWNGUIValidation.errorOccurred == true)
            {
                e.Cache.RaiseExceptionHandling <TWNManualGUIAPBill.gUINbr>(e.Row, e.Row.GUINbr, new PXSetPropertyException(tWNGUIValidation.errorMessage, PXErrorLevel.RowError));
            }

            if (Base.Document.Current.DocType == APDocType.Invoice)
            {
                decimal?taxSum = 0;

                foreach (TWNManualGUIAPBill row in ManualAPBill.Cache.Cached)
                {
                    taxSum += row.TaxAmt.Value;
                }

                if (taxSum != Base.Document.Current.TaxTotal)
                {
                    throw new PXException(TWMessages.ChkTotalGUIAmt);
                }
            }
        }
コード例 #3
0
        public TWNGUITrans InitAndCheckOnAR(string gUINbr, string vATOutCode)
        {
            SequenceNo = (int)PXSelectGroupBy <TWNGUITrans,
                                               Where <TWNGUITrans.gUINbr, Equal <Required <TWNGUITrans.gUINbr> >,
                                                      And <TWNGUITrans.gUIFormatcode, Equal <Required <TWNGUITrans.gUIFormatcode> > > >,
                                               Aggregate <Count> >
                         .Select(this, gUINbr, vATOutCode).RowCount;

            TWNGUIValidation gUIValidation = new TWNGUIValidation();

            gUIValidation.CheckCorrespondingInv(this, gUINbr, vATOutCode);

            return(gUIValidation.tWNGUITrans);
        }