Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 90 #92

Merged
merged 3 commits into from
Apr 24, 2019
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
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
7.0.1
https://github.com/killbill/killbill-analytics-plugin/issues/89
https://github.com/killbill/killbill-analytics-plugin/issues/90

7.0.0
Initial release for Kill Bill 0.21.x

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014 The Billing Project, LLC
* Copyright 2014-2019 Groupon, Inc
* Copyright 2014-2019 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you 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:
*
Expand Down Expand Up @@ -34,6 +35,8 @@ public class BusinessInvoice extends BusinessEntityBase {
private final LocalDate invoiceDate;
private final LocalDate targetDate;
private final String currency;
private final BigDecimal rawBalance;
private final BigDecimal convertedRawBalance;
private final BigDecimal balance;
private final BigDecimal convertedBalance;
private final BigDecimal amountPaid;
Expand All @@ -46,6 +49,7 @@ public class BusinessInvoice extends BusinessEntityBase {
private final BigDecimal convertedAmountCredited;
private final BigDecimal amountRefunded;
private final BigDecimal convertedAmountRefunded;
private final boolean writtenOff;
private final String convertedCurrency;
private final List<BusinessInvoiceItem> invoiceItems = new LinkedList<BusinessInvoiceItem>();

Expand All @@ -64,6 +68,8 @@ public BusinessInvoice(final BusinessInvoiceModelDao businessInvoiceModelDao,
this.invoiceDate = businessInvoiceModelDao.getInvoiceDate();
this.targetDate = businessInvoiceModelDao.getTargetDate();
this.currency = businessInvoiceModelDao.getCurrency();
this.rawBalance = businessInvoiceModelDao.getRawBalance();
this.convertedRawBalance = businessInvoiceModelDao.getConvertedRawBalance();
this.balance = businessInvoiceModelDao.getBalance();
this.convertedBalance = businessInvoiceModelDao.getConvertedBalance();
this.amountPaid = businessInvoiceModelDao.getAmountPaid();
Expand All @@ -77,6 +83,7 @@ public BusinessInvoice(final BusinessInvoiceModelDao businessInvoiceModelDao,
this.amountRefunded = businessInvoiceModelDao.getAmountRefunded();
this.convertedAmountRefunded = businessInvoiceModelDao.getConvertedAmountRefunded();
this.convertedCurrency = businessInvoiceModelDao.getConvertedCurrency();
this.writtenOff = businessInvoiceModelDao.isWrittenOff();
for (final BusinessInvoiceItemBaseModelDao businessInvoiceItemModelDao : businessInvoiceItemModelDaos) {
invoiceItems.add(new BusinessInvoiceItem(businessInvoiceItemModelDao));
}
Expand All @@ -102,6 +109,14 @@ public String getCurrency() {
return currency;
}

public BigDecimal getRawBalance() {
return rawBalance;
}

public BigDecimal getConvertedRawBalance() {
return convertedRawBalance;
}

public BigDecimal getBalance() {
return balance;
}
Expand Down Expand Up @@ -150,6 +165,10 @@ public BigDecimal getConvertedAmountRefunded() {
return convertedAmountRefunded;
}

public boolean isWrittenOff() {
return writtenOff;
}

public String getConvertedCurrency() {
return convertedCurrency;
}
Expand All @@ -166,6 +185,8 @@ public String toString() {
sb.append(", invoiceDate=").append(invoiceDate);
sb.append(", targetDate=").append(targetDate);
sb.append(", currency='").append(currency).append('\'');
sb.append(", rawBalance=").append(rawBalance);
sb.append(", convertedRawBalance=").append(convertedRawBalance);
sb.append(", balance=").append(balance);
sb.append(", convertedBalance=").append(convertedBalance);
sb.append(", amountPaid=").append(amountPaid);
Expand All @@ -178,6 +199,7 @@ public String toString() {
sb.append(", convertedAmountCredited=").append(convertedAmountCredited);
sb.append(", amountRefunded=").append(amountRefunded);
sb.append(", convertedAmountRefunded=").append(convertedAmountRefunded);
sb.append(", writtenOff=").append(writtenOff);
sb.append(", convertedCurrency='").append(convertedCurrency).append('\'');
sb.append(", invoiceItems=").append(invoiceItems);
sb.append('}');
Expand Down Expand Up @@ -234,6 +256,9 @@ public boolean equals(final Object o) {
if (convertedOriginalAmountCharged != null ? !(convertedOriginalAmountCharged.compareTo(that.convertedOriginalAmountCharged) == 0) : that.convertedOriginalAmountCharged != null) {
return false;
}
if (convertedRawBalance != null ? !(convertedRawBalance.compareTo(that.convertedRawBalance) == 0) : that.convertedRawBalance != null) {
return false;
}
if (currency != null ? !currency.equals(that.currency) : that.currency != null) {
return false;
}
Expand All @@ -252,9 +277,15 @@ public boolean equals(final Object o) {
if (originalAmountCharged != null ? !(originalAmountCharged.compareTo(that.originalAmountCharged) == 0) : that.originalAmountCharged != null) {
return false;
}
if (rawBalance != null ? !(rawBalance.compareTo(that.rawBalance) == 0) : that.rawBalance != null) {
return false;
}
if (targetDate != null ? targetDate.compareTo(that.targetDate) != 0 : that.targetDate != null) {
return false;
}
if (writtenOff != that.writtenOff) {
return false;
}

return true;
}
Expand All @@ -267,6 +298,8 @@ public int hashCode() {
result = 31 * result + (invoiceDate != null ? invoiceDate.hashCode() : 0);
result = 31 * result + (targetDate != null ? targetDate.hashCode() : 0);
result = 31 * result + (currency != null ? currency.hashCode() : 0);
result = 31 * result + (rawBalance != null ? rawBalance.hashCode() : 0);
result = 31 * result + (convertedRawBalance != null ? convertedRawBalance.hashCode() : 0);
result = 31 * result + (balance != null ? balance.hashCode() : 0);
result = 31 * result + (convertedBalance != null ? convertedBalance.hashCode() : 0);
result = 31 * result + (amountPaid != null ? amountPaid.hashCode() : 0);
Expand All @@ -281,6 +314,7 @@ public int hashCode() {
result = 31 * result + (convertedAmountRefunded != null ? convertedAmountRefunded.hashCode() : 0);
result = 31 * result + (convertedCurrency != null ? convertedCurrency.hashCode() : 0);
result = 31 * result + (invoiceItems != null ? invoiceItems.hashCode() : 0);
result = 31 * result + (writtenOff ? 1 : 0);
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014 The Billing Project, LLC
* Copyright 2014-2019 Groupon, Inc
* Copyright 2014-2019 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you 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:
*
Expand Down Expand Up @@ -33,6 +34,8 @@ public class BusinessInvoiceItem extends BusinessEntityBase {
private final LocalDate invoiceDate;
private final LocalDate invoiceTargetDate;
private final String invoiceCurrency;
private final BigDecimal rawInvoiceBalance;
private final BigDecimal convertedRawInvoiceBalance;
private final BigDecimal invoiceBalance;
private final BigDecimal convertedInvoiceBalance;
private final BigDecimal invoiceAmountPaid;
Expand All @@ -45,6 +48,7 @@ public class BusinessInvoiceItem extends BusinessEntityBase {
private final BigDecimal convertedInvoiceAmountCredited;
private final BigDecimal invoiceAmountRefunded;
private final BigDecimal convertedInvoiceAmountRefunded;
private final boolean invoiceWrittenOff;
private final String itemType;
private final String itemSource;
private final UUID bundleId;
Expand Down Expand Up @@ -80,6 +84,8 @@ public BusinessInvoiceItem(final BusinessInvoiceItemBaseModelDao businessInvoice
this.invoiceDate = businessInvoiceItemBaseModelDao.getInvoiceDate();
this.invoiceTargetDate = businessInvoiceItemBaseModelDao.getInvoiceTargetDate();
this.invoiceCurrency = businessInvoiceItemBaseModelDao.getInvoiceCurrency();
this.rawInvoiceBalance = businessInvoiceItemBaseModelDao.getRawInvoiceBalance();
this.convertedRawInvoiceBalance = businessInvoiceItemBaseModelDao.getConvertedRawInvoiceBalance();
this.invoiceBalance = businessInvoiceItemBaseModelDao.getInvoiceBalance();
this.convertedInvoiceBalance = businessInvoiceItemBaseModelDao.getConvertedInvoiceBalance();
this.invoiceAmountPaid = businessInvoiceItemBaseModelDao.getInvoiceAmountPaid();
Expand All @@ -92,6 +98,7 @@ public BusinessInvoiceItem(final BusinessInvoiceItemBaseModelDao businessInvoice
this.convertedInvoiceAmountCredited = businessInvoiceItemBaseModelDao.getConvertedInvoiceAmountCredited();
this.invoiceAmountRefunded = businessInvoiceItemBaseModelDao.getInvoiceAmountRefunded();
this.convertedInvoiceAmountRefunded = businessInvoiceItemBaseModelDao.getConvertedInvoiceAmountRefunded();
this.invoiceWrittenOff = businessInvoiceItemBaseModelDao.isInvoiceWrittenOff();
this.itemType = businessInvoiceItemBaseModelDao.getItemType();
this.itemSource = businessInvoiceItemBaseModelDao.getItemSource();
this.bundleId = businessInvoiceItemBaseModelDao.getBundleId();
Expand Down Expand Up @@ -140,6 +147,14 @@ public String getInvoiceCurrency() {
return invoiceCurrency;
}

public BigDecimal getRawInvoiceBalance() {
return rawInvoiceBalance;
}

public BigDecimal getConvertedRawInvoiceBalance() {
return convertedRawInvoiceBalance;
}

public BigDecimal getInvoiceBalance() {
return invoiceBalance;
}
Expand Down Expand Up @@ -188,6 +203,10 @@ public BigDecimal getConvertedInvoiceAmountRefunded() {
return convertedInvoiceAmountRefunded;
}

public boolean isInvoiceWrittenOff() {
return invoiceWrittenOff;
}

public String getItemType() {
return itemType;
}
Expand Down Expand Up @@ -270,6 +289,8 @@ public String toString() {
sb.append(", invoiceDate=").append(invoiceDate);
sb.append(", invoiceTargetDate=").append(invoiceTargetDate);
sb.append(", invoiceCurrency='").append(invoiceCurrency).append('\'');
sb.append(", rawInvoiceBalance=").append(rawInvoiceBalance);
sb.append(", convertedRawInvoiceBalance=").append(convertedRawInvoiceBalance);
sb.append(", invoiceBalance=").append(invoiceBalance);
sb.append(", convertedInvoiceBalance=").append(convertedInvoiceBalance);
sb.append(", invoiceAmountPaid=").append(invoiceAmountPaid);
Expand All @@ -282,6 +303,7 @@ public String toString() {
sb.append(", convertedInvoiceAmountCredited=").append(convertedInvoiceAmountCredited);
sb.append(", invoiceAmountRefunded=").append(invoiceAmountRefunded);
sb.append(", convertedInvoiceAmountRefunded=").append(convertedInvoiceAmountRefunded);
sb.append(", invoiceWrittenOff='").append(invoiceWrittenOff).append('\'');
sb.append(", itemType='").append(itemType).append('\'');
sb.append(", itemSource='").append(itemSource).append('\'');
sb.append(", bundleId=").append(bundleId);
Expand Down Expand Up @@ -354,6 +376,9 @@ public boolean equals(final Object o) {
if (convertedInvoiceOriginalAmountCharged != null ? !(convertedInvoiceOriginalAmountCharged.compareTo(that.convertedInvoiceOriginalAmountCharged) == 0) : that.convertedInvoiceOriginalAmountCharged != null) {
return false;
}
if (convertedRawInvoiceBalance != null ? !(convertedRawInvoiceBalance.compareTo(that.convertedRawInvoiceBalance) == 0) : that.convertedRawInvoiceBalance != null) {
return false;
}
if (currency != null ? !currency.equals(that.currency) : that.currency != null) {
return false;
}
Expand Down Expand Up @@ -396,6 +421,9 @@ public boolean equals(final Object o) {
if (invoiceTargetDate != null ? invoiceTargetDate.compareTo(that.invoiceTargetDate) != 0 : that.invoiceTargetDate != null) {
return false;
}
if (invoiceWrittenOff != that.invoiceWrittenOff) {
return false;
}
if (itemId != null ? !itemId.equals(that.itemId) : that.itemId != null) {
return false;
}
Expand All @@ -420,6 +448,9 @@ public boolean equals(final Object o) {
if (productType != null ? !productType.equals(that.productType) : that.productType != null) {
return false;
}
if (rawInvoiceBalance != null ? !rawInvoiceBalance.equals(that.rawInvoiceBalance) : that.rawInvoiceBalance != null) {
return false;
}
if (slug != null ? !slug.equals(that.slug) : that.slug != null) {
return false;
}
Expand All @@ -443,6 +474,8 @@ public int hashCode() {
result = 31 * result + (invoiceDate != null ? invoiceDate.hashCode() : 0);
result = 31 * result + (invoiceTargetDate != null ? invoiceTargetDate.hashCode() : 0);
result = 31 * result + (invoiceCurrency != null ? invoiceCurrency.hashCode() : 0);
result = 31 * result + (rawInvoiceBalance != null ? rawInvoiceBalance.hashCode() : 0);
result = 31 * result + (convertedRawInvoiceBalance != null ? convertedRawInvoiceBalance.hashCode() : 0);
result = 31 * result + (invoiceBalance != null ? invoiceBalance.hashCode() : 0);
result = 31 * result + (convertedInvoiceBalance != null ? convertedInvoiceBalance.hashCode() : 0);
result = 31 * result + (invoiceAmountPaid != null ? invoiceAmountPaid.hashCode() : 0);
Expand All @@ -455,6 +488,7 @@ public int hashCode() {
result = 31 * result + (convertedInvoiceAmountCredited != null ? convertedInvoiceAmountCredited.hashCode() : 0);
result = 31 * result + (invoiceAmountRefunded != null ? invoiceAmountRefunded.hashCode() : 0);
result = 31 * result + (convertedInvoiceAmountRefunded != null ? convertedInvoiceAmountRefunded.hashCode() : 0);
result = 31 * result + (invoiceWrittenOff ? 1 : 0);
result = 31 * result + (itemType != null ? itemType.hashCode() : 0);
result = 31 * result + (itemSource != null ? itemSource.hashCode() : 0);
result = 31 * result + (bundleId != null ? bundleId.hashCode() : 0);
Expand Down
Loading