Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Factur-X #122

Open
jstaerk opened this issue Mar 21, 2024 · 1 comment
Open

Support Factur-X #122

jstaerk opened this issue Mar 21, 2024 · 1 comment

Comments

@jstaerk
Copy link

jstaerk commented Mar 21, 2024

Factur-X is based on the idea to embed XML representations of invoices in PDF/A-3 files. Cross Industry Invoice CII XML is used for this purpose in it's 1.00 version, aka 2016b, i.e. compliant with the European B2G e-invoicing standard EN16931.

Factur-X is one of the three eligible formats for french invoices (apart from that you can use pure CII, or UBL).

~5years ago Ken Sharp laid the foundation allowing to write ZUGFeRD 1, ZUGFeRD 2, Factur-X, Order-X and the upcoming Deliver-X (see https://bugs.ghostscript.com/show_bug.cgi?id=696472) using Ghostscript.
Currently no open source library is available for .net, konik only supports ZUGFeRD 1.0 (Factur-X 1.0=ZUGFeRD 2.0) and ZUGFeRD-csharp does not cover reading or writing to/from PDF at all.

@jstaerk
Copy link
Author

jstaerk commented Mar 22, 2024

Im working on merging my separately developed library in this branch, any help is greatly appreciated, I'm e.g. struggeling with the update to .net 6.0 which seemed neccessary :-(

In the end hopefully this will work (again)

namespace Ghostscript.NET.Samples
{
    public class FacturXWriteSample : ISample
    {


        public void Start()
        {
            
            Invoice i = (new Invoice()).setDueDate(DateTime.Now).setIssueDate(DateTime.Now).setDeliveryDate(DateTime.Now).setSender((new TradeParty("Test company", "teststr", "55232", "teststadt", "DE")).addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "[email protected]")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX"))).setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setReferenceNumber("991-01484-64").setNumber("123").
                    addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal("1.0"), new BigDecimal("1.0")));

            ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
            zf2p.setProfile(Profiles.getByName("XRechnung"));
            zf2p.generateXML(i);
            System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();

            string outfilename = "xrechnung.xml";
            File.WriteAllBytes(outfilename, zf2p.getXML());
        }

    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant