Topic: Creating XML Files

Hi,
I have a small invoice software and need to know how to write and read xml files with MVD.
In Germany we must use/create XRechnung starting 2025 and must be able to read XRechnung, which is a XML File.
Thank you.
teco049

Re: Creating XML Files

Hello teco049

MVD is knows how to create an XML file;

procedure Form1_Button4_OnClick (Sender: string; var Cancel: boolean);
var  Results: TDataSet;
begin
    SQLQuery('SELECT FirstName, LastName FROM person', Results);
    DataSetToXML(Results, 'd:\1.xml');
    Results.Free;
end;

Export via a dialog box :

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var Results: TDataSet;
     SaveDialog : TSaveDialog;
begin
     SaveDialog := TSaveDialog.Create(Form1);
     If SaveDialog.Execute then
     Begin
         SQLQuery('SELECT FirstName, LastName FROM person', Results);
         DataSetToXML(Results,(SaveDialog.FileName + '.xml'));
         Results.Free;
     end;
end;

JB

Re: Creating XML Files

Dear jean.brezhonek,


Thank you for the information. Because I have not used xml before, I have attached an example of a xrechnung. Can you check if this is possible with the xml. function of MVD?


The following xml syntaxes are possible. I must select one of these

- Universal Business Language (UBL)
- UN/CEFACT Cross Industry Invoice (CII)


The Example is UBL Syntax.

<ubl:Invoice>
<!--
XRechnung created by Invoice Portal powered by Webware Internet Solutions GmbH
-->
<!--
For more information visit our Website: https://invoice-portal.de 
-->
<!--Or contact us by E-Mail: info@invoice-portal.de-->
<cbc:CustomizationID>
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
</cbc:CustomizationID>
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
<cbc:ID>RE-2024-03</cbc:ID>
<cbc:IssueDate>2024-02-27</cbc:IssueDate>
<cbc:DueDate>2024-03-28</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<cbc:BuyerReference>992-90009-96</cbc:BuyerReference>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="9918">DE16520503531004885412</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Teichstr. 15</cbc:StreetName>
<cbc:CityName>Berlin</cbc:CityName>
<cbc:PostalZone>10232</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>279247134</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>FC</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>PC Service GmbH</cbc:RegistrationName>
<cbc:CompanyID>279247134</cbc:CompanyID>
</cac:PartyLegalEntity>
<cac:Contact>
<cbc:Name>Max Siebert</cbc:Name>
<cbc:Telephone>0312424323</cbc:Telephone>
<cbc:ElectronicMail>max.siebert@pc-service-berlin.de</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="9930">DE279247134</cbc:EndpointID>
<cac:PostalAddress>
<cbc:StreetName>Bergstr. 25</cbc:StreetName>
<cbc:CityName>Frankfurt</cbc:CityName>
<cbc:PostalZone>54632</cbc:PostalZone>
<cbc:CountrySubentity>Hessen</cbc:CountrySubentity>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyLegalEntity>
<cbc:RegistrationName>DB Service GmbH</cbc:RegistrationName>
<cbc:CompanyID>DE279247134</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:Delivery>
<cbc:ActualDeliveryDate>2024-02-24</cbc:ActualDeliveryDate>
</cac:Delivery>
<cac:PaymentMeans>
<cbc:PaymentMeansCode>42</cbc:PaymentMeansCode>
<cac:PayeeFinancialAccount>
<cbc:ID>DE13520503531004885466</cbc:ID>
<cbc:Name>Viktor Settel</cbc:Name>
<cac:FinancialInstitutionBranch>
<cbc:ID>HELADEF1KAS</cbc:ID>
</cac:FinancialInstitutionBranch>
</cac:PayeeFinancialAccount>
</cac:PaymentMeans>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">204.06</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">1074.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">204.06</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">1074.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">1074.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">1278.06</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="EUR">0.00</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="EUR">0.00</cbc:ChargeTotalAmount>
<cbc:PrepaidAmount currencyID="EUR">0.00</cbc:PrepaidAmount>
<cbc:PayableRoundingAmount currencyID="EUR">0.00</cbc:PayableRoundingAmount>
<cbc:PayableAmount currencyID="EUR">1278.06</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">2.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">934.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>PC Fujitsu TX-23</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">467.000000</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">2.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">140.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>PC Installation</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">70.000000</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
</ubl:Invoice>

4 (edited by sparrow 2024-11-26 10:08:31)

Re: Creating XML Files

Hi


Unfortunately, it's not that simple. This function is unlikely to help you. XRechnung is constantly evolving, versions are changing, corrections are made, mandatory fields are changing ... There is a list of mandatory fields. If you go the way of mandatory fields (minimum requirements), you will have to write your own procedures. But it is not a fact that in the new version of the standard the list of fields will not be expanded or you will not need new XRechnung features. There is a lot of work.

Re: Creating XML Files

sparrow wrote:

Hi


Unfortunately, it's not that simple. This function is unlikely to help you. XRechnung is constantly evolving, versions are changing, corrections are made, mandatory fields are changing ... There is a list of mandatory fields. If you go the way of mandatory fields (minimum requirements), you will have to write your own procedures. But it is not a fact that in the new version of the standard the list of fields will not be expanded or you will not need new XRechnung features. There is a lot of work.


The question is, how much work I need to invest keeping MVD for this last project running and to develop an own xml procedure with MVD or if it is more future proof and/or easier to move the project to Delphi, FreePascal, Rust or something else.


Additional, around 2030 I need to connect to a european portal like peppol. Can MVD support this including SSL etc. With your information it maybe looks like feeding a dead horse or putting new shoes on.

Re: Creating XML Files

The question is, how much work I need to invest keeping MVD for this last project running and to develop 
an own xml procedure with MVD or if it is more future proof and/or easier to move the project to Delphi,
FreePascal, Rust or something else.

You can get all the information by referring to the XRechnung documents.
You can study the specifications, some examples, codes ... .
Based on this and assessing your capabilities you will answer your own question.



...

As for MVD, in my opinion, given what you expect in the future, MVD is not for this task.

Re: Creating XML Files

sparrow wrote:
The question is, how much work I need to invest keeping MVD for this last project running and to develop 
an own xml procedure with MVD or if it is more future proof and/or easier to move the project to Delphi,
FreePascal, Rust or something else.

You can get all the information by referring to the XRechnung documents.
You can study the specifications, some examples, codes ... .
Based on this and assessing your capabilities you will answer your own question.



...

As for MVD, in my opinion, given what you expect in the future, MVD is not for this task.


Thank you Sparrow,


this confirms my estimations.


Writing the needed procedure should not the issue, but why using a dead system for this. I will move the project to another system.

Re: Creating XML Files

Hello teco049, Hello sparrow
Try Lazarus.
Ask its user forum, it is very rich
JB