diff --git a/pom.xml b/pom.xml index 8c3b3f4ee..cff7bc145 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.1.40 + 2.1.41 4.0.0 manage - 2.2.33 + 2.2.34 UTF-8 1.8.0 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 b6046766c..8982082ab 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 @@ -138,6 +138,8 @@ public class TradeLogServiceImpl implements TradeLogService { private org.springframework.core.io.Resource incremental_trans_flow; @Value("classpath:/jasper/partner_upay_invoice_gst.jasper") private org.springframework.core.io.Resource upay_trans_flow; + @Value("classpath:/jasper/incremental_partner_upay_invoice_gst.jasper") + private org.springframework.core.io.Resource incremental_upay_trans_flow; @Value("classpath:/jasper/royalpay_logo.png") private org.springframework.core.io.Resource logo; @Value("classpath:/jasper/trans_excel.jasper") @@ -822,20 +824,23 @@ public class TradeLogServiceImpl implements TradeLogService { parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2,RoundingMode.HALF_UP)); - parmerters.put("total_transaction_fee", analysis.getBigDecimal("total_transaction_fee").add(analysis.getBigDecimal("total_transaction_fee_tax")).setScale(2,RoundingMode.HALF_UP)); - parmerters.put("total_royalpay_fee", analysis.getBigDecimal("total_surcharge").subtract(parmerters.getBigDecimal("total_transaction_fee")).setScale(2,RoundingMode.HALF_UP)); - + BigDecimal totalTransactionFee = analysis.getBigDecimal("total_transaction_fee").add(analysis.getBigDecimal("total_transaction_fee_tax")).setScale(2, RoundingMode.HALF_UP); + BigDecimal totalRoyalpayFee = analysis.getBigDecimal("total_surcharge") + .subtract(analysis.getBigDecimal("total_transaction_fee")) + .subtract(analysis.getBigDecimal("total_transaction_fee_tax")) + .subtract(analysis.getBigDecimal("total_incremental_surcharge")) + .subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP); + parmerters.put("total_transaction_fee", totalTransactionFee); + parmerters.put("total_royalpay_fee", totalRoyalpayFee); + parmerters.put("total_card_fee", totalRoyalpayFee.add(totalTransactionFee)); + parmerters.put("total_incremental_fee", parmerters.getBigDecimal("incremental_fee").add(parmerters.getBigDecimal("incremental_gst"))); dataList.parallelStream().forEach(item -> { BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; - BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO; - BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO; - BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO; BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); BigDecimal transactionFee = item.getBigDecimal("transaction_fee"); BigDecimal transactionFeeTax = item.getBigDecimal("transaction_fee").divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); - BigDecimal royalpayTax = taxAmount.subtract(incrementalTax).subtract(transactionFeeTax); - BigDecimal realRoyalpayCharge = item.getBigDecimal("total_surcharge").add(taxAmount).subtract(transactionFee).subtract(transactionFeeTax); + BigDecimal realRoyalpayCharge = item.getBigDecimal("total_surcharge").add(taxAmount).subtract(transactionFee).subtract(transactionFeeTax).subtract(incrementalSurcharge).subtract(incrementalTax); item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); item.put("total_surcharge_intax", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); item.put("transaction_fee_intax", transactionFee.add(transactionFeeTax).setScale(2,RoundingMode.HALF_UP)); @@ -850,9 +855,8 @@ public class TradeLogServiceImpl implements TradeLogService { String fileName = client.getString("client_moniker") + "_Card_Payment_" + 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跨境商城"); -// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); - InputStream jasper = upay_trans_flow.getInputStream(); + JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); + InputStream jasper = clientIncrement == null ? upay_trans_flow.getInputStream() : incremental_upay_trans_flow.getInputStream(); byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); outs.write(bytes, 0, bytes.length); outs.flush(); diff --git a/src/main/resources/application-rppaysvc.yml b/src/main/resources/application-rppaysvc.yml index 484d8a4f6..5acb434de 100644 --- a/src/main/resources/application-rppaysvc.yml +++ b/src/main/resources/application-rppaysvc.yml @@ -4,4 +4,7 @@ app: priv-key: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDE55tREo6t6m1hekGlaMmDivorV3a+MkA/Wna0k917u/CGYIf7FtmWk1um7VcBRdljluLjqThePZgbgtwqTdHWXJP2gPwoJjLUluVEyKh19blSgrq7K1FEryAzQ5XFLzMX//EMc1BNrqcREHC6XVlJeNzpOd8+C83cxGxL+ayLoQ/ePEyp/8yXBbA6t2yXyi7H1ry8WiFFg9RFf+zAeESFXlKI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/qkMSc3Dc+fvjOvW60sEWNSMrJVHesaBVlJDhRFnzWqOoK+tBLgWtWodwwYFdcfUqM3LU2GSuL7xHSOSeVrvVk4ZMX6k1HQA0CgYAypY0eecX8Gc7SCt7wpYoNuL2MuZZIDXNZVMpWYMokA1Z74oX1uzecyTNLHgCFHpjiJPyc6KW1/pnDpcA9FuTmLUuNyuqsX85IEMZPkIqPFebAl4IvOuwzvXDPxxgh8B+XBQBydgFADeqgqXG8rxomC4PUrX47pKb1G89bTGp8Dw== pub-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmifNnVZG6HZBYdvLnCGyNm7rQTZKyl3w+7xdBGgjsQeaskdy/IgmrWRG4Ii1o82KV/ZA+bw86vE37axpoxbqOU3LYVb69nVYvmJOL018iBs74HhbZ8CtWtQmEIKqmX/rNUdp15OgwzDckvrK/EEzjdOoQfAkFB68wLOsTcsRwBB3JUL/uiHGK6b5Ofmh4PxYeAVNpWYHyCaQIuN6JH85VHBVS4etP25GbgWxl+ktuZucaPsQ2G25mwhlpNiC28J4la0wD33JKMfCNCjORlWkw2HcDvrRLqza4lJOXu0rFy3JuUkZ0hn834ZWd3MboqNNE6a2xe4ppZUJ9ccM9312JQIDAQAB server-root: https://channel.rpayplus.com/channel/v1/ + upload-file-keys: + - upay_application_form + - upay_desc_file diff --git a/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper b/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper new file mode 100644 index 000000000..cf6b40d3d Binary files /dev/null and b/src/main/resources/jasper/incremental_partner_upay_invoice_gst.jasper differ diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index 4c031e5be..ad5e3c2b7 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -466,7 +466,7 @@ -
+
Card Payment Config
diff --git a/src/main/ui/static/payment/tradelog/templates/balance_report.html b/src/main/ui/static/payment/tradelog/templates/balance_report.html index 896b3fc43..c54962cbe 100644 --- a/src/main/ui/static/payment/tradelog/templates/balance_report.html +++ b/src/main/ui/static/payment/tradelog/templates/balance_report.html @@ -390,7 +390,7 @@