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 f6790a08b..ebdfda893 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 @@ -52,6 +52,7 @@ import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; +import org.apache.http.util.TextUtils; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.*; @@ -832,9 +833,12 @@ public class TradeLogServiceImpl implements TradeLogService { : "-"; item.put("debit", debit); item.put("credit", credit); - - + if(item.get("settle_amount")==null){ + item.put("settle_amount","-"); + } }); + System.out.println("------>dataList:"+dataList); + System.out.println("------>parmerters:"+parmerters); ctx.setVariable("parmerters",parmerters); ctx.setVariable("dataList",dataList); final String html = thymeleaf.process("app/invoice.html", ctx); @@ -844,14 +848,14 @@ public class TradeLogServiceImpl implements TradeLogService { String fileName = client.getString("client_moniker") + "_Cross_Border_" + parmerters.getString("dateRange").replaceAll("/", ""); response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); OutputStream outs = response.getOutputStream(); - JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); +// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); // InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); // byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); System.out.println("------>content:"+html); ByteArrayOutputStream os = new ByteArrayOutputStream(); ITextRenderer renderer = new ITextRenderer(); - ITextFontResolver fontResolver = (ITextFontResolver) renderer.getSharedContext().getFontResolver(); +// ITextFontResolver fontResolver = (ITextFontResolver) renderer.getSharedContext().getFontResolver(); //添加字体库 begin // File f = new File(fontDir); // if (f.isDirectory()) { @@ -875,24 +879,6 @@ public class TradeLogServiceImpl implements TradeLogService { outs.flush(); outs.close(); -// final String html = thymeleaf.process("invoice.html", ctx); - -// response.setContentType("application/pdf"); -// String fileName = client.getString("client_moniker") + "_" + parmerters.getString("dateRange").replaceAll("/", ""); -// response.setHeader("Content-Disposition", "attachment;fileName=123.pdf"); -// OutputStream outs = null; -// try { -// outs = response.getOutputStream(); -//// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); -//// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); -//// byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); -// outs.write(buff, 0, buff.length); -// outs.flush(); -// outs.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// } - } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/resources/templates/app/invoice.html b/src/main/resources/templates/app/invoice.html index 26514111e..376e72a54 100644 --- a/src/main/resources/templates/app/invoice.html +++ b/src/main/resources/templates/app/invoice.html @@ -72,18 +72,26 @@ height: auto; font-weight: bold; } + .divSumary{ + child-align: middle; + } .spancontent-title{ width: 40%; float: left; color: #000000; font-size: 17px; font-weight: bold; + vertical-align: center; + } + .spancontent-value{ color: #000000; font-size: 17px; font-weight: bold; padding-left: 5px; + vertical-align: center; + } .hrclass{ background-color: #bf7a12; @@ -98,23 +106,25 @@
Tunnel Show Pty Ltd trading as RoyalPay
ABN 16 601 619 685 Representative of AFSL 448066
- +
+
- Tax Invoice
- Merchant code + Tax Invoice +
+
Merchant code

- Statement +
Statement

- Issue Date +
Issue Date-

- Current +
Current

-
+
Your Statement
@@ -124,15 +134,15 @@ Date/Time
-
+
Transaction ID
-
+
Debit
-
+
Credit
@@ -140,40 +150,40 @@ Service Fee for RoyalPay (GST inclu)
-
+
Service fee for Mini Program(GST Inclu)
-
+
Settlement Amount
- +
-
- +
+
-
- +
+ -
-
- Credit +
+ -
- +
-
- +
+
-
- +
+