GithubHelp home page GithubHelp logo

stephanstapel / zugferd-csharp Goto Github PK

View Code? Open in Web Editor NEW
114.0 21.0 72.0 212.3 MB

C# assembly for creating and reading ZUGFeRD invoices

License: Apache License 2.0

C# 100.00% HTML 0.01%
csharp csharp-library ebusiness invoice invoicing zugferd

zugferd-csharp's People

Contributors

abdallahbeshi avatar alpini1980 avatar amacado avatar angrycodez avatar argollinger avatar cgiesen avatar chips100 avatar danvy avatar drocx avatar heinz164 avatar inabout avatar irgsmirx avatar landrix avatar manuel-lu avatar neo-zed avatar patrick-3000 avatar pkurz avatar skeller1 avatar stefanschmidcyanit avatar steffenstoerner avatar stephan-nowecor avatar stephanstapel avatar syslog-dw avatar tobiaswetzel1 avatar tomcatbb avatar trusoggy avatar vissers-dev avatar weischermanuel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zugferd-csharp's Issues

InvoiceType codes missing, wrong, code duplication in writers

See "ZUGFeRD-2.1.1 - Spezifikation_TA.pdf", Page 24.

Currently, we have 380, 381, 383, 389 and 1380 which should be 384 (1380 should be kept for compatibilty, but only accepted for reading purposes).
Of the recommended codes 261, 386 and 326 are missing.
For MINIMUM and BASIC WL profiles, 751 is required (in Germany).
The given UNTDID 1001 subset contains many more coders which should be supported.

_translateInvoiceType and _encodeInvoiceType should be handled like other enumerations instead of being copied to each InvoiceDescriptor_Writer.

Parts of those other EnumExtentions are ugly enough.

Instead of creating an EnumToString function, which in turn doesn't do anything else than ToString with g format which itself is just the default for a plain ToString, one should just use ToString directly.

Some Enums do not set Unkown = 0, which is a bad thing.
The CountryCodes should have their numeric value attached.
SubjectCodes should also be updated accoring to the documentation for 2.1.1.

Bug in last version

  1. 2.0 support is missing now. The tag to search vor are now in Reader2 but in fact is reader2 support for 2.1

  2. when I test a 2.1 XML I got the error
    "Auf eine geschlossene Datei kann nicht zugegriffen werden."
    "stream.Position = 0;" is not allow for closed streams ;)

Checking for version1 close the stream

Edit:
I transmit a file stream, not a FullPath

CurrencyID should not be present

The attribute currencyID seems to be only relevant in the extended profile. But is being written in every profile.
I switched to the Comfort/EN 16931 profile.

