]> git.mxchange.org Git - jfinancials-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 17 Nov 2017 23:22:59 +0000 (00:22 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 17 Nov 2017 23:22:59 +0000 (00:22 +0100)
- nowadays, there are receipt numbers larger than 20 digits ...

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jfinancials/model/receipt/BillableReceipt.java
src/org/mxchange/jfinancials/model/receipt/FinancialReceipt.java
src/org/mxchange/jfinancials/model/receipt/Receipts.java

index 6563ab4a3ccd5349b17f5a40df8cbfb6efcfb5c1..b717de8f3e23e6c4473759d8e990b3fb0706da57 100644 (file)
@@ -120,14 +120,14 @@ public interface BillableReceipt extends Serializable {
         * <p>
         * @return Receipt number
         */
-       Long getReceiptNumber ();
+       String getReceiptNumber ();
 
        /**
         * Setter for receipt number
         * <p>
         * @param receiptNumber Receipt number
         */
-       void setReceiptNumber (final Long receiptNumber);
+       void setReceiptNumber (final String receiptNumber);
 
        /**
         * Getter for receipt register's number (cash register's number)
index 09792d697784661170dec3c5b0be360a8fa9d6f4..7a69728624b99e4a06e0f6db80e7e732da0d02ca 100644 (file)
@@ -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;
        }
 
index c6e6493a8de631ce1cc9acc9875d5a2b7370aeb4..9c1c8938b4e0762073dfcf673a96b289ef9c3f4e 100644 (file)
@@ -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");