Пример #1
0
        private CompanyRecord CreateCompanyRecord(GAFPeriod gafPeriod, GSTAuditFile gstAuditFile, DateTime creationDate)
        {
            var companyRecord = new CompanyRecord();

            var branch      = _gafRepository.GetBranchByID(gafPeriod.BranchID);
            var baccount    = _gafRepository.GetBAccountByID(branch.BAccountID);
            var mainContact = _gafRepository.GetContact(baccount.DefContactID);

            companyRecord.CompanyName      = mainContact.FullName;
            companyRecord.CompanyBRN       = baccount.AcctReferenceNbr;
            companyRecord.CompanyGSTNumber = baccount.TaxRegistrationID;

            var taxPeriod = _gafRepository.GetTaxPeriodByKey(gafPeriod.BranchID, gafPeriod.TaxAgencyID, gafPeriod.TaxPeriodID);

            companyRecord.PeriodStartDate = taxPeriod.StartDate.Value;
            companyRecord.PeriodEndDate   = taxPeriod.EndDateUI.Value;

            companyRecord.FileCreationDate = creationDate;

            var acumaticaVersion = _gafRepository.GetAcumaticaVersion();

            companyRecord.ProductVersion = String.Concat("Acumatica", acumaticaVersion.CurrentVersion);
            companyRecord.GAFVersion     = String.Format(GafVersionTemplate, gstAuditFile.MajorVersion, GafVersionDelimiter,
                                                         gstAuditFile.MinorVersion);

            return(companyRecord);
        }