Errors

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeAgreement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:GrossPriceProductTradePrice[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ChargeAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeAgreement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:NetPriceProductTradePrice[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ChargeAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:IncludedSupplyChainTradeLineItem[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedLineTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementLineMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:LineTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ApplicableTradeTax[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:CalculatedAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:ApplicableTradeTax[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:BasisAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:LineTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:TaxBasisTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:GrandTotalAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

<error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:DuePayableAmount[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="not(@currencyID)">[CII-DT-031] - currencyID should not be present</error>

ram:BasisAmount in comfort profile

The validation of the xml says, that the ram:BasisAmount (in SpecifiedSupplyChainTradeAgreement) will not be evaluated in the comfort profile.

In previous versions the BasisAmount was not written, too.

ZUGFeRD Community

FYI:

We just forked the project to the @ZUGFeRD Community. We are building up a cross Open Source community that will promote ZUGFeRD projects.

We will communicate more details in the next weeks.

Invalid xml according to online validator

Hi Stephan,
thanks for this library, i am trying to get it to work.
But it seems i can't generate a xml schema that satisfies the online validator: Vaildator

I always get an error:
schema validation fails:org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 15; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":Name}'. One of '{"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":IssueDateTime}' is expected.

Even though "IssueDateTime" is in my xml schema.. Maybe it has to be in another order?

Publish nuget package for .NET Core/Standard

When referencing this project from a .NET Core 3.1 project, the following warning is shown:

warning NU1701: Package 'ZUGFeRD-csharp 2.10.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

It seems that the project (or the NuGet build) is somehow still configured as .NET framework instead of .NET Standard/Core.

Any chance this could be sorted out?

Thanks!

PaymentMean TypeCodes

So i got to test again, new version looks promising.
Now i noticed the typecodes for the paymentmeans are wrong (v2.1 haven't tested other versions).
According to the documentation possible values are:

Code Type
10 Bargeld
20 Scheck
30 Überweisung
42 Payment to bank account
48 Kartenzahlung
49 Lastschrift
57 Dauerauftrag
58 SEPA Credit Transfer
59 SEPA Direct Debit
97 Report

QuantityCodes nicht vollständig

Hallo zusammen,
erstmal Glückwunsch zu diesem tollen Projekt!

Ist es Absicht das als QuantityCode nur Unknown, C62, KGM, MTK angeboten werden?
Die Liste sollte um folgende Werte ergänzt werden: DAY, HAR, HUR, KTM, KWH, LS, LTR, MIN, MMK, MMT, MTQ, MTR, NAR, NPR, P1, SET, TNE, WEE
Diese Einheiten sind zumindest in der offiziellen ZUGFeRD Codeliste enthalten.

Help with TradeLineItem / basis_quantity != 1

Hello all,
I am trying to generate a COMFORT level zugferd xml, using your library.
I have a time-based line-item whose basis_quantity is defined as more than 1. Here is the example:


image


If I understand the documentation correctly, the corresponding line-item XML node (IncludedSupplyChainTradeLineItem) should be defined as following:

image

Should the unit code used in BasisQuantity be the same as the one in BilledQuantity? Or, can I use a period multiplier like it is in the PDF invoice (x0.25) which effectively has a different unit_code (not hours).

Your library multiplies the unit price and the billed quantity, but in the case where the basis_quantity is not 1, like the above, the multiplication result would be false (6 x 240,00 = 1440,00 instead of 60,00)
_total = tradeLineItem.NetUnitPrice * tradeLineItem.BilledQuantity;

Reading the specification, it is completely unclear for me if my XML representation is correct or not. So, I ask you if you have any knowledge to share regarding this?

ZUGFeRD 2.0 und Profil EN16931 (XRechnung)

Hallo,

planst du eventuell schon das ZUGFeRD Format 2.0 zu unterstützen?
Neu ist unter anderem ein neues Profil EN16931.
Das Comfort Profil wurde zum Profil EN16931 umbenannt und erweitert.

Dieses ist identisch mit dem XRechnung Standard. Somit hätte man mit einer Schnittstelle zwei Standards unterstützt.
XRechnung wird ab 2020 für diverse öffentlichen Verwaltungen als Pflicht vorgeschrieben.
Bei XRechnung wird nur das XML versendet ohne PDF Datei.

Was ist der Unterschied zwischen ZUGFeRD 2.0 und der XRechnung und worin genau liegt hier der Vorteil von ZUGFeRD 2.0?
Was ist der Unterschied zwischen „ZUGFeRD Version 1“ und „ZUGFeRD Version 2"?

Rule BR-S-02 and BR-CO-26 throw an error even though BT-31 is present

grafik

So i'm receiving these errors, even though i have the field BT-31 present, do i need the other fields?

  <ram:SellerTradeParty>
        <ram:Name>Company Name</ram:Name>
        <ram:DefinedTradeContact>
          <ram:PersonName>Person</ram:PersonName>
          <ram:TelephoneUniversalCommunication>
            <ram:CompleteNumber>01234567890</ram:CompleteNumber>
          </ram:TelephoneUniversalCommunication>
          <ram:EmailURIUniversalCommunication>
            <ram:URIID>[email protected]</ram:URIID>
          </ram:EmailURIUniversalCommunication>
        </ram:DefinedTradeContact>
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>00000</ram:PostcodeCode>
          <ram:LineOne>Street 12</ram:LineOne>
          <ram:CityName>Any City</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">TaxRegistration1</ram:ID>
        </ram:SpecifiedTaxRegistration>
      </ram:SellerTradeParty>

Profile.Basic Beispiel

Hallo,

erstmal vielen Dank für die Umsetzung dieses tollen Projekts.

Könntest du vielleicht noch, wenn es möglich wäre ein Beispiel für das Profile.Basic ergänzen.

XRechnung: Consider modifying handling of SellerTradeParty

image

<ram:SellerTradeParty>
        <ram:GlobalID schemeID="0088">4000001123452</ram:GlobalID>
        <ram:Name>Lieferant GmbH</ram:Name>
        <ram:DefinedTradeContact />
        <ram:PostalTradeAddress>
          <ram:PostcodeCode>80333</ram:PostcodeCode>
          <ram:LineOne>Lieferantenstraße 20</ram:LineOne>
          <ram:CityName>München</ram:CityName>
          <ram:CountryID>DE</ram:CountryID>
        </ram:PostalTradeAddress>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="FC">201/113/40209</ram:ID>
        </ram:SpecifiedTaxRegistration>
        <ram:SpecifiedTaxRegistration>
          <ram:ID schemeID="VA">DE123456789</ram:ID>
        </ram:SpecifiedTaxRegistration>
      </ram:SellerTradeParty>

XRechnung: ItemName for comment lines

image

Example:

<ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:IncludedNote>
          <ram:Content>Wir erlauben uns Ihnen folgende Positionen aus der Lieferung Nr. 2013-51112 in Rechnung zu stellen:</ram:Content>
        </ram:IncludedNote>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct />
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>0.00</ram:ChargeAmount>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>0.00</ram:ChargeAmount>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="Unknown">0.00</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>A</ram:CategoryCode>
          <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>0.00</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>

Invoice total amount wrong?

      <error type="4" location="/*[local-name()='CrossIndustryInvoice' and namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*[local-name()='SupplyChainTradeTransaction' and namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*[local-name()='ApplicableHeaderTradeSettlement' and namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']/*[local-name()='SpecifiedTradeSettlementHeaderMonetarySummation' and namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']" criterion="(ram:GrandTotalAmount = round(ram:TaxBasisTotalAmount*100 + ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]*100 +0) div 100) or ((ram:GrandTotalAmount = ram:TaxBasisTotalAmount) and not (ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]))">Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).</error>  
      <error type="24" location="/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:SpecifiedTradeSettlementHeaderMonetarySummation[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]" criterion="(ram:GrandTotalAmount = round( ram:TaxBasisTotalAmount*100 + ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]*100 +0) div 100) or ((ram:GrandTotalAmount = ram:TaxBasisTotalAmount) and not (ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]))">[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).</error> 

The error is pretty clear, but the generated xml, displays the right amount.

<?xml version="1.0" encoding="utf-8"?>
<rsm:CrossIndustryInvoice xmlns:a="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:10" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  <rsm:ExchangedDocumentContext>
    <ram:GuidelineSpecifiedDocumentContextParameter>
      <ram:ID>urn:cen.eu:en16931:2017</ram:ID>
    </ram:GuidelineSpecifiedDocumentContextParameter>
  </rsm:ExchangedDocumentContext>
  <rsm:ExchangedDocument>
    <ram:ID>NUMMER2</ram:ID>
    <ram:TypeCode>380</ram:TypeCode>
    <ram:IssueDateTime>
      <udt:DateTimeString format="102">20200706</udt:DateTimeString>
    </ram:IssueDateTime>
    <ram:IncludedNote>
      <ram:Content>Rechnung NUMMER2 vom 06.07.2020 00:00:00.</ram:Content>
    </ram:IncludedNote>
  </rsm:ExchangedDocument>
  <rsm:SupplyChainTradeTransaction>
    <ram:IncludedSupplyChainTradeLineItem>
      <ram:AssociatedDocumentLineDocument>
        <ram:LineID>1</ram:LineID>
      </ram:AssociatedDocumentLineDocument>
      <ram:SpecifiedTradeProduct>
        <ram:Name>Rechnungsbetrag</ram:Name>
      </ram:SpecifiedTradeProduct>
      <ram:SpecifiedLineTradeAgreement>
        <ram:GrossPriceProductTradePrice>
          <ram:ChargeAmount>24245.80</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LS">1.00</ram:BasisQuantity>
        </ram:GrossPriceProductTradePrice>
        <ram:NetPriceProductTradePrice>
          <ram:ChargeAmount>20374.62</ram:ChargeAmount>
          <ram:BasisQuantity unitCode="LS">1.00</ram:BasisQuantity>
        </ram:NetPriceProductTradePrice>
      </ram:SpecifiedLineTradeAgreement>
      <ram:SpecifiedLineTradeDelivery>
        <ram:BilledQuantity unitCode="LS">1.00</ram:BilledQuantity>
      </ram:SpecifiedLineTradeDelivery>
      <ram:SpecifiedLineTradeSettlement>
        <ram:ApplicableTradeTax>
          <ram:TypeCode>VAT</ram:TypeCode>
          <ram:CategoryCode>S</ram:CategoryCode>
          <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
        </ram:ApplicableTradeTax>
        <ram:SpecifiedTradeSettlementLineMonetarySummation>
          <ram:LineTotalAmount>20374.62</ram:LineTotalAmount>
        </ram:SpecifiedTradeSettlementLineMonetarySummation>
      </ram:SpecifiedLineTradeSettlement>
    </ram:IncludedSupplyChainTradeLineItem>
    <ram:ApplicableHeaderTradeDelivery />
    <ram:ApplicableHeaderTradeSettlement>
      <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
      <ram:ApplicableTradeTax>
        <ram:CalculatedAmount>3871.18</ram:CalculatedAmount>
        <ram:TypeCode>VAT</ram:TypeCode>
        <ram:BasisAmount>20374.62</ram:BasisAmount>
        <ram:CategoryCode>S</ram:CategoryCode>
        <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
      </ram:ApplicableTradeTax>
      <ram:SpecifiedTradePaymentTerms>
        <ram:Description>Zahlbar innerhalb 30 Tagen netto bis 05.08.2020 00:00:00</ram:Description>
        <ram:DueDateDateTime>
          <udt:DateTimeString format="102">20200805</udt:DateTimeString>
        </ram:DueDateDateTime>
      </ram:SpecifiedTradePaymentTerms>
      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
        <ram:LineTotalAmount>20374.62</ram:LineTotalAmount>
        <ram:TaxBasisTotalAmount>20374.62</ram:TaxBasisTotalAmount>
        <ram:TaxTotalAmount>3871.18</ram:TaxTotalAmount>
        <ram:GrandTotalAmount>24245.80</ram:GrandTotalAmount>
        <ram:DuePayableAmount>24245.80</ram:DuePayableAmount>
      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    </ram:ApplicableHeaderTradeSettlement>
  </rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

The fields BT-109 + BT-110 equal the sum (BT-112), i am not sure where the problem is.

VAT Reverse Charge

Hallo,
erst einmal vielen, vielen Dank für die tolle Arbeit.
Können Sie bitte für Netto-Rechnungen bei VAT category code (BT-119) den Code AE (VAT Reverse Charge) hinzufügen?
Und dann in VAT exemption reason text (BT-120) den Text „Umkehrung der Steuerschuldnerschaft“?

Danke und Grüße
Alexander Wittwer

Intellisense Kommentare für NuGet package

Hi.

Vielen Dank für die tolle Arbeit die du hier geleistet hast.

Ich hab die neuste Version vom NuGet package in Visual Studio heruntergeladen.
Kommentare aus dem Quelltext werden jedoch in Intellisense nicht angezeigt.
Diese sind aber super praktisch um die Bedeutung eines Enums zu verstehen z.B. TaxRegistrationSchemeID.VA

Es scheint das die XML Dokumentation nicht mit ausgegeben wird.
https://stackoverflow.com/questions/43305578/show-comments-in-nuget-package

Wäre toll wenn du diese noch hinzufügen könntest.

Danke!

Schöne Grüße
Michel

ErrorState and message

Actual I got a result or not.
If not, there ist no info why!

I like to have a error flag perhaps IsError and in this case an ErrorMessage

Example:
We check the version of the XML but for some reason we can#t get the correct version.

actual the result is not filled or empty.
In this case we can set IsError to true and ErrorMessage to "not supported version"

I'd like to have version tags

Currently, there are no git version tags at all.

(And I would like to know from which version our internal fork was derived - probably this would help to get rid of some historical ballast.)

Linebreakes in Notes

Wenn ich bei einem TradeLineItem zusätzlich zu einem Namen eine mehrzeilige Description angebe, so ist der darin enthaltene Zeilenumbruch u.U. für das Verständnis notwendig.
Derzeit wird der übergebene Text jedoch einfach direkt so ins XML gerendert, oder?
D.h. dass ein Zeilenumbruch für einen XML-Parser einfach zu einem Whitespace wird, oder ist hier ein anderer Standard definiert?

Müsste man potentiell mehrzeilige Texte nicht in ein <![CDATA[...]> einpacken?
Sollte das nicht von der Bibliothek übernommen werden?

Gruß,
Bernd

Implement 2.1

This is the starting tu discuss the needed changes for 2.1

Dieses ist der Start um die nötigen Anpassungen für 2.1 zu diskutieren.

PaymentMeansTypeCodes.cs missing

Im Repo fehlt die Datei "PaymentMeansTypeCodes.cs".
Im Projekt ist diese vorhanden. Daher ist das Projekt aktuell nicht kompilierbar.

DateMandatoryDateTimeType doesn't support xs:date

According to ZUGFeRD 1.0 scheme:

<xs:simpleType name="DateMandatoryDateTimeType">
    <xs:union memberTypes="xs:dateTime xs:date"/>
</xs:simpleType>

DateMandatoryDateTimeType can also be just a date, e.g. 2020-01-01.
Invoices with such dates lead to exceptions on reading.
Example:

<ram:BuyerOrderReferencedDocument>
   <ram:IssueDateTime>2013-08-01</ram:IssueDateTime>
   <ram:ID>123</ram:ID>
</ram:BuyerOrderReferencedDocument>

price unit not available...?

Hello!
excellent library for creating ZUGFeRD XML files.
unfortunately i cant find a way to set the price unit correct.

i can set the gross/net unitprice and the billedquantity. if i have a Price 3814 Eur for 1000 pieces = 3,814 for ONE Piece. the price in the XML file always will by 3,81 - if i calculate the Prices in the XML file the quantity * Piece-price is not the correct total amout.

is it possible to use price-units and i only file no way?

many thanks for your help!

regards,
Chris

Forgot to remove ', false' in Line 180 of InvoiceDescriptor21Writer.cs?

In a lot of places ', false' was removed from lines like
Writer.WriteValue(_formatDate(tradeLineItem.BuyerOrderReferencedDocument.IssueDateTime.Value, false));
but not from line 180 of ZUGFeRD/InvoiceDescriptor21Writer.cs

The generated file ZUGFeRD/s2industries.ZUGFeRD.xml (in my tests, this file did not appear directly in ZUGFeRD) contains information about badly formatted XML in the following lines
53
1379

Between lines 1421 and 1422 the information, in which profiles this is availabe, is missing.

Line 1469 contains additional '///'.

Line 1539 misses a 'd'.

Line 1575 shoud read 'Quadratmeter'.

Lines 2094, 2124 and 2129 lack a non-empty summary.

Eine Assembly mit starkem Namen ist erforderlich. (Ausnahme von HRESULT: 0x80131044)

Hallo,

ich habe das ZUGFeRD Nuget Paket von Version 2.6 auf Version 2.7 in meinem Projekt aktualisiert.
Seid dem bekomme ich folgende Fehlermeldung:

Die Datei oder Assembly "s2industries.ZUGFeRD, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Eine Assembly mit starkem Namen ist erforderlich. (Ausnahme von HRESULT: 0x80131044)

Die DLL hat seid Version 2.7 auch keinen Strong Name mehr.

zugferd

Ist dies so gewollt?

XRechnung

Hallo zusammen,

ich habe mir den Source Code inkl. Test Project runtergeladen.
Wenn ich die Rechnung mit:
string path = "output.xml";
InvoiceDescriptor desc = _createInvoice();
desc.Save(path, ZUGFeRDVersion.Version21, Profile.XRechnung);
speicher, bekomme ich mit jedem Validator Fehlermeldung !

Was mache ich da falsch ?
Man kann doch XRechnung erstellen, oder ?

Oder muss ich warten bis V2.1.1 kommt ?

XRechnung missing fields

I am trying to create a XRechnung invoice, with the validator i get the error "[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden." which is the "ram:BuyerReference" field, which is not possible to write with this library. (It's in a comment)

Hardcoded path to documentation XML file

ZUGFeRD/ZUGFeRD.csproj references DocumentationFile E:\develop\ZUGFeRD\s2industries.ZUGFeRD.xml.
I don't have a drive E:.
Issue can be fixed by unsing GenerateDocumentationFile instead and setting this to true (and moving this to the main PropertyGroup without conditions.
I've fixed this in my fork.

Validierung

Hallo,
wurden die generierten Daten validiert?
Habe meine generierten Dateien mal auf dieser Seite getestet: https://www.din-zugferd-validation.org
Ergebnis: Sehr viele Fehler im Bereich von (fehlenden) Namespaces und auch fehlende Elemente.
ValidationResult.txt

Die strukur enspricht an vielen Stellen auch nicht den Beispiel dateien von Zugferd und als sich auch nicht mit deren xsd validieren.

Hat dies auch schon jemand anderes beobachten können, bzw. hat eine Lösung parat?
Ansonsten bemühe ich mich um einen Hotfix...

Error BR-21 and BR25 See Comment AW, Name and LineID should have a value !

image

   public void addTradeLineCommentItem(string comment)
    {
        TradeLineItem item = new TradeLineItem()
        {
            //AW
            Name="ComentItem",

            AssociatedDocument = new ZUGFeRD.AssociatedDocument(),
            
            GrossUnitPrice = 0m,
            NetUnitPrice= 0m,
            BilledQuantity = 0m
        };

        item.AssociatedDocument.Notes.Add(new Note(
            content: comment,
            subjectCode: SubjectCodes.Unknown,
            contentCode: ContentCodes.Unknown
        ));

        //AW
        item.AssociatedDocument.LineID=0;

        this.TradeLineItems.Add(item);
    } // !addTradeLineCommentItem()

Support for ZUGFeRD 2.1

Hello,

ZUGFeRD 2.1 is out since 24.03.2020.
Actually it is not supported by ZUGFeRD-csharp and InvoiceDescriptor.Load(zugferdFile); returns an empty descriptor with Type = Unknown.
Do you have any plans to support this ZUGFeRD Version?

SEPA-Lastschrift mit Angabe Mandatsreferenz und GläubigerID

Hallo,

erstmal vielen Dank für das Einbauen meiner Code Ergänzungen.

Mit ist gerade noch aufgefallen, dass der Writer noch keine SEPA Lastschrift mit Prenotification kann.
Könntest du das vielleicht noch zeitnah einbauen?
Alternativ würde ich mich daran versuchen.

Beispiel 37 aus der ZUGFeRD Formatbeschreibung Seite 86/131:

<ram:ApplicableSupplyChainTradeSettlement> 
... 
 <ram:PaymentReference>Rechnung Nummer 4711/2014</ram:PaymentReference> 
 <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> 
   
 <ram:SpecifiedTradeSettlementPaymentMeans> 
  <ram:TypeCode>49</ram:TypeCode> 
  <ram:Information>Betrag wird per SEPA-Lastschrift eingezogen</ram:Information> 
  <ram:ID schemeAgencyID="DE98ZZZ09999999999">REF A-123</ram:ID> 
  <ram:PayerPartyDebtorFinancialAccount> 
   <ram:IBANID>DE21860000000086001055</ram:IBANID> 
   <ram:AccountName>Bundeskasse Halle -Darlehen-</ram:AccountName> 
  </ram:PayerPartyDebtorFinancialAccount> 
  <ram:PayerSpecifiedDebtorFinancialInstitution> 
   <ram:BICID>MARKDEF1860</ram:BICID> 
   <ram:Name>Deutsche Bundesbank -Filiale Leipzig-</ram:Name> 
  </ram:PayerSpecifiedDebtorFinancialInstitution> 
 </ram:SpecifiedTradeSettlementPaymentMeans> 
...
</ram:ApplicableSupplyChainTradeSettlement> 

*ReferencedDocument IssuerAssignedID ist im InvoiceDescriptor21Reader noch ID

Siehe z.B.:

string _deliveryNoteNo = _nodeAsString(doc.DocumentElement, "//ram:ApplicableHeaderTradeDelivery/ram:DeliveryNoteReferencedDocument/ram:ID", nsmgr);

ID wurder zu IssuerAssignedID in ZUGFeRD 2.1 bei den folgenden XML Knoten:

  • BuyerOrderReferencedDocument
  • DeliveryNoteReferencedDocument
  • AdditionalReferencedDocument
  • ContractReferencedDocument

EDIT: ebenso im Writer

Zeilenbetrag beim Import fehlt?

Hallo,

sehe ich es richtig, dass es beim Import einer ZUGFeRD-Datei nicht möglich ist auf den Zeilenbetrag zuzugreifen?
Gemeint ist das Element mit dem XPath /rsm:CrossIndustryDocument/rsm:SpecifiedSupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedSupplyChainTradeSettlement/ram:SpecifiedTradeSettlementMonetarySummation/ram:LineTotalAmount

Gerade bei Rechnung im Basic-Profile wäre dies wichtig, da hier (zumindest im FeRD Beispiel
ZUGFeRD_1p0_BASIC_Einfach.pdf) außer Menge und Zeilenbetrag nichts enhalten ist.

Support for ZUGFeRD 2

Hi,
In Your solution, there are test files from ZUGFeRD 2.0 but Your solution seems to not support it.
In the description, I see that You have information that the readers are working with standards 1 and 2.
Question do You plan to implement readers for these standards or this is a bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.