Examples of InvoiceType


Examples of oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType

        File invoiceFile = new File(invoiceFilePath);
        if (!invoiceFile.exists()) {
            throw new FailedToRenderException(String.format("The specified invoice file '%s' doesn't exist",
                    invoiceFile.getAbsolutePath()));
        }
        InvoiceType invoiceType = InvoiceTypeUnMarshaller.unMarshal(new FileInputStream(invoiceFile));
        InvoiceCreationInput input = new InvoiceRenderingInput(invoiceType);
        input = initOutputOptions(input);
        InvoiceRenderingTask task = new InvoiceRenderingTask();
        task.execute(input);
        print(task);
View Full Code Here

Examples of oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType

            throws FileNotFoundException, FailedToUnMarshalException,
            org.openinvoice.ubl4j.core.common.FailedToMarshalException {

        FileInputStream fis = new FileInputStream(new File("E:/Temp/in/2011-12-28_72.xml"));

        InvoiceType it = InvoiceTypeUnMarshaller.unMarshal(fis);

        System.err.println(it.getID().getValue());

        InvoiceType it2 = it;

        IDType id = new IDType();
        id.setValue("100");
        it2.setID(id);

        System.err.println(it2.getID().getValue());

        FileOutputStream fos = new FileOutputStream(new File(new File("E:/Temp/in"), id.getValue()));

        InvoiceTypeMarshaller.marshal(it2, fos);
    }
View Full Code Here

Examples of oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType

        orderType = orderTypeProcessUnitManager.process(orderType, ubl4JConfigurationBean);

        // Parse the order and produce the invoice
        OrderTypeToInvoiceTypeTransformerHelper orderTypeToInvoiceTypeTransformerHelper = new OrderTypeToInvoiceTypeTransformerHelper(orderType);

        InvoiceType invoiceType = orderTypeToInvoiceTypeTransformerHelper.process();

        // Invoice is valid, check all Constraints before running process units
        invoiceType = invoiceTypeConstraintManager.process(invoiceType, ubl4JConfigurationBean);

        // Run InvoiceType Process units
View Full Code Here

Examples of oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType

    private void createInvoiceFromOrder() throws IOException, UBL4JException {
        InvoiceCreationOutput output = (InvoiceCreationOutput) getOutput();
        OrderTypeToInvoiceTypeTransformer orderTypeToInvoiceTypeTransformer =
                new OrderTypeToInvoiceTypeTransformer();
        CreateInvoiceBasedOnOrderInput input = (CreateInvoiceBasedOnOrderInput) getInput();
        InvoiceType generatedInvoiceType = orderTypeToInvoiceTypeTransformer.create(input.getOrderInputStream());
        output.setGeneratedInvoiceType(generatedInvoiceType);
        InvoiceTypeMarshaller.marshal(generatedInvoiceType, output.getInvoiceOutputStream(generatedInvoiceType));
        output.setInvoiceOutputURI(output.getInvoiceOutputURI());
    }
View Full Code Here

Examples of oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType

    }

    public void testWrite() throws Exception {
        org.openinvoice.ubl4j.core.invoice.InvoiceTypePersistence
                itp = new org.openinvoice.ubl4j.core.invoice.InvoiceTypePersistence();
        InvoiceType it = itp.read(invoiceInputStream);
        File tmpFile = FileUtil.getTempFile("inv", "xml", SystemUtil.TMP_DIR);
        itp.write(it, new FileOutputStream(tmpFile), UBL4JConfigurationBeanBuilder.DEFAULT_ENCODING);
        assertTrue(tmpFile.exists());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.