Skip to content

Commit

Permalink
Update sample MustangWriter for Mustangproject 2.0.2
Browse files Browse the repository at this point in the history
This fixes the compile errors that came up after trying to use the sample file.
Now it compiles fine and produces ZF
  • Loading branch information
tweimer authored Nov 30, 2020
1 parent 1de12c5 commit 8c6166e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions doc/MustangWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import java.util.Date;
import java.util.GregorianCalendar;

import org.mustangproject.ZUGFeRD.IExportableTransaction;
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableContact;
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct;
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableTransaction;
import org.mustangproject.ZUGFeRD.ZUGFeRDExporter;
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1Factory;
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableTradeParty;
import org.mustangproject.ZUGFeRD.IZUGFeRDExporter;
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1;

class Contact implements IZUGFeRDExportableContact {
class Contact implements IZUGFeRDExportableTradeParty {

public String getCountry() {
return "DE";
Expand Down Expand Up @@ -132,16 +132,16 @@ public void setVATPercent(BigDecimal vATPercent) {
}
}

public class MustangWriter implements IZUGFeRDExportableTransaction {
public class MustangWriter implements IExportableTransaction {

private void apply() {
try {
System.out.println("Reading Blanko-PDF");
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setProducer("My Application")
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
.setCreator(System.getProperty("user.name"))
.load("./MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
System.out.println("Generating and attaching ZUGFeRD-Data");
ze.PDFattachZugferdFile(this);
ze.setTransaction(this);
System.out.println("Writing ZUGFeRD-PDF");
ze.export("./MustangGnuaccountingBeispielRE-20170509_505new.pdf");
System.out.println("Done.");
Expand Down Expand Up @@ -238,7 +238,7 @@ public String getPaymentTermDescription() {
return null;
}

public IZUGFeRDExportableContact getRecipient() {
public IZUGFeRDExportableTradeParty getRecipient() {
return new Contact();
}

Expand Down

0 comments on commit 8c6166e

Please sign in to comment.