Skip to content

Commit

Permalink
fix: filter voided invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
DerStimmler committed Feb 3, 2025
1 parent 2ff18fe commit 2c0dee8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,23 @@ private void ShowExportLines(string export)

private async Task<IImmutableList<LexofficeInvoice>> LoadInvoicesInPeriod(DateOnly start, DateOnly end)
{
var vouchersInPeriod = await _lexofficeService.GetVouchersInPeriod(start, end);
Enabled = false;

var progress = new Progress<float>();
var getInvoicesTask = _lexofficeService.GetInvoicesAsync(vouchersInPeriod, progress);

Enabled = false;

var ladeForm = new LadeForm(progress, "Rechnungen werden abgefragt");
ladeForm.Show();

var ergebnis = await getInvoicesTask;
Enabled = true;
var vouchersInPeriod = await _lexofficeService.GetVouchersInPeriod(start, end);

var ergebnis = (await _lexofficeService.GetInvoicesAsync(vouchersInPeriod, progress))
.Where(invoice => invoice.VoucherStatus != "voided") //Ignoriere stornierte Rechnungen
.ToImmutableList();

ladeForm.Close();

Enabled = true;

return ergebnis;
}

Expand Down

0 comments on commit 2c0dee8

Please sign in to comment.