private async Task ProcessToJournalAutomatic() { foreach (var item in _filteredView) { SelectedUraPrimke = (BookUraPrimkaReproModel)item; if (SelectedUraPrimke.Knjizen) { continue; } var entries = await CreateJournalEntries(); bool check = entries.Sum(x => x.Dugovna) == entries.Sum(x => x.Potrazna); if (!check) { AutomaticProcess = false; await SendToProcessingDialog(); break; } if (!await _processToJournalService.ProcessEntries(entries)) { AutomaticProcess = false; await SendToProcessingDialog(); break; } else { SelectedUraPrimke.Knjizen = true; await _bookUraEndpoint.MarkAsProcessed(SelectedUraPrimke.BrojUKnjiziUra); } } }
private async Task ProcessToJournalAutomatic() { foreach (var item in _filteredView) { SelectedItem = (RetailIraModel)item; if (SelectedItem.Knjizen) { continue; } var entries = CreateJournalEntries(); bool check = entries.Sum(x => x.Dugovna) == entries.Sum(x => x.Potrazna); if (!check) { AutomaticProcess = false; SendToProcessingDialog(); break; } if (!await _processToJournalService.ProcessEntries(entries)) { AutomaticProcess = false; SendToProcessingDialog(); break; } else { SelectedItem.Knjizen = true; await _bookRetailEndpoint.MarkAsProcessed(SelectedItem.RedniBroj); } } }