コード例 #1
0
        private IList <PurchaseRecord> CreatePurchaseRecordsByAPPayments(DocumentIDGroup documentIDGroup, GAFPeriod gafPeriod)
        {
            var apRegistersByRefNbrs = _gafRepository.GetAPRegistersByIDs(documentIDGroup.DocumentType,
                                                                          documentIDGroup.RefNbrs.ToArray())
                                       .ToDictionary(apReg => apReg.RefNbr, apReg => apReg);

            var documentGroup = new DocumentGroup <APRegister>()
            {
                Module            = documentIDGroup.Module,
                DocumentType      = documentIDGroup.DocumentType,
                DocumentsByRefNbr = apRegistersByRefNbrs
            };

            var purchaseRecords = _apPaymentGAFRecordsCreator.CreateGAFRecordsForDocumentGroup(documentGroup,
                                                                                               gafPeriod.TaxAgencyID,
                                                                                               gafPeriod.TaxPeriodID);

            return(purchaseRecords);
        }