Example #1
0
        public LinkedTransactions GenerateLink([FromBody] TransactionsModel request)
        {
            LinkedTransactions response = new LinkedTransactions()
            {
                VinculosEgreso  = new List <Link>(),
                VinculosIngreso = new List <Link>()
            };

            var pendingEgresses = request.Egresos;
            var pendingEntries  = request.Ingresos;

            foreach (var criterio in request.Criterio)
            {
                var generator     = LinkAlgorithmSelectorService.GetLinkingGenerator(criterio);
                var linkProcessed = generator.LinkingTransactions(pendingEntries, pendingEgresses);

                if (MappingHelper.IsEgressOrder[criterio])
                {
                    response.VinculosEgreso.AddRange(linkProcessed?.Links);
                }
                else
                {
                    response.VinculosIngreso.AddRange(linkProcessed?.Links);
                }

                pendingEgresses = linkProcessed?.PendingEgresses;
                pendingEntries  = linkProcessed?.PendingEntries;
            }

            return(response);
        }
Example #2
0
 public void SummarizeErrors(bool summarize)
 {
     Accounts.SummarizeErrors(summarize);
     BankTransactions.SummarizeErrors(summarize);
     BankTransfers.SummarizeErrors(summarize);
     Contacts.SummarizeErrors(summarize);
     ContactGroups.SummarizeErrors(summarize);
     CreditNotes.SummarizeErrors(summarize);
     Employees.SummarizeErrors(summarize);
     Employees.SummarizeErrors(summarize);
     Files.SummarizeErrors(summarize);
     Folders.SummarizeErrors(summarize);
     Inbox.SummarizeErrors(summarize);
     Invoices.SummarizeErrors(summarize);
     Items.SummarizeErrors(summarize);
     LinkedTransactions.SummarizeErrors(summarize);
     ManualJournals.SummarizeErrors(summarize);
     Payments.SummarizeErrors(summarize);
     PurchaseOrders.SummarizeErrors(summarize);
     Receipts.SummarizeErrors(summarize);
     TaxRates.SummarizeErrors(summarize);
     TrackingCategories.SummarizeErrors(summarize);
 }
Example #3
0
 public LinkedTransaction Create(LinkedTransaction item)
 {
     return(LinkedTransactions.Create(item));
 }
Example #4
0
 public LinkedTransaction Update(LinkedTransaction item)
 {
     return(LinkedTransactions.Update(item));
 }
Example #5
0
 public IEnumerable <LinkedTransaction> Update(IEnumerable <LinkedTransaction> items)
 {
     return(LinkedTransactions.Update(items));
 }
Example #6
0
 public async Task <LinkedTransaction> UpdateAsync(LinkedTransaction item)
 {
     return(await LinkedTransactions.UpdateAsync(item));
 }
Example #7
0
 public async Task <IEnumerable <LinkedTransaction> > UpdateAsync(IEnumerable <LinkedTransaction> items)
 {
     return(await LinkedTransactions.UpdateAsync(items));
 }
Example #8
0
 public Task <LinkedTransaction> CreateAsync(LinkedTransaction item)
 {
     return(LinkedTransactions.CreateAsync(item));
 }
Example #9
0
 public Task <IEnumerable <LinkedTransaction> > CreateAsync(IEnumerable <LinkedTransaction> items)
 {
     return(LinkedTransactions.CreateAsync(items));
 }