From: Roland Häder Date: Fri, 17 Nov 2017 23:22:59 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b1194a2e9790a279bddf02bf931b288e2caf1982;p=jbonuscard-core.git Continued: - nowadays, there are receipt numbers larger than 20 digits ... Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java b/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java index 6563ab4..b717de8 100644 --- a/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java +++ b/src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java @@ -120,14 +120,14 @@ public interface BillableReceipt extends Serializable { *

* @return Receipt number */ - Long getReceiptNumber (); + String getReceiptNumber (); /** * Setter for receipt number *

* @param receiptNumber Receipt number */ - void setReceiptNumber (final Long receiptNumber); + void setReceiptNumber (final String receiptNumber); /** * Getter for receipt register's number (cash register's number) diff --git a/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java b/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java index 09792d6..7a69728 100644 --- a/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java +++ b/src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java @@ -117,7 +117,7 @@ public class FinancialReceipt implements BillableReceipt { * Receipt number */ @Column (name = "receipt_number") - private Long receiptNumber; + private String receiptNumber; /** * Payment type (cash, credit card, EC card ...) @@ -324,12 +324,12 @@ public class FinancialReceipt implements BillableReceipt { } @Override - public Long getReceiptNumber () { + public String getReceiptNumber () { return this.receiptNumber; } @Override - public void setReceiptNumber (final Long receiptNumber) { + public void setReceiptNumber (final String receiptNumber) { this.receiptNumber = receiptNumber; } diff --git a/src/org/mxchange/jfinancials/model/receipt/Receipts.java b/src/org/mxchange/jfinancials/model/receipt/Receipts.java index c6e6493..9c1c893 100644 --- a/src/org/mxchange/jfinancials/model/receipt/Receipts.java +++ b/src/org/mxchange/jfinancials/model/receipt/Receipts.java @@ -55,9 +55,9 @@ public class Receipts implements Serializable { } else if (receipt1.getReceiptBranchOffice().getBranchId() < 1) { // Throw NPE throw new NullPointerException(MessageFormat.format("receipt1.receiptBranchOffice.branchId={0} is not valid", receipt1.getReceiptBranchOffice().getBranchId())); - } else if ((receipt1.getReceiptNumber() instanceof Long) && (receipt1.getReceiptNumber() < 1)) { + } else if ((receipt1.getReceiptNumber() != null) && (receipt1.getReceiptNumber().isEmpty())) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("receipt1.receiptNumber={0} is not valid.", receipt1.getReceiptNumber())); + throw new IllegalArgumentException("receipt1.receiptNumber is empty."); } else if (receipt1.getReceiptPaymentType()== null) { // Throw NPE throw new NullPointerException("receipt1.receiptPaymentType is null"); @@ -76,9 +76,9 @@ public class Receipts implements Serializable { } else if (receipt2.getReceiptBranchOffice().getBranchId() < 1) { // Throw NPE throw new NullPointerException(MessageFormat.format("receipt2.receiptBranchOffice.branchId={0} is not valid", receipt2.getReceiptBranchOffice().getBranchId())); - } else if ((receipt2.getReceiptNumber() instanceof Long) && (receipt2.getReceiptNumber() < 1)) { + } else if ((receipt2.getReceiptNumber() != null) && (receipt2.getReceiptNumber().isEmpty())) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("receipt2.receiptNumber={0} is not valid.", receipt2.getReceiptNumber())); + throw new IllegalArgumentException("receipt2.receiptNumber is empty."); } else if (receipt2.getReceiptPaymentType()== null) { // Throw NPE throw new NullPointerException("receipt2.receiptPaymentType is null");