use of eu.ggnet.dwoss.redtapext.ee.DocumentSupporterOperation in project dwoss by gg-net.
the class DocumentRendererTryout method main.
public static void main(String[] args) {
DocumentSupporterOperation documentSupporter = new DocumentSupporterOperation();
documentSupporter.setMandator(Sample.MANDATOR);
Dossier dos = new Dossier();
dos.setPaymentMethod(PaymentMethod.ADVANCE_PAYMENT);
dos.setDispatch(true);
dos.setCustomerId(1);
Document doc = new Document();
doc.setTaxType(TaxType.GENERAL_SALES_TAX_DE_SINCE_2007);
doc.setType(DocumentType.ORDER);
doc.setActive(true);
doc.setDirective(Document.Directive.WAIT_FOR_MONEY);
doc.setHistory(new DocumentHistory("JUnit", "Automatische Erstellung eines leeren Dokuments"));
Address a = new Address("Herr Muh\nMuhstrasse 7\n12345 Muhstadt");
doc.setInvoiceAddress(a);
doc.setShippingAddress(a);
dos.add(doc);
NaivBuilderUtil.overwriteTax(doc.getTaxType());
doc.append(NaivBuilderUtil.comment());
doc.append(NaivBuilderUtil.service());
doc.append(NaivBuilderUtil.shippingcost());
System.out.println("Tax: " + doc.getSingleTax());
System.out.println("Netto " + doc.getPrice());
System.out.println("Brutto: " + doc.toAfterTaxPrice());
System.out.println("SumTax: " + (doc.toAfterTaxPrice() - doc.getPrice()));
JasperPrint print = documentSupporter.render(doc, DocumentViewType.DEFAULT);
JRViewer viewer = new JRViewer(print);
JFrame frame = new JFrame("Viewer");
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(viewer, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
Aggregations