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

Examples of oasis.names.specification.ubl.schema.xsd.commonaggregatecomponents_2.TaxSchemeType


        }
        return partyName;
    }

    public String getAddressValue() {
        AddressType addressType = partyType.getPostalAddress();
        String addressStr = InvoiceTypeParser.parseAddressType(addressType);
        return addressStr != null ? addressStr.trim() : addressStr;
    }
View Full Code Here


        try {
            addPartyLogo();
        } catch (IOException e) { // Continue, even logo can't be added
            UBL4JLoggerFactory.getDefaultLogger().error("Can't add party logo", e);
        }
        ContactType contactType = partyType.getContact();
        for (org.openinvoice.ubl4j.core.common.text.TextLabel label : listOfLabelsToDisplay) {
            if (isLabel(label)) { // If the TextLabel is a label, skip it.
                continue;
            }
            if (label == org.openinvoice.ubl4j.core.common.text.TextLabel.SUPPLIER_ADDRESS || label == org.openinvoice.ubl4j.core.common.text.TextLabel.CUSTOMER_ADDRESS) {
View Full Code Here

        if (!orderLineTypes.isEmpty()) {
            for (OrderLineType orderLineType : orderLineTypes) {

                // Initialize the ref. currency based on the price currency of the first line
                if (this.referenceCurrency == null) {
                    LineItemType lineItemType = orderLineType.getLineItem();
                    if (lineItemType != null) {
                        this.referenceCurrency = lineItemType.getPrice().getPriceAmount().getCurrencyID();
                    }
                }

                if (!isOrderLineCurrencyTheSame(orderLineType)) {
                    return false;
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
        List<TaxCategoryType> taxCategoryTypes = lineItemType.getItem().getClassifiedTaxCategory();
        for (TaxCategoryType taxCategoryType : taxCategoryTypes) {
            TaxSchemeType taxSchemeType = taxCategoryType.getTaxScheme();
            if (taxSchemeType != null) {
                if (!this.referenceCurrency.value().equals(taxSchemeType.getCurrencyCode().getValue())) {
                    this.errorCurrency = CurrencyCodeContentType.valueOf(taxSchemeType.getCurrencyCode().getValue());
View Full Code Here

        pdfInvoice.add(table);
    }

    private InvoiceLineTable createTotalRows(InvoiceLineTable table) {

        MonetaryTotalType monetaryTotalType = pdfInvoice.getInvoiceType().getLegalMonetaryTotal();

        CurrencyDecimal total = createGrandTotal(monetaryTotalType);
        CurrencyDecimal subtotal = createSubTotal(monetaryTotalType);
        CurrencyDecimal totalTax = total.subtract(subtotal);
View Full Code Here

    public String getPartyTaxSchemeCompanyID() {
        List<PartyTaxSchemeType> partyTaxSchemes = partyType.getPartyTaxScheme();
        String companyIDValue = null;
        if (partyTaxSchemes != null && partyTaxSchemes.size() > 0) {
            PartyTaxSchemeType partyTaxScheme = partyTaxSchemes.get(0);
            if (partyTaxScheme != null) {
                IdentifierType companyID = partyTaxScheme.getCompanyID();
                if (companyID != null) {
                    companyIDValue = companyID.getValue();
                }
            }
        }
View Full Code Here

        this.ubl4JConfigurationBean = ubl4JConfigurationBean;
        initLocaleFromSupplierOrDefaultConfig();
    }

    private void initLocaleFromSupplierOrDefaultConfig() {
        PartyType supplier = invoiceType.getAccountingSupplierParty().getParty();
        if (supplier != null) {
            Locale supplierLocale = InvoiceTypeParser.parsePartyLocale(supplier);
            this.locale = (supplierLocale != null)? supplierLocale: ubl4JConfigurationBean.getDefaultLocale();
        }
    }
View Full Code Here

        render();
    }

    private void render() {
        if (supplierPartyTable.getPdfInvoice().getInvoiceType().getPaymentMeans().size() > 0) {
            PaymentMeansType paymentMeansType =
                    supplierPartyTable.getPdfInvoice().getInvoiceType().getPaymentMeans().get(0);
            String supplierBankName =
                    InvoiceTypeParser.parseFinancialInstitutionName(paymentMeansType.getPayeeFinancialAccount());
            String supplierBankAcc =
                    InvoiceTypeParser.parseFinancialAccountID(paymentMeansType.getPayeeFinancialAccount());
            String supplierBankBic =
                    InvoiceTypeParser.parseFinancialInstitutionID(paymentMeansType.getPayeeFinancialAccount());

            if (supplierPartyTable.toBeRendered(org.openinvoice.ubl4j.core.common.text.TextLabel.SUPPLIER_BANK_NAME)) {
                addCell(org.openinvoice.ubl4j.core.common.text.TextLabel.SUPPLIER_BANK_NAME_LABEL, supplierBankName);
            }
            if (supplierPartyTable.toBeRendered(org.openinvoice.ubl4j.core.common.text.TextLabel.SUPPLIER_BANK_ACCOUNT)) {
View Full Code Here

        }

        // Check to see tax currencies are all the same as the ref. currency
        List<TaxCategoryType> taxCategoryTypes = lineItemType.getItem().getClassifiedTaxCategory();
        for (TaxCategoryType taxCategoryType : taxCategoryTypes) {
            TaxSchemeType taxSchemeType = taxCategoryType.getTaxScheme();
            if (taxSchemeType != null) {
                if (!this.referenceCurrency.value().equals(taxSchemeType.getCurrencyCode().getValue())) {
                    this.errorCurrency = CurrencyCodeContentType.valueOf(taxSchemeType.getCurrencyCode().getValue());
                    return false;
                }
            }
        }
        return true;
View Full Code Here

TOP

Related Classes of oasis.names.specification.ubl.schema.xsd.commonaggregatecomponents_2.TaxSchemeType

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.