Export/Ebics: Warn user if no client IBAN is set
Some checks failed
Test / Run tests (push) Failing after 2m22s

This commit is contained in:
2024-06-14 12:11:49 +02:00
parent cc0aa6046f
commit da9df5cbeb

View File

@ -38,8 +38,11 @@ namespace Elwig.Helpers.Export {
} }
public async Task ExportAsync(IEnumerable<Transaction> transactions, IProgress<double>? progress = null) { public async Task ExportAsync(IEnumerable<Transaction> transactions, IProgress<double>? progress = null) {
if (transactions.Any(tx => tx.Amount < 0)) if (transactions.Any(tx => tx.Amount < 0)) {
throw new ArgumentException("Tranaction amount may not be negative"); throw new ArgumentException("Tranaction amount may not be negative");
} else if (App.Client.Iban == null) {
throw new ArgumentException("Client IBAN has to be set");
}
progress?.Report(0.0); progress?.Report(0.0);
var nbOfTxs = transactions.Count(); var nbOfTxs = transactions.Count();
int count = nbOfTxs + 2, i = 0; int count = nbOfTxs + 2, i = 0;