Remove seller address from invoice model, always use settings seller

This commit is contained in:
Andre Beging
2024-12-12 09:52:38 +01:00
parent a76a57062e
commit df8c47f0b8
4 changed files with 10 additions and 13 deletions

View File

@@ -58,7 +58,6 @@ namespace Server.Components.Pages
InvoiceId = InvoiceId, InvoiceId = InvoiceId,
Comment = SettingsData.Instance.Comment, Comment = SettingsData.Instance.Comment,
PaymentData = SettingsData.Instance.PaymentData, PaymentData = SettingsData.Instance.PaymentData,
Seller = SettingsData.Instance.SellerAddress
}; };
await InvoiceData.SaveAsync(invoice); await InvoiceData.SaveAsync(invoice);

View File

@@ -98,7 +98,6 @@ namespace Server.Components.Pages
var doc = new InvoiceDocument(new() var doc = new InvoiceDocument(new()
{ {
InvoiceId = "3129", InvoiceId = "3129",
Seller = SettingsData.Instance.SellerAddress,
PaymentData = SettingsData.Instance.PaymentData, PaymentData = SettingsData.Instance.PaymentData,
Comment = SettingsData.Instance.Comment, Comment = SettingsData.Instance.Comment,
Customer = new() Customer = new()

View File

@@ -281,16 +281,16 @@ namespace Server.Model
{ {
row.RelativeItem().Column(column => row.RelativeItem().Column(column =>
{ {
column.Item().TextSmall(Model.Seller?.Name, true); column.Item().TextSmall(SettingsData.Instance.SellerAddress.Name, true);
column.Item().TextSmall(Model.Seller?.Street); column.Item().TextSmall(SettingsData.Instance.SellerAddress.Street);
column.Item().TextSmall($"{Model.Seller?.Zip} {Model.Seller?.City}"); column.Item().TextSmall($"{SettingsData.Instance.SellerAddress.Zip} {SettingsData.Instance.SellerAddress.City}");
}); });
row.RelativeItem().Column(column => row.RelativeItem().Column(column =>
{ {
if(!string.IsNullOrWhiteSpace(Model.Seller?.Phone)) column.Item().TextSmall($"Tel.: {Model.Seller?.Phone}"); if(!string.IsNullOrWhiteSpace(SettingsData.Instance.SellerAddress.Phone)) column.Item().TextSmall($"Tel.: {SettingsData.Instance.SellerAddress.Phone}");
if(!string.IsNullOrWhiteSpace(Model.Seller?.Email)) column.Item().TextSmall($"E-Mail: {Model.Seller?.Email}"); if(!string.IsNullOrWhiteSpace(SettingsData.Instance.SellerAddress.Email)) column.Item().TextSmall($"E-Mail: {SettingsData.Instance.SellerAddress.Email}");
if(!string.IsNullOrWhiteSpace(Model.Seller?.Web)) column.Item().TextSmall($"Web: {Model.Seller?.Web}"); if(!string.IsNullOrWhiteSpace(SettingsData.Instance.SellerAddress.Web)) column.Item().TextSmall($"Web: {SettingsData.Instance.SellerAddress.Web}");
}); });
row.RelativeItem().Column(column => row.RelativeItem().Column(column =>
@@ -336,7 +336,7 @@ namespace Server.Model
{ {
row.AutoItem().Column(column => row.AutoItem().Column(column =>
{ {
column.Item().PaddingBottom(5).TextSmall(Model.Seller?.ToString(), true); column.Item().PaddingBottom(5).TextSmall(SettingsData.Instance.SellerAddress.ToString(), true);
if(!string.IsNullOrWhiteSpace(Model.Customer?.Name)) column.Item().Text(Model.Customer?.Name); if(!string.IsNullOrWhiteSpace(Model.Customer?.Name)) column.Item().Text(Model.Customer?.Name);
if(!string.IsNullOrWhiteSpace(Model.Customer?.Name2)) column.Item().Text(Model.Customer?.Name2); if(!string.IsNullOrWhiteSpace(Model.Customer?.Name2)) column.Item().Text(Model.Customer?.Name2);
column.Item().Text(Model.Customer?.Street); column.Item().Text(Model.Customer?.Street);
@@ -352,11 +352,11 @@ namespace Server.Model
table.ColumnsDefinition(c => table.ColumnsDefinition(c =>
{ {
c.ConstantColumn(50); c.ConstantColumn(50);
c.ConstantColumn(50); c.ConstantColumn(65);
}); });
table.Cell().TextSmall("Steuer-Nr:", true); table.Cell().TextSmall("Steuer-Nr:", true);
table.Cell().TextSmall(Model.Seller?.TaxId); table.Cell().TextSmall(SettingsData.Instance.SellerAddress.TaxId);
table.Cell().TextSmall("Datum:", true); table.Cell().TextSmall("Datum:", true);
table.Cell().TextSmall(Model.IssueDate.ToShortDateString()); table.Cell().TextSmall(Model.IssueDate.ToShortDateString());

View File

@@ -7,7 +7,6 @@
public string? InvoiceId { get; set; } public string? InvoiceId { get; set; }
public DateTime IssueDate { get; set; } = DateTime.Today; public DateTime IssueDate { get; set; } = DateTime.Today;
public Address? Seller { get; set; }
public Address? Customer { get; set; } public Address? Customer { get; set; }
public List<OrderItem> Items { get; set; } = new(); public List<OrderItem> Items { get; set; } = new();