ZUGFeRD Service - Verarbeitung von XML-Belegen

This commit is contained in:
2025-01-28 14:20:04 +01:00
parent 56f4327926
commit 45f71e06be
4 changed files with 87 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ using static DigitalData.Modules.Interfaces.ZUGFeRDInterface;
using static DigitalData.Modules.Interfaces.PropertyValues;
using System.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using System.Xml.Linq;
namespace ZUGFeRDRESTService.Controllers
{
@@ -168,7 +169,21 @@ namespace ZUGFeRDRESTService.Controllers
_logger.Info("Extracting ZUGFeRD Data from file [{0}]", file.FileName);
oZugferdResult = _zugferd.ExtractZUGFeRDFileWithGDPicture(oStream);
if (file.FileName.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase))
{
oZugferdResult = _zugferd.ExtractZUGFeRDFileWithGDPicture(oStream);
}
else if (file.FileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
{
// Für die Verarbeitung von XML-Belegen
var oResult = new ZugferdResult()
{
DataFileName = file.FileName,
XElementObject = XElement.Load(oStream)
};
oZugferdResult = _zugferd.SerializeZUGFeRDDocument(oResult);
}
_logger.Info("Detected Specification was: [{0}]", oZugferdResult.Specification);