コード例 #1
0
        private void CheckForSuspenseAccountsZero()
        {
            if (FledgerInfo.CurrentPeriod == FledgerInfo.NumberOfAccountingPeriods)
            {
                // This means: The last accounting period of the year is running!

                if (getSuspenseAccountInfo == null)
                {
                    getSuspenseAccountInfo =
                        new GetSuspenseAccountInfo(FledgerInfo.LedgerNumber);
                }

                if (getSuspenseAccountInfo.RowCount > 0)
                {
                    ASuspenseAccountRow aSuspenseAccountRow;

                    for (int i = 0; i < getSuspenseAccountInfo.RowCount; ++i)
                    {
                        aSuspenseAccountRow = getSuspenseAccountInfo.Row(i);
                        TGet_GLM_Info get_GLM_Info = new TGet_GLM_Info(FledgerInfo.LedgerNumber,
                                                                       aSuspenseAccountRow.SuspenseAccountCode,
                                                                       FledgerInfo.CurrentFinancialYear);

                        if (get_GLM_Info.GLMExists)
                        {
                            TGlmpInfo get_GLMp_Info = new TGlmpInfo(FledgerInfo.LedgerNumber);
                            get_GLMp_Info.LoadBySequence(get_GLM_Info.Sequence, FledgerInfo.CurrentPeriod);

                            if (get_GLMp_Info.RowExists && (get_GLMp_Info.ActualBase != 0))
                            {
                                TVerificationResult tvr = new TVerificationResult(
                                    Catalog.GetString("Non Zero Suspense Account found"),
                                    String.Format(Catalog.GetString("Suspense account {0} has the balance value {1}. It is required to be zero."),
                                                  getSuspenseAccountInfo.ToString(),
                                                  get_GLMp_Info.ActualBase), "",
                                    TPeriodEndErrorAndStatusCodes.PEEC_07.ToString(), TResultSeverity.Resv_Critical);
                                FverificationResults.Add(tvr);

                                FHasCriticalErrors = true;
                                FverificationResults.Add(tvr);
                            }
                        }
                    }
                }
            }
        } // CheckFor SuspenseAccountsZero