diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index bdce657cf..d26342ad5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -5,6 +5,7 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.tasksupport.SettlementSupport; import au.com.royalpay.payment.manage.management.clearing.core.CleanService; import au.com.royalpay.payment.manage.mappers.log.*; +import au.com.royalpay.payment.manage.mappers.payment.SysClientIncrementalMapper; import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.*; @@ -133,6 +134,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider @Resource private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper; @Resource + private SysClientIncrementalMapper sysClientIncrementalMapper; + @Resource private Locker locker; @Resource @@ -727,6 +730,10 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider } List transactions = transactionMapper.listTransactionsOfClearingOrder(clearClient.getIntValue("clear_detail_id"), new PageBounds(Order.formString("order_id.asc"))); + + for (JSONObject transaction : transactions) { + transaction.put("rate_value",StringUtils.defaultString(sysClientIncrementalMapper.findByChannelAndClientId(transaction.getString("client_id"),transaction.getString("source")) ,"0")); + } String timezone_client = client.getString("timezone"); if (timezone_client != null) { transactions.parallelStream().forEach(p -> { diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 3fe129fdd..f5a1d60c0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -803,6 +803,7 @@ public class TradeLogServiceImpl implements TradeLogService { row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway")); row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_detail")); row.createCell(20, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id")); + row.createCell(21, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(data.getString("incremental_surcharge"),"0.0000")); } @Override @@ -1452,7 +1453,7 @@ public class TradeLogServiceImpl implements TradeLogService { String[] title = {"Transaction Time", "Client Order ID", "System Order ID", "Client Moniker", "Short Name", "Order ID", "Channel", "Input Amount", "Transaction Amount", "Transaction Currency", "Clearing Amount", "Settle Amount", "Surcharge", "GST", "Settle Date", "Exchange Rate", - "Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"}; + "Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No","Incremental Surcharge"}; for (int j = 0; j < title.length; j++) { row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index 43ec6db95..de1110881 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -587,6 +587,10 @@ display_amount, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.incremental_surcharge,0)),0) incremental_surcharge, + ifnull(sum(if(l.transaction_type='Debit' and l.refund_id is not null and l.currency!='CNY',l.incremental_surcharge,0)),0) + refund_incremental_surcharge, + ifnull(sum(if(l.currency!='CNY',l.incremental_surcharge,0)),0) + all_incremental_surcharge, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY' and l.pre_authorization=1,l.display_amount,0)),0) pre_display_amount, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency='CNY',l.display_amount,0)),0) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index b12b9714b..70e315367 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -949,13 +949,15 @@