Package oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2

Examples of oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2.LineExtensionAmountType


    private CurrencyCodeContentType referenceCurrency;
    private CurrencyCodeContentType errorCurrency;

    public boolean isRespected(OrderType orderType) {

        DocumentCurrencyCodeType documentCurrencyCodeType =
                orderType.getDocumentCurrencyCode();
        // Initialize the ref. currency based on the order document currency code
        if (documentCurrencyCodeType != null) {
            this.referenceCurrency = CurrencyCodeContentType.valueOf(documentCurrencyCodeType.getValue());
        }
        List<OrderLineType> orderLineTypes = orderType.getOrderLine();
        if (!orderLineTypes.isEmpty()) {
            for (OrderLineType orderLineType : orderLineTypes) {
View Full Code Here


    abstract void renderElectronicMail();

    public String getElectronicMailValue() {
        if (partyType.getContact() != null) {
            ElectronicMailType electronicMailType = partyType.getContact().getElectronicMail();
            if (electronicMailType != null) {
                return InvoiceTypeParser.parseElectronicMailType(electronicMailType);
            } else {
                return null;
            }
View Full Code Here

        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

    }

    public String toString() {
        StringBuilder sb = new StringBuilder(super.toString());
        if (invoiceToBeRendered != null) {
            IDType invoiceID = invoiceToBeRendered.getID();
            sb.append(formatKeyValue("invoiceKeyToBeRendered", invoiceID.getValue()));
        }
        return sb.toString();
    }
View Full Code Here

            String issueDateString =
                    CalendarUtil.toLocalDate(invoiceType.getIssueDate().getValue()).toString("yyyy-MM-dd");
            if (issueDateString != null) {
                sb.append(issueDateString);
            }
            IDType invoiceID = invoiceType.getID();
            if (invoiceID != null) {
                if (!sb.toString().isEmpty()) { // it means that the issue date is already appended
                    sb.append("_");
                }
                sb.append(invoiceID.getValue());
            }
            InvoiceCreationInput input = (InvoiceCreationInput)getInput();
            sb.append(input.getInvoiceOutputFormat().getFileSuffix());
        }
        if (!sb.toString().isEmpty()) {
View Full Code Here

        StringBuilder sb = new StringBuilder();
        if (invoiceOutputURI != null) {
            sb.append(StringUtil.formatKeyValue("invoiceOutputURI", getInvoiceOutputURI().getPath()));
        }
        if (generatedInvoiceType != null) {
            IDType invoiceIDType = generatedInvoiceType.getID();
            if (invoiceIDType != null) {
                sb.append(StringUtil.formatKeyValue("generatedInvoiceKey",invoiceIDType.getValue()));
            }

        }
        return sb.toString();
    }
View Full Code Here

public class OrderIssueTimeGenerator implements OrderTypeProcessUnit {

    private IssueTimeType issueTimeType;

    public OrderType process(OrderType orderType) throws org.openinvoice.ubl4j.core.common.FailedToProcessException {
        issueTimeType = new IssueTimeType();
        try {
            issueTimeType.setValue(CalendarUtil.toCalendar(new LocalTime()));
        } catch (DatatypeConfigurationException e) {
            throw new org.openinvoice.ubl4j.core.common.FailedToProcessException(e);
        }
View Full Code Here

        String currencyCode = payableAmountType.getCurrencyID().value();
        return createCurrencyDecimal(value, currencyCode);
    }

    private CurrencyDecimal createSubTotal(MonetaryTotalType monetaryTotalType) {
        LineExtensionAmountType lineExtensionAmount = monetaryTotalType.getLineExtensionAmount();
        BigDecimal value = lineExtensionAmount.getValue();
        String currencyCode = lineExtensionAmount.getCurrencyID().value();
        return createCurrencyDecimal(value, currencyCode);
    }
View Full Code Here

    }

    private boolean isOrderLineCurrencyTheSame(OrderLineType orderLineType) {

        LineItemType lineItemType = orderLineType.getLineItem();
        LineExtensionAmountType lineExtensionAmount = lineItemType.getLineExtensionAmount();

        // Check to see if the line extension prices all have the same value as the referenceCurrency
        if (lineExtensionAmount != null) {
            if (!referenceCurrency.equals(lineExtensionAmount.getCurrencyID())) {
                this.errorCurrency = lineExtensionAmount.getCurrencyID();
                return false;
            }
        }

        // Check to see tax currencies are all the same as the ref. currency
View Full Code Here

                return currencyDecimal;
        }
    }

    private CurrencyDecimal createGrandTotal(MonetaryTotalType monetaryTotalType) {
        PayableAmountType payableAmountType = monetaryTotalType.getPayableAmount();
        BigDecimal value = payableAmountType.getValue();
        String currencyCode = payableAmountType.getCurrencyID().value();
        return createCurrencyDecimal(value, currencyCode);
    }
View Full Code Here

TOP

Related Classes of oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2.LineExtensionAmountType

Copyright © 2018 www.massapicom. 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.