From 682a41540977dacc4e8afe05a20bc9d658b04cce Mon Sep 17 00:00:00 2001 From: rsteimen Date: Wed, 17 Aug 2022 16:35:02 +0200 Subject: [PATCH] fix: when exporting in another ccy then received, table still showed received ledger ccy --- .../ui/paymentTable/PaymentTableModel.java | 2 +- .../CryptoIso20022Interop/ui/paymentTable/Record.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/PaymentTableModel.java b/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/PaymentTableModel.java index c69b2402..d7e3eec1 100644 --- a/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/PaymentTableModel.java +++ b/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/PaymentTableModel.java @@ -85,7 +85,7 @@ public Object getValueAt(int row, int col) { } else if (getColumnIndex(COL_AMOUNT) == col) { return item.getAmount(actor); } else if (getColumnIndex(COL_CCY) == col) { - return item.getCcy(actor); + return item.getCcy(); } else if (getColumnIndex(COL_TRX_STATUS) == col) { return item.payment.getTransmission(); } else if (getColumnIndex(COL_DETAIL) == col) { diff --git a/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/Record.java b/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/Record.java index d5a33292..ffb0307e 100644 --- a/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/Record.java +++ b/src/main/java/com/radynamics/CryptoIso20022Interop/ui/paymentTable/Record.java @@ -64,8 +64,11 @@ public void setAmount(Double value) { amount = value; } - public Object getCcy(Actor actor) { - return actor == Actor.Sender ? payment.getFiatCcy() : payment.getLedgerCcy(); + public Object getCcy() { + // When exporting 'As received" return received ccy instance to let user know more about issuer. + return payment.getLedgerCcy().getCcy().equals(payment.getFiatCcy()) + ? payment.getLedgerCcy() + : payment.getFiatCcy(); } @Override