diff --git a/.gitignore b/.gitignore index 9bddfab..4332761 100644 --- a/.gitignore +++ b/.gitignore @@ -26,13 +26,13 @@ #*.obj # -Dokumentation +Documentation Samples/Win32 Samples/Win64 SaxonHE-Unmanaged Distribution/validator Distribution/validator-configuration-122 -Distribution/validator-configuration-201 +Distribution/validator-configuration-211 Distribution/visualization Distribution/java Schema diff --git a/Distribution/README.md b/Distribution/README.md index f7b8cab..3d9a8a6 100644 --- a/Distribution/README.md +++ b/Distribution/README.md @@ -4,7 +4,11 @@ Das Skript installtools.ps1 mit PowerShell ausf ## Historie -- 02.02.2020 Neues Release XRechnung Visualization 2020-12-31 compatible with XRechnung 2.0.1 +- 05.04.2022 Update xrechnung-2.1.1-xrechnung-visualization-2021-11-15 validator-configuration-xrechnung_2.1.1_2021-11-15 + +- 01.10.2021 Update validationtool-1.4.2 validator-configuration-xrechnung_2.1.1_2021-07-31 xrechnung-2.1.1-xrechnung-visualization-2021-07-31 + +- 02.02.2021 Neues Release XRechnung Visualization 2020-12-31 compatible with XRechnung 2.0.1 - 18.12.2020 Neues Release validator-configuration-xrechnung release-2020-12-31 diff --git a/Distribution/installtools.ps1 b/Distribution/installtools.ps1 index cd24354..c80e853 100644 --- a/Distribution/installtools.ps1 +++ b/Distribution/installtools.ps1 @@ -9,8 +9,8 @@ If (Test-Path validator-configuration-122){ If (Test-Path validator-configuration-200){ Remove-Item validator-configuration-200 -Recurse } -If (Test-Path validator-configuration-201){ - Remove-Item validator-configuration-201 -Recurse +If (Test-Path validator-configuration-211){ + Remove-Item validator-configuration-211 -Recurse } If (Test-Path visualization){ @@ -21,15 +21,15 @@ If (Test-Path java){ Remove-Item java -Recurse } -Invoke-WebRequest -Uri https://github.com/itplr-kosit/validator/releases/download/v1.4.1/validationtool-1.4.1.zip -OutFile validator.zip +Invoke-WebRequest -Uri https://github.com/itplr-kosit/validator/releases/download/v1.4.2/validator-1.4.2-distribution.zip -OutFile validator.zip Invoke-WebRequest -Uri https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2019-12-30/validator-configuration-xrechnung_1.2.2_2019-12-30.zip -OutFile validator-configuration-122.zip -Invoke-WebRequest -Uri https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2020-12-31/validator-configuration-xrechnung_2.0.1_2020-12-31.zip -OutFile validator-configuration-201.zip -Invoke-WebRequest -Uri https://github.com/itplr-kosit/xrechnung-visualization/releases/download/v2020-12-31/xrechnung-2.0.1-xrechnung-visualization-2020-12-31.zip -OutFile visualization.zip +Invoke-WebRequest -Uri https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2021-11-15/validator-configuration-xrechnung_2.1.1_2021-11-15.zip -OutFile validator-configuration-211.zip +Invoke-WebRequest -Uri https://github.com/itplr-kosit/xrechnung-visualization/releases/download/v2021-11-15/xrechnung-2.1.1-xrechnung-visualization-2021-11-15.zip -OutFile visualization.zip Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jre_x64_windows_hotspot_8u265b01.zip -OutFile jre.zip Expand-Archive validator.zip Expand-Archive validator-configuration-122.zip -Expand-Archive validator-configuration-201.zip +Expand-Archive validator-configuration-211.zip Expand-Archive visualization.zip Expand-Archive jre.zip Move-Item .\jre\jdk8u265-b01-jre .\java @@ -41,8 +41,8 @@ If (Test-Path validator.zip){ If (Test-Path validator-configuration-122.zip){ Remove-Item validator-configuration-122.zip } -If (Test-Path validator-configuration-201.zip){ - Remove-Item validator-configuration-201.zip +If (Test-Path validator-configuration-211.zip){ + Remove-Item validator-configuration-211.zip } If (Test-Path visualization.zip){ Remove-Item visualization.zip diff --git a/README.md b/README.md index 95a2316..7d26c4d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,10 @@ https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/41 ## Version -Aktuelle XRechnung-Versionen 1.2.2 und 2.0.1 +Aktuelle XRechnung-Versionen + +- 1.2.2 (Gültigkeitszeitraum 01.07.2020 - 31.12.2020) +- 2.1.1 (Gültigkeitszeitraum 01.02.2022 - 31.07.2022) ## Weitere Informationen zu XRechnung @@ -36,7 +39,7 @@ https://cranesoftwrights.github.io/resources/Crane-UBL-2.2-Skeleton/Crane-UBL-In english version below -Die Bibliothek "XRechnung-for-Delphi" unterliegt eine Doppellizenz. Sie können Sie kostenlos und +Die Bibliothek "XRechnung-for-Delphi" unterliegt eine Doppellizenz. Sie können sie kostenlos und ohne Einschränkungen unter der [GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) verwenden, oder Sie erwerben eine Lizenz zur kommerziellen Nutzung unter der [Landrix Software Commercial License](commercial.license.md) @@ -71,4 +74,3 @@ Please send an e-mail to info@landrix.de to request an invoice which will contai Support and enhancement requests submitted by users that pay for support will be prioritised. New developments may incur additional costs depending on time required for implementation. -ß diff --git a/Samples/XRechnungProject.dproj b/Samples/XRechnungProject.dproj index ad368a8..07c4374 100644 --- a/Samples/XRechnungProject.dproj +++ b/Samples/XRechnungProject.dproj @@ -1,12 +1,12 @@  {289847D5-0AA3-4C16-9133-97921118E4C5} - 19.2 + 19.4 VCL XRechnungProject.dpr True Debug - Win64 + Win32 3 Application @@ -79,9 +79,9 @@ Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) Debug true - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 1033 $(BDS)\bin\default_app.manifest + none DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;RemObjects_Synapse_D27;vclFireDAC;IndySystem;bindcompvclsmp;tethering;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;PKIECtrl27;vclimg;TeeDB;FireDAC;vcltouch;vcldb;bindcompfmx;FireDACSqliteDriver;FireDACPgDriver;RemObjects_Server_Synapse_D27;inetdb;RVPkg27;TMSVCLUIPackPkgExDX27;FMXTee;soaprtl;DbxCommonDriver;FmxTeeUI;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;vcledge;fmxobj;vclwinx;Tee;rtl;htmlcomp_DX27;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;hclcore_DX27;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;TeeUI;VCLRESTComponents;soapserver;dbxcds;VclSmp;TMSVCLUIPackPkgDX27;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;BaseRT27;RemObjects_Indy_D27;FireDACCommonODBC;FireDACCommonDriver;RemObjects_Server_Indy_D27;RemObjects_WebBroker_D27;inet;fmxase;$(DCC_UsePackage) @@ -101,13 +101,12 @@ false true - PerMonitorV2 true 1033 true - PerMonitorV2 + none true 1033 @@ -133,10 +132,6 @@
Form1
dfm - - Cfg_2 - Base - Base @@ -144,6 +139,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -154,8 +153,8 @@ XRechnungProject.dpr - Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver - Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server @@ -177,6 +176,16 @@ 0 + + + classes + 64 + + + classes + 64 + + classes @@ -478,6 +487,11 @@ 1 .framework + + Contents\MacOS + 1 + .framework + 0 @@ -505,6 +519,11 @@ 1 .dylib + + Contents\MacOS + 1 + .dylib + 0 .dll;.bpl @@ -533,6 +552,11 @@ 1 .dylib + + Contents\MacOS + 1 + .dylib + 0 .bpl @@ -562,6 +586,10 @@ Contents\Resources\StartUp\ 0 + + Contents\Resources\StartUp\ + 0 + 0 @@ -827,6 +855,10 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + @@ -837,6 +869,10 @@ ..\ 1 + + ..\ + 1 + @@ -847,6 +883,10 @@ Contents 1 + + Contents + 1 + @@ -857,6 +897,10 @@ Contents\Resources 1 + + Contents\Resources + 1 + @@ -887,6 +931,10 @@ Contents\MacOS 1 + + Contents\MacOS + 1 + 0 @@ -925,16 +973,17 @@ 1 - - + + + + - - - - + + + True diff --git a/Samples/XRechnungProject.res b/Samples/XRechnungProject.res index 2e8afa6..8b51c59 100644 Binary files a/Samples/XRechnungProject.res and b/Samples/XRechnungProject.res differ diff --git a/Samples/XRechnungUnit1.dfm b/Samples/XRechnungUnit1.dfm index d1895dd..fb8a865 100644 --- a/Samples/XRechnungUnit1.dfm +++ b/Samples/XRechnungUnit1.dfm @@ -1,7 +1,7 @@ object Form1: TForm1 Left = 0 Top = 0 - Caption = 'XRechnung for Delphi v1.3.2' + Caption = 'XRechnung for Delphi v1.3.3' ClientHeight = 1185 ClientWidth = 1910 Color = clBtnFace @@ -10,13 +10,11 @@ object Form1: TForm1 Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] - OldCreateOrder = False Position = poScreenCenter OnCreate = FormCreate DesignSize = ( 1910 1185) - PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 152 @@ -30,7 +28,7 @@ object Form1: TForm1 Top = 506 Width = 83 Height = 13 - Caption = 'XRechnung 2.0.1' + Caption = 'XRechnung 2.1.1' end object Label3: TLabel Left = 8 @@ -201,7 +199,7 @@ object Form1: TForm1 Top = 1142 Width = 129 Height = 25 - Caption = 'Laden' + Caption = 'Datei laden' TabOrder = 16 OnClick = Button2Click end diff --git a/Samples/XRechnungUnit1.pas b/Samples/XRechnungUnit1.pas index fbe972f..66e9b67 100644 --- a/Samples/XRechnungUnit1.pas +++ b/Samples/XRechnungUnit1.pas @@ -5,9 +5,10 @@ interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,Vcl.StdCtrls,Winapi.ShellApi,Winapi.ShlObj,WinApi.ActiveX + ,Vcl.OleCtrls, SHDocVw, Vcl.ExtCtrls ,System.IOUtils,System.Win.COMObj,System.UITypes ,Xml.xmldom,Xml.XMLDoc,Xml.XMLIntf,Xml.XMLSchema - ,intf.XRechnung, intf.Invoice, Vcl.OleCtrls, SHDocVw, Vcl.ExtCtrls + ,intf.XRechnung, intf.Invoice ,intf.XRechnungValidationHelperJava ; @@ -42,12 +43,12 @@ TForm1 = class(TForm) procedure Button2Click(Sender: TObject); private procedure Generate122(inv : TInvoice); - procedure Generate201(inv : TInvoice); + procedure Generate211(inv : TInvoice); public JavaRuntimeEnvironmentPath : String; ValidatorLibPath : String; ValidatorConfiguration122Path : String; - ValidatorConfiguration201Path : String; + ValidatorConfiguration211Path : String; VisualizationLibPath : String; end; @@ -69,7 +70,7 @@ procedure TForm1.FormCreate(Sender: TObject); JavaRuntimeEnvironmentPath := hstr +'java'+PathDelim; ValidatorLibPath := hstr +'validator'+PathDelim; ValidatorConfiguration122Path := hstr +'validator-configuration-122'+PathDelim; - ValidatorConfiguration201Path := hstr +'validator-configuration-201'+PathDelim; + ValidatorConfiguration211Path := hstr +'validator-configuration-211'+PathDelim; VisualizationLibPath := hstr +'visualization'+PathDelim; end; @@ -166,7 +167,7 @@ procedure TForm1.Button1Click(Sender: TObject); try Generate122(inv); - Generate201(inv); + Generate211(inv); finally inv.Free; end; @@ -176,12 +177,19 @@ procedure TForm1.Button2Click(Sender: TObject); var inv : TInvoice; error : String; + od : TOpenDialog; begin inv := TInvoice.Create; + od := TOpenDialog.Create(nil); try - if not TXRechnungInvoiceAdapter.LoadFromFile(inv, ExtractFilePath(Application.ExeName)+'XRechnung-UBL-201.xml',error) then - memo3.Lines.Text := error; + if not od.Execute then + exit; + if not TXRechnungInvoiceAdapter.LoadFromFile(inv, od.FileName,error) then + memo3.Lines.Text := error + else + ShowMessage('Eingelesen'); finally + od.Free; inv.Free; end; end; @@ -512,7 +520,7 @@ procedure TForm1.btCreateInvoiceClick(Sender: TObject); Generate122(inv); - Generate201(inv); + Generate211(inv); finally inv.Free; end; @@ -652,7 +660,7 @@ procedure TForm1.Button4Click(Sender: TObject); inv.PayableAmount := 428.40; //Summe Zahlbar MwSt try - Generate201(inv); + Generate211(inv); finally inv.Free; end; @@ -684,6 +692,7 @@ procedure TForm1.Generate122(inv: TInvoice); Doc.Close; Memo1.Lines.Text := xml; + Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-122.xml',TEncoding.UTF8); invtest := TInvoice.Create; try @@ -697,7 +706,7 @@ procedure TForm1.Generate122(inv: TInvoice); btX1ConvertHTML.Visible := true; end; -procedure TForm1.Generate201(inv: TInvoice); +procedure TForm1.Generate211(inv: TInvoice); var xml,cmdoutput,xmlresult,htmlresult,error : String; Doc : Variant; @@ -706,11 +715,11 @@ procedure TForm1.Generate201(inv: TInvoice); Memo3.Clear; if rbFormat.itemindex = 0 then begin - TXRechnungInvoiceAdapter.SaveToXMLStr(inv,XRechnungVersion_201_UBL,xml); + TXRechnungInvoiceAdapter.SaveToXMLStr(inv,XRechnungVersion_211_UBL,xml); GetXRechnungValidationHelperJava.SetJavaRuntimeEnvironmentPath(JavaRuntimeEnvironmentPath) .SetValidatorLibPath(ValidatorLibPath) - .SetValidatorConfigurationPath(ValidatorConfiguration201Path) + .SetValidatorConfigurationPath(ValidatorConfiguration211Path) .Validate(xml,cmdoutput,xmlresult,htmlresult); Memo3.Lines.Text := cmdoutput; @@ -724,6 +733,7 @@ procedure TForm1.Generate201(inv: TInvoice); Doc.Close; Memo2.Lines.Text := xml; + Memo2.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'XRechnung-UBL-211.xml',TEncoding.UTF8); invtest := TInvoice.Create; try @@ -738,11 +748,11 @@ procedure TForm1.Generate201(inv: TInvoice); end else begin - TXRechnungInvoiceAdapter.SaveToXMLStr(inv,XRechnungVersion_201_UNCEFACT,xml); + TXRechnungInvoiceAdapter.SaveToXMLStr(inv,XRechnungVersion_211_UNCEFACT,xml); GetXRechnungValidationHelperJava.SetJavaRuntimeEnvironmentPath(JavaRuntimeEnvironmentPath) .SetValidatorLibPath(ValidatorLibPath) - .SetValidatorConfigurationPath(ValidatorConfiguration201Path) + .SetValidatorConfigurationPath(ValidatorConfiguration211Path) .Validate(xml,cmdoutput,xmlresult,htmlresult); Memo3.Lines.Text := cmdoutput; @@ -756,6 +766,7 @@ procedure TForm1.Generate201(inv: TInvoice); Doc.Close; Memo2.Lines.Text := xml; + Memo2.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'XRechnung-UNCEFACT-211.xml',TEncoding.UTF8); invtest := TInvoice.Create; try diff --git a/intf.XRechnung.pas b/intf.XRechnung.pas index 291b14a..c21476b 100644 --- a/intf.XRechnung.pas +++ b/intf.XRechnung.pas @@ -48,25 +48,36 @@ TXRechnungHelper = class(TObject) // class function StrToCurr(_Val : String) : Currency; // class function StrToFloat(_Val : String) : double; class function AmountToStr(_Val : Currency) : String; + class function AmountFromStr(_Val : String) : Currency; class function UnitPriceAmountToStr(_Val : Currency) : String; + class function UnitPriceAmountFromStr(_Val : String) : Currency; class function FloatToStr(_Val : double) : String; + class function FloatFromStr(_Val : String) : double; class function PercentageToStr(_Val : double) : String; + class function PercentageFromStr(_Val : String) : double; class function QuantityToStr(_Val : double) : String; + class function QuantityFromStr(_Val : String) : double; class function InvoiceTypeCodeToStr(_Val : TInvoiceTypeCode) : String; class function InvoiceTypeCodeFromStr(const _Val : String) : TInvoiceTypeCode; class function InvoicePaymentMeansCodeToStr(_Val : TInvoicePaymentMeansCode) : String; + class function InvoicePaymentMeansCodeFromStr(_Val : String) : TInvoicePaymentMeansCode; class function InvoiceUnitCodeToStr(_Val : TInvoiceUnitCode) : String; //mehr Konvertierungen in Res\intf.XRechnung.unusedUnits.pas + class function InvoiceUnitCodeFromStr(_Val : String) : TInvoiceUnitCode; //mehr Konvertierungen in Res\intf.XRechnung.unusedUnits.pas class function InvoiceAllowanceOrChargeIdentCodeToStr(_Val : TInvoiceAllowanceOrChargeIdentCode) : String; + class function InvoiceAllowanceOrChargeIdentCodeFromStr(_Val : String) : TInvoiceAllowanceOrChargeIdentCode; class function InvoiceSpecialServiceDescriptionCodeToStr(_Val : TInvoiceSpecialServiceDescriptionCode) : String; + class function InvoiceSpecialServiceDescriptionCodeFromStr(_Val : String) : TInvoiceSpecialServiceDescriptionCode; class function InvoiceDutyTaxFeeCategoryCodeToStr(_Val : TInvoiceDutyTaxFeeCategoryCode) : String; + class function InvoiceDutyTaxFeeCategoryCodeFromStr(_Val : String) : TInvoiceDutyTaxFeeCategoryCode; class function InvoiceAttachmentTypeToStr(_Val : TInvoiceAttachmentType) : String; class function InvoiceAttachmentTypeFromStr(_Val : String) : TInvoiceAttachmentType; end; TXRechnungVersion = (XRechnungVersion_Unknown, XRechnungVersion_122, - XRechnungVersion_201_UBL, - XRechnungVersion_201_UNCEFACT); + XRechnungVersion_211_UBL, + XRechnungVersion_211_UNCEFACT, + XRechnungVersion_ReadingSupport_ZUGFeRDFacturX_2xx); TXRechnungValidationHelper = class(TObject) public type @@ -517,11 +528,424 @@ class function TXRechnungInvoiceAdapter.LoadDocumentUBL(_Invoice: TInvoice; class function TXRechnungInvoiceAdapter.LoadDocumentUNCEFACT(_Invoice: TInvoice; _Xml: IXMLDocument; out _Error : String) : Boolean; +var + xml : IXMLDOMDocument2; + node,node2,node3,node4,nodeSupplyChainTradeTransaction, + nodeApplicableHeaderTradeAgreement : IXMLDOMNode; + nodes : IXMLDOMNodeList; + i : Integer; + paymentTermsText : String; + paymentTerms,paymentTerm : TArray; + + procedure InternalReadInvoiceLine(_Invoiceline : TInvoiceLine; _Node : IXMLDOMNode); + var + nodei,node2i,node3i : IXMLDOMNode; + nodesi : IXMLDOMNodeList; + ii : Integer; + begin + if TXRechnungXMLHelper.SelectNode(_Node,'.//ram:AssociatedDocumentLineDocument',node2i) then + begin + _Invoiceline.ID := TXRechnungXMLHelper.SelectNodeText(node2i,'.//ram:LineID'); + if TXRechnungXMLHelper.SelectNode(node2i,'.//ram:IncludedNote',nodei) then + _Invoiceline.Note := TXRechnungXMLHelper.SelectNodeText(nodei,'.//ram:Content'); + end; + if TXRechnungXMLHelper.SelectNode(_Node,'.//ram:SpecifiedTradeProduct',node2i) then + begin + _Invoiceline.SellersItemIdentification := TXRechnungXMLHelper.SelectNodeText(node2i,'.//ram:SellerAssignedID'); + _Invoiceline.Name := TXRechnungXMLHelper.SelectNodeText(node2i,'.//ram:Name'); + _Invoiceline.Description := TXRechnungXMLHelper.SelectNodeText(node2i,'.//ram:Description'); + end; + if TXRechnungXMLHelper.SelectNode(_Node,'.//ram:SpecifiedLineTradeAgreement',node2i) then + begin +// +// 6171175.1 +// +// +// 6171175.1 +// + if TXRechnungXMLHelper.SelectNode(node2i,'.//ram:NetPriceProductTradePrice',node3i) then + begin + _Invoiceline.PriceAmount := TXRechnungHelper.UnitPriceAmountFromStr(TXRechnungXMLHelper.SelectNodeText(node3i,'.//ram:ChargeAmount')); + if TXRechnungXMLHelper.SelectNode(node3i,'.//ram:BaseQuantity',nodei) then + begin + _Invoiceline.BaseQuantityUnitCode := TXRechnungHelper.InvoiceUnitCodeFromStr(nodei.attributes.getNamedItem('unitCode').Text); + _Invoiceline.BaseQuantity := StrToIntDef(nodei.text,0); + end; + end; + end; + if TXRechnungXMLHelper.SelectNode(_Node,'.//ram:SpecifiedLineTradeDelivery',node2i) then + if TXRechnungXMLHelper.SelectNode(node2i,'.//ram:BilledQuantity',nodei) then + begin + _Invoiceline.UnitCode := TXRechnungHelper.InvoiceUnitCodeFromStr(nodei.attributes.getNamedItem('unitCode').Text); + _Invoiceline.Quantity := TXRechnungHelper.QuantityFromStr(nodei.text); + end; + if TXRechnungXMLHelper.SelectNode(_Node,'.//ram:SpecifiedLineTradeSettlement',node2i) then + begin + if TXRechnungXMLHelper.SelectNode(node2i,'.//ram:ApplicableTradeTax',nodei) then + begin + _Invoiceline.TaxCategory := TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodei,'.//ram:CategoryCode')); + _Invoiceline.TaxPercent := TXRechnungHelper.PercentageFromStr(TXRechnungXMLHelper.SelectNodeText(nodei,'.//ram:RateApplicablePercent')); + end; + if TXRechnungXMLHelper.SelectNodes(node2i,'.//ram:SpecifiedTradeAllowanceCharge',nodesi) then + for ii := 0 to nodesi.length-1 do + with _Invoiceline.AllowanceCharges.AddAllowanceCharge do + begin + if TXRechnungXMLHelper.SelectNode(nodesi[i],'.//ram:ChargeIndicator',node2i) then + if TXRechnungXMLHelper.SelectNode(node2i,'.//udt:Indicator',nodei) then + ChargeIndicator := StrToBoolDef(nodei.text,false); + MultiplierFactorNumeric := TXRechnungHelper.FloatFromStr(TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:CalculationPercent')); + BaseAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:BasisAmount')); + Amount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:ActualAmount')); + if ChargeIndicator then + ReasonCodeCharge := TXRechnungHelper.InvoiceSpecialServiceDescriptionCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:ReasonCode')) + else + ReasonCodeAllowance := TXRechnungHelper.InvoiceAllowanceOrChargeIdentCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:ReasonCode')); + Reason := TXRechnungXMLHelper.SelectNodeText(nodesi[i],'.//ram:Reason'); + end; + if TXRechnungXMLHelper.SelectNode(node2i,'.//ram:SpecifiedTradeSettlementLineMonetarySummation',nodei) then + begin + _Invoiceline.LineAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodei,'.//ram:LineTotalAmount')); + end; + end; + if TXRechnungXMLHelper.SelectNodes(_Node,'.//ram:IncludedSupplyChainTradeLineItem',nodesi) then + if nodesi.length > 0 then + raise Exception.Create('Reading SubInvoiceLines in UNCEFACT not implemented'); + end; + begin Result := false; _Error := ''; try + xml := TXRechnungXMLHelper.PrepareDocumentForXPathQuerys(_Xml); + if TXRechnungXMLHelper.SelectNode(xml,'//rsm:ExchangedDocument/ram:ID',node) then + _Invoice.InvoiceNumber := node.Text; + if TXRechnungXMLHelper.SelectNode(xml,'//rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString',node) then + _Invoice.InvoiceIssueDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(node.Text); + if TXRechnungXMLHelper.SelectNode(xml,'//rsm:ExchangedDocument/ram:TypeCode',node) then + _Invoice.InvoiceTypeCode := TXRechnungHelper.InvoiceTypeCodeFromStr(node.Text); + if TXRechnungXMLHelper.SelectNode(xml,'//rsm:ExchangedDocument/ram:IncludedNote/ram:Content',node) then + _Invoice.Note := node.Text; + + if not TXRechnungXMLHelper.SelectNode(xml,'//rsm:SupplyChainTradeTransaction',nodeSupplyChainTradeTransaction) then + exit; + + if TXRechnungXMLHelper.SelectNodes(nodeSupplyChainTradeTransaction,'.//ram:IncludedSupplyChainTradeLineItem',nodes) then + for i := 0 to nodes.length-1 do + InternalReadInvoiceLine(_Invoice.InvoiceLines.AddInvoiceLine,nodes[i]); + + if TXRechnungXMLHelper.SelectNode(nodeSupplyChainTradeTransaction,'.//ram:ApplicableHeaderTradeAgreement',nodeApplicableHeaderTradeAgreement) then + begin + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:BuyerReference',node) then + _Invoice.BuyerReference := node.text; + + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:SellerTradeParty',node2) then + begin + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:ID',node) then + _Invoice.AccountingSupplierParty.IdentifierSellerBuyer := node.text; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:Name',node) then + _Invoice.AccountingSupplierParty.RegistrationName := node.text; + + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:SpecifiedLegalOrganization',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:ID',node) then + _Invoice.AccountingSupplierParty.CompanyID := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:TradingBusinessName',node) then + _Invoice.AccountingSupplierParty.Name := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:DefinedTradeContact',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:PersonName',node) then + _Invoice.AccountingSupplierParty.ContactName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:TelephoneUniversalCommunication',node4) then + if TXRechnungXMLHelper.SelectNode(node4,'.//ram:CompleteNumber',node) then + _Invoice.AccountingSupplierParty.ContactTelephone := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:EmailURIUniversalCommunication',node4) then + if TXRechnungXMLHelper.SelectNode(node4,'.//ram:URIID',node) then + _Invoice.AccountingSupplierParty.ContactElectronicMail := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:PostalTradeAddress',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:PostcodeCode',node) then + _Invoice.AccountingSupplierParty.Address.PostalZone := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineOne',node) then + _Invoice.AccountingSupplierParty.Address.StreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineTwo',node) then + _Invoice.AccountingSupplierParty.Address.AdditionalStreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineThree',node) then + _Invoice.AccountingSupplierParty.Address.AddressLine := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CityName',node) then + _Invoice.AccountingSupplierParty.Address.City := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountryID',node) then + _Invoice.AccountingSupplierParty.Address.CountryCode := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountrySubDivisionName',node) then + _Invoice.AccountingSupplierParty.Address.CountrySubentity := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:SpecifiedTaxRegistration',node3) then + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:ID',node4) then + _Invoice.AccountingSupplierParty.VATCompanyID := node4.text; + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:BuyerTradeParty',node2) then + begin + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:ID',node) then + _Invoice.AccountingCustomerParty.IdentifierSellerBuyer := node.text; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:Name',node) then + _Invoice.AccountingCustomerParty.RegistrationName := node.text; + + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:SpecifiedLegalOrganization',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:ID',node) then + _Invoice.AccountingCustomerParty.CompanyID := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:TradingBusinessName',node) then + _Invoice.AccountingCustomerParty.Name := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:DefinedTradeContact',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:PersonName',node) then + _Invoice.AccountingCustomerParty.ContactName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:TelephoneUniversalCommunication',node4) then + if TXRechnungXMLHelper.SelectNode(node4,'.//ram:CompleteNumber',node) then + _Invoice.AccountingCustomerParty.ContactTelephone := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:EmailURIUniversalCommunication',node4) then + if TXRechnungXMLHelper.SelectNode(node4,'.//ram:URIID',node) then + _Invoice.AccountingCustomerParty.ContactElectronicMail := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:PostalTradeAddress',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:PostcodeCode',node) then + _Invoice.AccountingCustomerParty.Address.PostalZone := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineOne',node) then + _Invoice.AccountingCustomerParty.Address.StreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineTwo',node) then + _Invoice.AccountingCustomerParty.Address.AdditionalStreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineThree',node) then + _Invoice.AccountingCustomerParty.Address.AddressLine := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CityName',node) then + _Invoice.AccountingCustomerParty.Address.City := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountryID',node) then + _Invoice.AccountingCustomerParty.Address.CountryCode := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountrySubDivisionName',node) then + _Invoice.AccountingCustomerParty.Address.CountrySubentity := node.text; + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:SpecifiedTaxRegistration',node3) then + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:ID',node4) then + _Invoice.AccountingCustomerParty.VATCompanyID := node4.text; + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:BuyerOrderReferencedDocument',node2) then + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:IssuerAssignedID',node) then + _Invoice.PurchaseOrderReference := node.text; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:ContractReferencedDocument',node2) then + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:IssuerAssignedID',node) then + _Invoice.ContractDocumentReference := node.text; + + if TXRechnungXMLHelper.SelectNodes(nodeApplicableHeaderTradeAgreement,'.//ram:AdditionalReferencedDocument',nodes) then + for i := 0 to nodes.length-1 do + with _Invoice.Attachments.AddAttachment(iat_application_None) do + begin + ID := TXRechnungXMLHelper.SelectNodeText(nodes.item[i],'.//ram:IssuerAssignedID'); + DocumentDescription := TXRechnungXMLHelper.SelectNodeText(nodes.item[i],'.//ram:Name'); + if TXRechnungXMLHelper.FindNode(nodes.item[i],'.//ram:URIID') then + ExternalReference := TXRechnungXMLHelper.SelectNodeText(nodes.item[i],'.//ram:URIID') + else + if TXRechnungXMLHelper.SelectNode(nodes.item[i],'.//ram:AttachmentBinaryObject',node) then + begin + AttachmentType := TXRechnungHelper.InvoiceAttachmentTypeFromStr(node.Attributes.getNamedItem('mimeCode').Text); + Filename := node.Attributes.getNamedItem('filename').Text; + SetDataFromBase64(node.Text); + end; + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:SpecifiedProcuringProject',node2) then + begin + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:ID',node) then + _Invoice.ProjectReference := node.text; + end; + end; + if TXRechnungXMLHelper.SelectNode(nodeSupplyChainTradeTransaction,'.//ram:ApplicableHeaderTradeDelivery',nodeApplicableHeaderTradeAgreement) then + begin + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:ShipToTradeParty',node2) then + begin + _Invoice.DeliveryInformation.Name := TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:Name'); + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:PostalTradeAddress',node3) then + begin + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:PostcodeCode',node) then + _Invoice.DeliveryInformation.Address.PostalZone := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineOne',node) then + _Invoice.DeliveryInformation.Address.StreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineTwo',node) then + _Invoice.DeliveryInformation.Address.AdditionalStreetName := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:LineThree',node) then + _Invoice.DeliveryInformation.Address.AddressLine := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CityName',node) then + _Invoice.DeliveryInformation.Address.City := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountryID',node) then + _Invoice.DeliveryInformation.Address.CountryCode := node.text; + if TXRechnungXMLHelper.SelectNode(node3,'.//ram:CountrySubDivisionName',node) then + _Invoice.DeliveryInformation.Address.CountrySubentity := node.text; + end; + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:ActualDeliverySupplyChainEvent',node2) then + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:OccurrenceDateTime',node3) then + if TXRechnungXMLHelper.SelectNode(node3,'.//udt:DateTimeString',node) then + _Invoice.DeliveryInformation.ActualDeliveryDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(node.Text); + end; + if TXRechnungXMLHelper.SelectNode(nodeSupplyChainTradeTransaction,'.//ram:ApplicableHeaderTradeSettlement',nodeApplicableHeaderTradeAgreement) then + begin + _Invoice.PaymentID := TXRechnungXMLHelper.SelectNodeText(nodeApplicableHeaderTradeAgreement,'.//ram:PaymentReference'); + _Invoice.InvoiceCurrencyCode := TXRechnungXMLHelper.SelectNodeText(nodeApplicableHeaderTradeAgreement,'.//ram:InvoiceCurrencyCode'); + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:SpecifiedTradeSettlementPaymentMeans',node2) then + begin + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:TypeCode',node) then + _Invoice.PaymentMeansCode := TXRechnungHelper.InvoicePaymentMeansCodeFromStr(node.text); + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:PayeePartyCreditorFinancialAccount',node3) then + begin + _Invoice.PayeeFinancialAccount := TXRechnungXMLHelper.SelectNodeText(node3,'.//ram:IBANID'); + _Invoice.PayeeFinancialAccountName := TXRechnungXMLHelper.SelectNodeText(node3,'.//ram:AccountName'); + end; + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:PayeeSpecifiedCreditorFinancialInstitution',node3) then + _Invoice.PayeeFinancialInstitutionBranch := TXRechnungXMLHelper.SelectNodeText(node3,'.//ram:BICID'); + end; + if TXRechnungXMLHelper.SelectNodes(nodeApplicableHeaderTradeAgreement,'.//ram:ApplicableTradeTax',nodes) then + for i := 0 to nodes.length-1 do + begin + SetLength(_Invoice.TaxAmountSubtotals,Length(_Invoice.TaxAmountSubtotals)+1); + _Invoice.TaxAmountSubtotals[Length(_Invoice.TaxAmountSubtotals)-1].TaxAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:CalculatedAmount')); + _Invoice.TaxAmountSubtotals[Length(_Invoice.TaxAmountSubtotals)-1].TaxExemptionReason := TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:ExemptionReason'); + _Invoice.TaxAmountSubtotals[Length(_Invoice.TaxAmountSubtotals)-1].TaxableAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:BasisAmount')); + _Invoice.TaxAmountSubtotals[Length(_Invoice.TaxAmountSubtotals)-1].TaxCategory := TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:CategoryCode')); + _Invoice.TaxAmountSubtotals[Length(_Invoice.TaxAmountSubtotals)-1].TaxPercent := TXRechnungHelper.PercentageFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:RateApplicablePercent')); + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:BillingSpecifiedPeriod',node2) then + begin + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:StartDateTime',node) then + _Invoice.InvoicePeriodStartDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(TXRechnungXMLHelper.SelectNodeText(node,'.//udt:DateTimeString')); + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:EndDateTime',node) then + _Invoice.InvoicePeriodEndDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(TXRechnungXMLHelper.SelectNodeText(node,'.//udt:DateTimeString')); + end; + if TXRechnungXMLHelper.SelectNodes(nodeApplicableHeaderTradeAgreement,'.//ram:SpecifiedTradeAllowanceCharge',nodes) then + for i := 0 to nodes.length-1 do + with _Invoice.AllowanceCharges.AddAllowanceCharge do + begin + if TXRechnungXMLHelper.SelectNode(nodes[i],'.//ram:ChargeIndicator',node2) then + if TXRechnungXMLHelper.SelectNode(node2,'.//udt:Indicator',node) then + ChargeIndicator := StrToBoolDef(node.text,false); + MultiplierFactorNumeric := TXRechnungHelper.FloatFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:CalculationPercent')); + BaseAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:BasisAmount')); + Amount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:ActualAmount')); + if ChargeIndicator then + ReasonCodeCharge := TXRechnungHelper.InvoiceSpecialServiceDescriptionCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:ReasonCode')) + else + ReasonCodeAllowance := TXRechnungHelper.InvoiceAllowanceOrChargeIdentCodeFromStr(TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:ReasonCode')); + Reason := TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:Reason'); + if TXRechnungXMLHelper.SelectNode(nodes[i],'.//ram:CategoryTradeTax',node2) then + begin + TaxCategory := TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:CategoryCode')); + TaxPercent := TXRechnungHelper.PercentageFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:RateApplicablePercent')); + end; + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:SpecifiedTradePaymentTerms',node2) then + begin + paymentTermsText := TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:Description'); + if Pos('#SKONTO#',paymentTermsText) = 0 then + begin + _Invoice.PaymentTermsType := iptt_Net; + _Invoice.PaymentTermNetNote := paymentTermsText; + end else + if (Pos('#SKONTO#',paymentTermsText) = 1) and (Pos(#10,Trim(paymentTermsText)) > 1) then //zweimal Skonto + begin + _Invoice.PaymentTermsType := iptt_CashDiscount2; + paymentTerms := paymentTermsText.Split([#10]); + if (Length(paymentTerms) >= 2) then if (Pos('#SKONTO#',paymentTerms[1]) = 1) then + begin + paymentTerm := paymentTerms[1].Split(['#']); //0 Leer, 1 Skonto, 2 Tage, 3 Prozent, 4 Leer o. Basiswert + if (Length(paymentTerm) >= 5) then + begin + Delete(paymentTerm[2],1,5); + _Invoice.PaymentTermCashDiscount2Days := StrToIntDef(paymentTerm[2],0); + Delete(paymentTerm[3],1,8); + _Invoice.PaymentTermCashDiscount2Percent := TXRechnungHelper.FloatFromStr(paymentTerm[3]); + if Pos('BASISBETRAG=',paymentTerm[4])=1 then + begin + Delete(paymentTerm[4],1,12); + _Invoice.PaymentTermCashDiscount2Base := TXRechnungHelper.AmountFromStr(paymentTerm[4]); + end + else + _Invoice.PaymentTermCashDiscount2Base := 0; + end; + end else + _Invoice.PaymentTermsType := iptt_CashDiscount1; + if (Length(paymentTerms) >= 1) then if (Pos('#SKONTO#',paymentTerms[0]) = 1) then + begin + paymentTerm := paymentTerms[0].Split(['#']); //0 Leer, 1 Skonto, 2 Tage, 3 Prozent, 4 Leer o. Basiswert + if (Length(paymentTerm) >= 5) then + begin + Delete(paymentTerm[2],1,5); + _Invoice.PaymentTermCashDiscount1Days := StrToIntDef(paymentTerm[2],0); + Delete(paymentTerm[3],1,8); + _Invoice.PaymentTermCashDiscount1Percent := TXRechnungHelper.FloatFromStr(paymentTerm[3]); + if Pos('BASISBETRAG=',paymentTerm[4])=1 then + begin + Delete(paymentTerm[4],1,12); + _Invoice.PaymentTermCashDiscount1Base := TXRechnungHelper.AmountFromStr(paymentTerm[4]); + end + else + _Invoice.PaymentTermCashDiscount1Base := 0; + end; + end else + _Invoice.PaymentTermsType := iptt_Net; + end else + if Pos('#SKONTO#',paymentTermsText) = 1 then //einmal Skonto + begin + _Invoice.PaymentTermsType := iptt_CashDiscount1; + paymentTerm := paymentTermsText.Split(['#']); //0 Leer, 1 Skonto, 2 Tage, 3 Prozent, 4 Leer o. Basiswert + if (Length(paymentTerm) >= 5) then + begin + Delete(paymentTerm[2],1,5); + _Invoice.PaymentTermCashDiscount1Days := StrToIntDef(paymentTerm[2],0); + Delete(paymentTerm[3],1,8); + _Invoice.PaymentTermCashDiscount1Percent := TXRechnungHelper.FloatFromStr(paymentTerm[3]); + if Pos('BASISBETRAG=',paymentTerm[4])=1 then + begin + Delete(paymentTerm[4],1,12); + _Invoice.PaymentTermCashDiscount1Base := TXRechnungHelper.AmountFromStr(paymentTerm[4]); + end + else + _Invoice.PaymentTermCashDiscount1Base := 0; + end; + end else + begin + _Invoice.PaymentTermsType := iptt_None; + _Invoice.PaymentTermNetNote := paymentTermsText; + end; + + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:DueDateDateTime',node3) then + if TXRechnungXMLHelper.SelectNode(node3,'.//udt:DateTimeString',node) then + _Invoice.InvoiceDueDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(node.text); + end; + if TXRechnungXMLHelper.SelectNode(nodeApplicableHeaderTradeAgreement,'.//ram:SpecifiedTradeSettlementHeaderMonetarySummation',node2) then + begin + _Invoice.LineAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:LineTotalAmount')); + _Invoice.ChargeTotalAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:ChargeTotalAmount')); + _Invoice.AllowanceTotalAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:AllowanceTotalAmount')); + _Invoice.TaxExclusiveAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:TaxBasisTotalAmount')); + if TXRechnungXMLHelper.SelectNode(node2,'.//ram:TaxTotalAmount',node) then + begin + _Invoice.TaxCurrencyCode := node.attributes.getNamedItem('currencyID').Text; + _Invoice.TaxAmountTotal := TXRechnungHelper.AmountFromStr(node.text); + end; + _Invoice.TaxInclusiveAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:GrandTotalAmount')); + _Invoice.PrepaidAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:TotalPrepaidAmount')); + _Invoice.PayableAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,'.//ram:DuePayableAmount')); + end; + if TXRechnungXMLHelper.SelectNodes(nodeApplicableHeaderTradeAgreement,'.//ram:InvoiceReferencedDocument',nodes) then + for i := 0 to nodes.length-1 do + with _Invoice.PrecedingInvoiceReferences.AddPrecedingInvoiceReference do + begin + ID := TXRechnungXMLHelper.SelectNodeText(nodes[i],'.//ram:IssuerAssignedID'); + if TXRechnungXMLHelper.SelectNode(nodes[i],'.//ram:FormattedIssueDateTime',node2) then + if TXRechnungXMLHelper.SelectNode(node2,'.//qdt:DateTimeString',node) then + IssueDate := TXRechnungHelper.DateFromStrUNCEFACTFormat(node.text); + end; + end; Result := true; except on E:Exception do _Error := E.ClassName+' '+E.Message; @@ -546,8 +970,9 @@ class function TXRechnungInvoiceAdapter.LoadFromFile(_Invoice: TInvoice; xml.LoadFromFile(_Filename); case TXRechnungValidationHelper.GetXRechnungVersion(xml) of XRechnungVersion_122 : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_122,xml,_Error); - XRechnungVersion_201_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_201_UBL,xml,_Error); - XRechnungVersion_201_UNCEFACT : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); + XRechnungVersion_211_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_211_UBL,xml,_Error); + XRechnungVersion_211_UNCEFACT, + XRechnungVersion_ReadingSupport_ZUGFeRDFacturX_2xx : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); else exit; end; finally @@ -571,8 +996,9 @@ class function TXRechnungInvoiceAdapter.LoadFromStream(_Invoice: TInvoice; xml.LoadFromStream(_Stream); case TXRechnungValidationHelper.GetXRechnungVersion(xml) of XRechnungVersion_122 : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_122,xml,_Error); - XRechnungVersion_201_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_122,xml,_Error); - XRechnungVersion_201_UNCEFACT : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); + XRechnungVersion_211_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_211_UBL,xml,_Error); + XRechnungVersion_211_UNCEFACT, + XRechnungVersion_ReadingSupport_ZUGFeRDFacturX_2xx : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); else exit; end; finally @@ -596,8 +1022,9 @@ class function TXRechnungInvoiceAdapter.LoadFromXMLStr(_Invoice: TInvoice; xml.LoadFromXML(_XML); case TXRechnungValidationHelper.GetXRechnungVersion(xml) of XRechnungVersion_122 : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_122,xml,_Error); - XRechnungVersion_201_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_122,xml,_Error); - XRechnungVersion_201_UNCEFACT : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); + XRechnungVersion_211_UBL : Result := LoadDocumentUBL(_Invoice,XRechnungVersion_211_UBL,xml,_Error); + XRechnungVersion_211_UNCEFACT, + XRechnungVersion_ReadingSupport_ZUGFeRDFacturX_2xx : Result := LoadDocumentUNCEFACT(_Invoice,xml,_Error); else exit; end; finally @@ -610,8 +1037,8 @@ class procedure TXRechnungInvoiceAdapter.SaveDocument(_Invoice: TInvoice; begin case _Version of XRechnungVersion_122, - XRechnungVersion_201_UBL : SaveDocumentUBL(_Invoice,_Version,_Xml); - XRechnungVersion_201_UNCEFACT : SaveDocumentUNCEFACT(_Invoice,_Xml); + XRechnungVersion_211_UBL : SaveDocumentUBL(_Invoice,_Version,_Xml); + XRechnungVersion_211_UNCEFACT : SaveDocumentUNCEFACT(_Invoice,_Xml); else raise Exception.Create('XRechnung - wrong version'); end; end; @@ -718,7 +1145,7 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUBL(_Invoice: TInvoice; Text := IntToStr(_Invoiceline.BaseQuantity); end; end; - if _Version = XRechnungVersion_201_UBL then + if _Version = XRechnungVersion_211_UBL then for subinvoiceline in _Invoiceline.SubInvoiceLines do InternalAddInvoiceLine(subinvoiceline,_Node.AddChild('cac:SubInvoiceLine')); end; @@ -748,8 +1175,8 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUBL(_Invoice: TInvoice; xRoot.AddChild('cbc:CustomizationID').Text := 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2'; end else begin - xRoot.AddChild('cbc:CustomizationID').Text := 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0'+ - IfThen(InternalExtensionEnabled,'#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0',''); + xRoot.AddChild('cbc:CustomizationID').Text := 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.1'+ + IfThen(InternalExtensionEnabled,'#conformant#urn:xoev-de:kosit:extension:xrechnung_2.1',''); end; xRoot.AddChild('cbc:ID').Text := _Invoice.InvoiceNumber; @@ -954,7 +1381,7 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUBL(_Invoice: TInvoice; TXRechnungHelper.FloatToStr(_Invoice.PaymentTermCashDiscount1Percent)])+ IfThen(_Invoice.PaymentTermCashDiscount1Base <> 0,'BASISBETRAG='+ TXRechnungHelper.AmountToStr(_Invoice.PaymentTermCashDiscount1Base)+'#','')+ - IfThen(_Version = XRechnungVersion_201_UBL,#13#10,''); + IfThen(_Version = XRechnungVersion_211_UBL,#13#10,''); end; iptt_CashDiscount2: begin @@ -971,7 +1398,7 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUBL(_Invoice: TInvoice; TXRechnungHelper.FloatToStr(_Invoice.PaymentTermCashDiscount2Percent)])+ IfThen(_Invoice.PaymentTermCashDiscount2Base <> 0,'BASISBETRAG='+ TXRechnungHelper.AmountToStr(_Invoice.PaymentTermCashDiscount2Base)+'#','')+ - IfThen(_Version = XRechnungVersion_201_UBL,#13#10,''); + IfThen(_Version = XRechnungVersion_211_UBL,#13#10,''); end; end; end; @@ -1180,7 +1607,7 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUNCEFACT(_Invoice: TInvoice xRoot.AddChild('rsm:ExchangedDocumentContext') .AddChild('ram:GuidelineSpecifiedDocumentContextParameter') - .AddChild('ram:ID').Text := 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0'; + .AddChild('ram:ID').Text := 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.1'; with xRoot.AddChild('rsm:ExchangedDocument') do begin @@ -1589,12 +2016,31 @@ class function TXRechnungXMLHelper.FindNode(_XnRoot: IXMLDOMNode; const _NodePat { TXRechnungHelper } +class function TXRechnungHelper.AmountFromStr(_Val: String): Currency; +var + fs : TFormatSettings; +begin + fs.ThousandSeparator := ','; + fs.DecimalSeparator := '.'; + Result := StrToCurrDef(_Val,0,fs); +end; + class function TXRechnungHelper.AmountToStr( _Val: Currency): String; begin Result := System.StrUtils.ReplaceText(Format('%.2f',[_Val]),',','.'); end; +class function TXRechnungHelper.UnitPriceAmountFromStr( + _Val: String): Currency; +var + fs : TFormatSettings; +begin + fs.ThousandSeparator := ','; + fs.DecimalSeparator := '.'; + Result := StrToCurrDef(_Val,0,fs); +end; + class function TXRechnungHelper.UnitPriceAmountToStr( _Val: Currency): String; begin @@ -1629,12 +2075,64 @@ class function TXRechnungHelper.DateToStrUNCEFACTFormat( Result := FormatDateTime('yyyymmdd',_Val); end; +class function TXRechnungHelper.FloatFromStr(_Val: String): double; +var + fs : TFormatSettings; +begin + fs.ThousandSeparator := ','; + fs.DecimalSeparator := '.'; + Result := StrToFloatDef(_Val,0,fs); +end; + class function TXRechnungHelper.FloatToStr( _Val: double): String; begin Result := System.StrUtils.ReplaceText(Format('%.2f',[_Val]),',','.'); end; +class function TXRechnungHelper.InvoiceAllowanceOrChargeIdentCodeFromStr( + _Val: String): TInvoiceAllowanceOrChargeIdentCode; +begin + if SameText(_Val,'41') then + Result := iacic_BonusForWorksAheadOfSchedule else + if SameText(_Val,'42') then + Result := iacic_OtherBonus else + if SameText(_Val,'60') then + Result := iacic_ManufacturersConsumerDiscount else + if SameText(_Val,'62') then + Result := iacic_DueToMilitaryStatus else + if SameText(_Val,'63') then + Result := iacic_DueToWorkAccident else + if SameText(_Val,'64') then + Result := iacic_SpecialAgreement else + if SameText(_Val,'65') then + Result := iacic_ProductionErrorDiscount else + if SameText(_Val,'66') then + Result := iacic_NewOutletDiscount else + if SameText(_Val,'67') then + Result := iacic_SampleDiscount else + if SameText(_Val,'68') then + Result := iacic_EndOfRangeDiscount else + if SameText(_Val,'70') then + Result := iacic_IncotermDiscount else + if SameText(_Val,'71') then + Result := iacic_PointOfSalesThresholdAllowance else + if SameText(_Val,'88') then + Result := iacic_MaterialSurchargeDeduction else + if SameText(_Val,'95') then + Result := iacic_Discount else + if SameText(_Val,'100') then + Result := iacic_SpecialRebate else + if SameText(_Val,'102') then + Result := iacic_FixedLongTerm else + if SameText(_Val,'103') then + Result := iacic_Temporary else + if SameText(_Val,'104') then + Result := iacic_Standard else + Result := iacic_None; + +end; + class function TXRechnungHelper.InvoiceAllowanceOrChargeIdentCodeToStr( _Val: TInvoiceAllowanceOrChargeIdentCode): String; begin @@ -1780,6 +2278,36 @@ class function TXRechnungHelper.InvoiceAttachmentTypeFromStr(_Val: String): TInv Result := iat_application_None end; +class function TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeFromStr( + _Val: String): TInvoiceDutyTaxFeeCategoryCode; +begin + if SameText(_Val,'AE') then + Result := idtfcc_AE_VATReverseCharge + else + if SameText(_Val,'E') then + Result := idtfcc_E_ExemptFromTax + else + if SameText(_Val,'G') then + Result := idtfcc_G_FreeExportItemTaxNotCharged + else + if SameText(_Val,'K') then + Result := idtfcc_K_VATExemptForEEAIntracommunitySupplyOfGoodsAndServices + else + if SameText(_Val,'L') then + Result := idtfcc_L_CanaryIslandsGeneralIndirectTax + else + if SameText(_Val,'M') then + Result := idtfcc_M_TaxForProductionServicesAndImportationInCeutaAndMelilla + else + if SameText(_Val,'S') then + Result := idtfcc_S_StandardRate + else + if SameText(_Val,'Z') then + Result := idtfcc_Z_ZeroRatedGoods + else + Result := idtfcc_None; +end; + class function TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeToStr(_Val: TInvoiceDutyTaxFeeCategoryCode): String; begin case _Val of @@ -1808,6 +2336,15 @@ class function TXRechnungHelper.InvoiceDutyTaxFeeCategoryCodeToStr(_Val: TInvoic end; end; +class function TXRechnungHelper.InvoicePaymentMeansCodeFromStr( + _Val: String): TInvoicePaymentMeansCode; +begin + if SameText(_Val,'58') then + Result := ipmc_SEPACreditTransfer + else + Result := ipmc_None; +end; + class function TXRechnungHelper.InvoicePaymentMeansCodeToStr(_Val: TInvoicePaymentMeansCode): String; begin case _Val of @@ -1816,6 +2353,18 @@ class function TXRechnungHelper.InvoicePaymentMeansCodeToStr(_Val: TInvoicePayme end; end; +class function TXRechnungHelper.InvoiceSpecialServiceDescriptionCodeFromStr( + _Val: String): TInvoiceSpecialServiceDescriptionCode; +begin + if SameText(_Val,'AAA') then + Result := issdc_AAA_Telecommunication else + if SameText(_Val,'ABK') then + Result := issdc_ABK_Miscellaneous else + if SameText(_Val,'PC') then + Result := issdc_PC_Packing else + Result := issdc_None; +end; + class function TXRechnungHelper.InvoiceSpecialServiceDescriptionCodeToStr( _Val: TInvoiceSpecialServiceDescriptionCode): String; begin @@ -1871,6 +2420,52 @@ class function TXRechnungHelper.InvoiceTypeCodeToStr(_Val: TInvoiceTypeCode): St end; end; +class function TXRechnungHelper.InvoiceUnitCodeFromStr( + _Val: String): TInvoiceUnitCode; +begin + if SameText(_Val,'H87') then + Result := iuc_piece else + if SameText(_Val,'NAR') then + Result := iuc_number_of_articles else + if SameText(_Val,'SET') then + Result := iuc_set else + if SameText(_Val,'WEE') then + Result := iuc_week else + if SameText(_Val,'MON') then + Result := iuc_month else + if SameText(_Val,'DAY') then + Result := iuc_day else + if SameText(_Val,'TNE') then + Result := iuc_tonne_metric_ton else + if SameText(_Val,'MTK') then + Result := iuc_square_metre else + if SameText(_Val,'MTQ') then + Result := iuc_cubic_metre else + if SameText(_Val,'MTR') then + Result := iuc_metre else + if SameText(_Val,'MMK') then + Result := iuc_square_millimetre else + if SameText(_Val,'MMQ') then + Result := iuc_cubic_millimetre else + if SameText(_Val,'MMT') then + Result := iuc_millimetre else + if SameText(_Val,'MIN') then + Result := iuc_minute_unit_of_time else + if SameText(_Val,'SEC') then + Result := iuc_second_unit_of_time else + if SameText(_Val,'LTR') then + Result := iuc_litre else + if SameText(_Val,'HUR') then + Result := iuc_hour else + if SameText(_Val,'KGM') then + Result := iuc_kilogram else + if SameText(_Val,'KMT') then + Result := iuc_kilometre else + if SameText(_Val,'KWH') then + Result := iuc_kilowatt_hour else + Result := iuc_one; //C62 +end; + class function TXRechnungHelper.InvoiceUnitCodeToStr(_Val: TInvoiceUnitCode): String; begin //mehr Konvertierungen in Res\intf.XRechnung.unusedUnits.pas @@ -1899,11 +2494,29 @@ class function TXRechnungHelper.InvoiceUnitCodeToStr(_Val: TInvoiceUnitCode): St end; end; +class function TXRechnungHelper.PercentageFromStr(_Val: String): double; +var + fs : TFormatSettings; +begin + fs.ThousandSeparator := ','; + fs.DecimalSeparator := '.'; + Result := StrToFloatDef(_Val,0,fs); +end; + class function TXRechnungHelper.PercentageToStr(_Val: double): String; begin Result := System.StrUtils.ReplaceText(Format('%.2f',[_Val]),',','.'); end; +class function TXRechnungHelper.QuantityFromStr(_Val: String): double; +var + fs : TFormatSettings; +begin + fs.ThousandSeparator := ','; + fs.DecimalSeparator := '.'; + Result := StrToFloatDef(_Val,0,fs); +end; + class function TXRechnungHelper.QuantityToStr(_Val: double): String; begin Result := System.StrUtils.ReplaceText(Format('%.4f',[_Val]),',','.'); @@ -1928,7 +2541,7 @@ class function TXRechnungHelper.QuantityToStr(_Val: double): String; class function TXRechnungValidationHelper.GetXRechnungVersion( _Xml: IXMLDocument): TXRechnungVersion; var - node : IXMLNode; + node,node2 : IXMLNode; begin Result := XRechnungVersion_Unknown; if _XML = nil then @@ -1937,8 +2550,8 @@ class function TXRechnungValidationHelper.GetXRechnungVersion( begin if not TXRechnungXMLHelper.FindChild(_XML.DocumentElement,'cbc:CustomizationID',node) then exit; - if node.Text.EndsWith('xrechnung_2.0',true) then - Result := XRechnungVersion_201_UBL + if node.Text.EndsWith('xrechnung_2.1',true) then + Result := XRechnungVersion_211_UBL else if node.Text.EndsWith('xrechnung_1.2',true) then Result := XRechnungVersion_122; @@ -1947,12 +2560,15 @@ class function TXRechnungValidationHelper.GetXRechnungVersion( begin if not TXRechnungXMLHelper.FindChild(_XML.DocumentElement,'rsm:ExchangedDocumentContext',node) then exit; - if not TXRechnungXMLHelper.FindChild(node,'ram:GuidelineSpecifiedDocumentContextParameter',node) then + if not TXRechnungXMLHelper.FindChild(node,'ram:GuidelineSpecifiedDocumentContextParameter',node2) then exit; - if not TXRechnungXMLHelper.FindChild(node,'ram:ID',node) then + if not TXRechnungXMLHelper.FindChild(node2,'ram:ID',node) then exit; - if node.Text.EndsWith('xrechnung_2.0',true) then - Result := XRechnungVersion_201_UNCEFACT; + if node.Text.EndsWith('xrechnung_2.1',true) then + Result := XRechnungVersion_211_UNCEFACT + else + if node.Text.StartsWith('urn:cen.eu:en16931:2017',true) then + Result := XRechnungVersion_ReadingSupport_ZUGFeRDFacturX_2xx; end; end; diff --git a/intf.XRechnungValidationHelperJava.pas b/intf.XRechnungValidationHelperJava.pas index 67a1a94..fa805d1 100644 --- a/intf.XRechnungValidationHelperJava.pas +++ b/intf.XRechnungValidationHelperJava.pas @@ -171,7 +171,7 @@ function TXRechnungValidationHelperJava.Validate(const _InvoiceXMLData: String; exit; if not FileExists(JavaRuntimeEnvironmentPath+'bin\java.exe') then exit; - if not FileExists(ValidatorLibPath+'validationtool-1.4.1-java8-standalone.jar') then + if not FileExists(ValidatorLibPath+'validationtool-1.4.2-java8-standalone.jar') then exit; if not FileExists(ValidatorConfigurationPath+'scenarios.xml') then exit; @@ -186,9 +186,9 @@ function TXRechnungValidationHelperJava.Validate(const _InvoiceXMLData: String; cmd.Add('pushd '+QuoteIfContainsSpace(ExtractFilePath(tmpFilename))); cmd.Add(QuoteIfContainsSpace(JavaRuntimeEnvironmentPath+'bin\java.exe')+' -jar '+ - QuoteIfContainsSpace(ValidatorLibPath+'validationtool-1.4.1-java8-standalone.jar')+' -s '+ + QuoteIfContainsSpace(ValidatorLibPath+'validationtool-1.4.2-java8-standalone.jar')+' -s '+ QuoteIfContainsSpace(ValidatorConfigurationPath+'scenarios.xml')+' -h '+ - tmpFilename); + QuoteIfContainsSpace(tmpFilename)); cmd.SaveToFile(tmpFilename+'.bat',TEncoding.ANSI); Result := ExecAndWait(tmpFilename+'.bat',''); @@ -253,18 +253,18 @@ function TXRechnungValidationHelperJava.Visualize(const _InvoiceXMLData: String; cmd.Add('pushd '+QuoteIfContainsSpace(ExtractFilePath(tmpFilename))); if _TrueIfUBL_FalseIfCII then cmd.Add(QuoteIfContainsSpace(JavaRuntimeEnvironmentPath+'bin\java.exe')+' -jar '+ - QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+tmpFilename+ + QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+QuoteIfContainsSpace(tmpFilename)+ ' -xsl:'+QuoteIfContainsSpace(VisualizationLibPath+'xsl\ubl-invoice-xr.xsl')+ - ' -o:'+ChangeFileExt(tmpFilename,'-xr.xml')) + ' -o:'+QuoteIfContainsSpace(ChangeFileExt(tmpFilename,'-xr.xml'))) else cmd.Add(QuoteIfContainsSpace(JavaRuntimeEnvironmentPath+'bin\java.exe')+' -jar '+ - QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+tmpFilename+ + QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+QuoteIfContainsSpace(tmpFilename)+ ' -xsl:'+QuoteIfContainsSpace(VisualizationLibPath+'xsl\cii-xr.xsl')+ - ' -o:'+ChangeFileExt(tmpFilename,'-xr.xml')); + ' -o:'+QuoteIfContainsSpace(ChangeFileExt(tmpFilename,'-xr.xml'))); cmd.Add(QuoteIfContainsSpace(JavaRuntimeEnvironmentPath+'bin\java.exe')+' -jar '+ - QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+ChangeFileExt(tmpFilename,'-xr.xml')+ + QuoteIfContainsSpace(ValidatorLibPath+'libs\Saxon-HE-9.9.1-7.jar')+' -s:'+QuoteIfContainsSpace(ChangeFileExt(tmpFilename,'-xr.xml'))+ ' -xsl:'+QuoteIfContainsSpace(VisualizationLibPath+'xsl\xrechnung-html.xsl')+ - ' -o:'+ChangeFileExt(tmpFilename,'-.html')); + ' -o:'+QuoteIfContainsSpace(ChangeFileExt(tmpFilename,'-.html'))); cmd.SaveToFile(tmpFilename+'.bat',TEncoding.ANSI);