From e2455be41cd382d848920ecf4a56f5d637e47200 Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 18 Apr 2018 10:19:03 +0800 Subject: [PATCH] ABA File Modify --- .../royalpay/payment/manage/support/abafile/ABAFile.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java index 0028fa65e..636d26c81 100644 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java +++ b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java @@ -41,11 +41,12 @@ public class ABAFile { StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); - writer.println(generateTopLine()); + writer.print(generateTopLine() + "\r\n"); for (SettleMerchantInfo info : settlements) { - writer.println(info.settleLine()); + String line = info.settleLine(); + writer.print(line + "\r\n"); } - writer.println(generateBalanceLine()); + writer.print(generateBalanceLine() + "\r\n"); writer.print(generateFinalLine()); writer.flush(); return out.toString().getBytes(); @@ -125,7 +126,7 @@ public class ABAFile { lineBuilder.replace(62, 80, StringUtils.rightPad("RoyalPay" + DateFormatUtils.format(settleDate, "yyyyMMdd"), 18)); lineBuilder.replace(80, 87, bsbNo(selfBSB)); lineBuilder.replace(87, 96, StringUtils.leftPad(selfAccountNo, 9)); - lineBuilder.replace(96, 112, StringUtils.rightPad(company, 16)); + lineBuilder.replace(96, 112, StringUtils.left(StringUtils.rightPad(company, 16), 16)); lineBuilder.replace(112, 120, StringUtils.leftPad("0", 8, "0")); return lineBuilder.toString(); }