Enhanced `ZugferdInvoice` model with default string values to prevent nulls. Updated `Upload.cshtml` to display parsed invoice data. Refactored `Upload.cshtml.cs` to handle ZUGFeRD XML parsing and database storage. Introduced `ImportedInvoice` property and buffered file processing with `MemoryStream`. Extended `ZugferdParserService` to support ZUGFeRD v1, v1.0 FeRD, and v2/Factur-X. Added version-specific parsing methods and namespaces. Improved date and decimal parsing for robustness. Added database migration (`20260522084606_InitialCreate`) to define `ZugferdInvoices` table. Updated migration snapshot to reflect schema changes. Fixed localization issue in `Upload.cshtml.cs` error message.
19 lines
894 B
C#
19 lines
894 B
C#
namespace DXApp.TemplateKitProject.Models
|
|
{
|
|
public class ZugferdInvoice
|
|
{
|
|
public int Id { get; set; }
|
|
public string InvoiceNumber { get; set; } = string.Empty;
|
|
public DateTime InvoiceDate { get; set; }
|
|
public string SellerName { get; set; } = string.Empty;
|
|
public string SellerTaxId { get; set; } = string.Empty;
|
|
public string BuyerName { get; set; } = string.Empty;
|
|
public decimal TotalAmount { get; set; }
|
|
public decimal TaxAmount { get; set; }
|
|
public string CurrencyCode { get; set; } = string.Empty;
|
|
public string Iban { get; set; } = string.Empty;
|
|
public string RawXml { get; set; } = string.Empty; // Original-XML zur Sicherheit
|
|
public DateTime ImportedAt { get; set; }
|
|
public string SourceType { get; set; } = string.Empty; // "Upload" oder "Email"
|
|
}
|
|
} |