我试着用Mustang库创建一个factur-x,我发现了如何创建一个EN16931 factur-x xml以及如何将其嵌入到pdf中。
为此,我使用了以下代码示例:
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
.load("blanko.pdf");
Invoice i = new Invoice()
.setIssueDate(new Date())
.setDueDate(new Date())
.setDetailedDeliveryPeriod(new Date(), new Date())
.setDeliveryDate(new Date())
.setSender(
new TradeParty("ME", "teststr", "55232", "teststadt", "DE")
.addTaxID("4711")
.addVATID("DE0815")
.addBankDetails(new BankDetails("DE88200800000970375700", "COBADEFFXXX")))
.setRecipient(
new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")
.addVATID("DE0815"))
.setNumber("NUMFACTURE")
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.setCreditNote();
ze.setTransaction(i);
ze.export("factur-x-en16931.pdf");
这个代码工作正常。我生成一个有效的PDF与有效的XML数据...我的问题是关于较低的facturx水平,如最低,基本,基本的wl。
XML应如下所示:
<?xml version='1.0' encoding='UTF-8'?>
<rsm:CrossIndustryInvoice
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rsm:ExchangedDocumentContext>
<ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:ID>A1</ram:ID>
</ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>NUMFCADNO22</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20220506</udt:DateTimeString>
</ram:IssueDateTime>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:Name>ACME</ram:Name>
<ram:SpecifiedLegalOrganization>
<ram:ID schemeID="0002">3810011234560073</ram:ID>
</ram:SpecifiedLegalOrganization>
<ram:PostalTradeAddress>
<ram:CountryID>FR</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">FR17143232666</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Client</ram:Name>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:TaxBasisTotalAmount>200.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">40.00</ram:TaxTotalAmount>
<ram:GrandTotalAmount>240.00</ram:GrandTotalAmount>
<ram:DuePayableAmount>240.00</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
我的问题是,我有问题创建这样的附加文档。在这里,我需要设置:
- 发布日期时间
- 卖方名称(但构造方需要所有信息)
- 卖方增值税ID
- 买方名称
- 货币
- 共计
- 计税基础总额
- 纳税总额
- 总额
- 到期应付金额
我知道了部分侧写设置方法。
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1()
.setProducer("My Application")
.setCreator(System.getProperty("user.name"))
.setZUGFeRDVersion(2)
.setProfile("MINIMUM")
.ignorePDFAErrors()
.load("blanko.pdf");
我有关于定义发票详细信息的问题:
Invoice i = new Invoice()
.setIssueDate(new Date())
// .setDueDate(new Date()) ==> not required
// .setDetailedDeliveryPeriod(new Date(), new Date()) ==> not required
// .setDeliveryDate(new Date()) ==> not required
.setSender(
new TradeParty("ACME", "", "", "", "FR")
.addVATID("FR17143232666"))
.setRecipient(
new TradeParty("Client test MOA", "", "", "", "")
.addVATID("DE0815"))
.setNumber("NUMFACTURE")
.setCurrency("EUR")
.setTotalPrepaidAmount(new BigDecimal("450.00"));
ze.setTransaction(i);
ze.export("factur-x-min.pdf");
我没有找到如何在Mustang中设置必需元素的值,例如,我有关于日期的空指针异常。
1条答案
按热度按时间olmpazwi1#
交易方有缺陷,信用证有缺陷,最低配置文件是最有缺陷的。大多数问题现在应该在今天的2.6.0中得到解决,我还创建了一个自动测试,它可能会做你想在https://github.com/ZUGFeRD/mustangproject/blob/master/library/src/test/java/org/mustangproject/ZUGFeRD/ProfilesMinimumBasicWLTest.java上做的大部分事情
你说得太对了,你不仅仅是提出了一个Github问题,在邮件列表https://groups.google.com/g/zugferd中或者通过矩阵(https://app.element.io/#/room/#facturx:matrix.org)提到它。
这是我第二次真正通过Stackoverflow了解Chorus Pro的需求(另外,你的样本是从哪里来的?),如果我知道的话,我可能会在三个月前修复这个问题。
若昂·若叶·诺埃尔
PS:我相信在我调查过的上一次堆栈溢出的情况下,业务流程指定文档上下文参数=A1实际上可能在Chorus Pro(即B2G)方面是可选的,如果在B2B中有任何不同,我会感到惊讶。