All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.phloc.masterdata.vat.IVATItem Maven / Gradle / Ivy

There is a newer version: 3.7.6
Show newest version
/**
 * Copyright (C) 2006-2014 phloc systems
 * http://www.phloc.com
 * office[at]phloc[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.phloc.masterdata.vat;

import java.math.BigDecimal;

import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;

import com.phloc.commons.annotations.MustImplementEqualsAndHashcode;
import com.phloc.commons.id.IHasID;
import com.phloc.commons.name.IHasDisplayText;
import com.phloc.datetime.period.ILocalDatePeriod;

/**
 * Defines a single VAT item valid within a country.
 * 
 * @author Philip Helger
 */
@MustImplementEqualsAndHashcode
public interface IVATItem extends IHasDisplayText, IHasID , ILocalDatePeriod
{
  /**
   * @return The non-null type of this item.
   */
  @Nonnull
  EVATType getType ();

  /**
   * @return The percentage of this VAT type. Must be between 0 and 100.
   */
  @Nonnull
  @Nonnegative
  BigDecimal getPercentage ();

  /**
   * @return The factor (e.g. 0.2 for 20% or 0.5 for 50%). Always ≥ 0 (for 0%
   *         VAT) and ≤ 1 (for 100% VAT).
   */
  @Nonnull
  @Nonnegative
  BigDecimal getPercentageFactor ();

  /**
   * @return The multiplication factor (e.g. 1.2 for 20% or 1.5 for 50%). Always
   *         ≥ 1 (for 0% VAT) and ≤ 2 (for 100% VAT). It can also be used
   *         to calculate the net from the gross price by calling
   *         gross.divide (factor)
   */
  @Nonnull
  @Nonnegative
  BigDecimal getMultiplicationFactorNetToGross ();

  /**
   * @return true if this item is deprecated and a new VAT item
   *         applies now.
   */
  boolean isDeprecated ();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy