Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,76 @@
import java.util.Date;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

@ApiModel( description = "An invoice generated by the platform after a customer order" )
public class InvoiceDTO extends BaseInvoiceDTO
{
@ApiModelProperty( value = "The amount to be paid" )
@ApiModelProperty( "The amount to be paid" )
protected VATPriceDTO total;

@ApiModelProperty( value = "Who will pay the invoice" )
@ApiModelProperty( "Who will pay the invoice" )
private UrlEntityDTO nominee;

@ApiModelProperty( value = "If the invoice emission and payment is handled by vendor/reseller or by the platform" )
@ApiModelProperty( "If the invoice emission and payment is handled by vendor/reseller or by the platform" )
private boolean selfBilled = false;

@ApiModelProperty( value = "If this invoice is subject to the Italian electronic document tax" )
@ApiModelProperty( "If this invoice is subject to the Italian electronic document tax" )
private boolean stampDuty = false;

@NotNull
@ApiModelProperty( value = "The order type this invoice refers to", allowableValues = "NORMAL, TRIAL, SANDBOX" )
private String type = "NORMAL";

@NotNull
@ApiModelProperty( value = "The product name this invoice refers to" )
@ApiModelProperty( "The product name this invoice refers to" )
private String product = "N/A";

@NotNull
@ApiModelProperty( value = "The ProductVersion name this invoice refers to" )
@ApiModelProperty( "The ProductVersion name this invoice refers to" )
private String productVersion = "N/A";

@JsonInclude ( JsonInclude.Include.NON_EMPTY )
@ApiModelProperty( value = "A reference of a successful payment" )
@ApiModelProperty( "A reference of a successful payment" )
private String paymentReference;

@JsonInclude ( JsonInclude.Include.NON_EMPTY )
@ApiModelProperty( value = "When the payment of the invoice has completed successfully" )
@ApiModelProperty( "When the payment of the invoice has completed successfully" )
private Date paymentReceived;

@JsonInclude ( JsonInclude.Include.NON_EMPTY )
@ApiModelProperty( value = "The last payment error if any" )
@ApiModelProperty( "The last payment error if any" )
private String lastPaymentError;

private UrlEntityDTO subscription;

private UrlEntityDTO order;

@ApiModelProperty( value = "The operations that can be executed by the current user on the invoice" )
@ApiModelProperty( "The operations that can be executed by the current user on the invoice" )
private Set<InvoiceOperationType> availableOperations = EnumSet.noneOf( InvoiceOperationType.class );

@ApiModelProperty( value = "The reference to a PDF version of the invoice" )
@ApiModelProperty( "The reference to a PDF version of the invoice" )
private String remoteId;

@ApiModelProperty( value = "The quota received by the platform owner when the invoice has been issued" )
@ApiModelProperty( "The quota received by the platform owner when the invoice has been issued" )
private BigDecimal revenueSharingQuota;

@ApiModelProperty( "The billed lines of the invoice" )
private List<OrderLineDTO> entries;

@ApiModelProperty( value = "If the invoice has been generated by the vendor/reseller" )
@ApiModelProperty( "If the invoice has been generated by the vendor/reseller" )
private Boolean cashed;

private InvoiceStatus status;

@ApiModelProperty( value = "Who resold the Product" )
@ApiModelProperty( "Who resold the Product" )
private UrlEntityDTO reseller;

@ApiModelProperty( "Currency conversion factors at the invoice's issue" )
private Map<String, BigDecimal> currencyConversion;

/**
* @deprecated use {@link #getTotal()}
*/
Expand Down Expand Up @@ -374,6 +378,16 @@ public void setLastPaymentError( String lastPaymentError )
this.lastPaymentError = lastPaymentError;
}

public Map<String, BigDecimal> getCurrencyConversion()
{
return currencyConversion;
}

public void setCurrencyConversion( Map<String, BigDecimal> currencyConversion )
{
this.currencyConversion = currencyConversion;
}

/**
* @deprecated by {@code getStatus()}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public class OrderLineDTO implements Line
@ApiModelProperty( "Custom billing identifier" )
private String identifier;

@ApiModelProperty( "Original line currency" )
private String originalCurrency;

/**
* @deprecated by {@link #getSubtotal()}
*/
Expand Down Expand Up @@ -214,6 +217,16 @@ public void setIdentifier( String identifier )
this.identifier = identifier;
}

public String getOriginalCurrency()
{
return originalCurrency;
}

public void setOriginalCurrency( String originalCurrency )
{
this.originalCurrency = originalCurrency;
}

@Override
public boolean equals( Object o )
{
Expand Down