PaymentVariantsWindow: Allow members to have no IBAN
This commit is contained in:
@ -77,7 +77,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public string Address;
|
public string Address;
|
||||||
public int Plz;
|
public int Plz;
|
||||||
public string Locality;
|
public string Locality;
|
||||||
public string Iban;
|
public string? Iban;
|
||||||
public string TgNr;
|
public string TgNr;
|
||||||
public decimal Sum;
|
public decimal Sum;
|
||||||
public decimal? Surcharge;
|
public decimal? Surcharge;
|
||||||
@ -101,7 +101,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
Address = row.Address;
|
Address = row.Address;
|
||||||
Plz = row.Plz;
|
Plz = row.Plz;
|
||||||
Locality = row.Locality;
|
Locality = row.Locality;
|
||||||
Iban = Utils.FormatIban(row.Iban);
|
Iban = row.Iban != null ? Utils.FormatIban(row.Iban) : null;
|
||||||
TgNr = $"{row.Year}/{row.TgNr}";
|
TgNr = $"{row.Year}/{row.TgNr}";
|
||||||
Total = Utils.DecFromDb(row.NetAmount, prec1);
|
Total = Utils.DecFromDb(row.NetAmount, prec1);
|
||||||
Surcharge = (row.Surcharge == null || row.Surcharge == 0) ? null : Utils.DecFromDb((long)row.Surcharge, prec2);
|
Surcharge = (row.Surcharge == null || row.Surcharge == 0) ? null : Utils.DecFromDb((long)row.Surcharge, prec2);
|
||||||
@ -145,7 +145,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public string Locality => LocalityFull.Split(",")[0];
|
public string Locality => LocalityFull.Split(",")[0];
|
||||||
[Column("iban")]
|
[Column("iban")]
|
||||||
public string Iban { get; set; }
|
public string? Iban { get; set; }
|
||||||
[Column("year")]
|
[Column("year")]
|
||||||
public int Year { get; set; }
|
public int Year { get; set; }
|
||||||
[Column("precision")]
|
[Column("precision")]
|
||||||
|
@ -15,6 +15,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
|
|
||||||
public static IEnumerable<Transaction> FromPaymentVariant(PaymentVar variant) {
|
public static IEnumerable<Transaction> FromPaymentVariant(PaymentVar variant) {
|
||||||
return variant.Credits
|
return variant.Credits
|
||||||
|
.Where(c => c.Member.Iban != null)
|
||||||
.OrderBy(c => c.TgNr)
|
.OrderBy(c => c.TgNr)
|
||||||
.Select(c => new Transaction(c))
|
.Select(c => new Transaction(c))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
@ -298,6 +298,14 @@ namespace Elwig.Windows {
|
|||||||
MessageBox.Show("Überweisungsdatum muss gesetzt sein!", "Exportieren nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show("Überweisungsdatum muss gesetzt sein!", "Exportieren nicht möglich", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var withoutIban = v.Credits.Count(c => c.Member.Iban == null);
|
||||||
|
if (withoutIban > 0) {
|
||||||
|
var r = MessageBox.Show($"Achtung: Für {withoutIban} Mitglieder ist kein IBAN hinterlegt.\nDiese werden NICHT exportiert.",
|
||||||
|
"Mitglieder ohne IBAN", MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.Cancel);
|
||||||
|
if (r != MessageBoxResult.OK) return;
|
||||||
|
}
|
||||||
|
|
||||||
var d = new SaveFileDialog() {
|
var d = new SaveFileDialog() {
|
||||||
FileName = $"{App.Client.NameToken}-Überweisungsdaten-{v.Year}-{v.Name.Trim().Replace(' ', '-')}.{Ebics.FileExtension}",
|
FileName = $"{App.Client.NameToken}-Überweisungsdaten-{v.Year}-{v.Name.Trim().Replace(' ', '-')}.{Ebics.FileExtension}",
|
||||||
DefaultExt = Ebics.FileExtension,
|
DefaultExt = Ebics.FileExtension,
|
||||||
|
Reference in New Issue
Block a user