Merge remote-tracking branch 'origin/develop' into develop

master
yixian 6 years ago
commit 4b7fdec4de

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.4</docker-image.version>
<docker-image.version>1.0.6</docker-image.version>
</properties>
<dependencies>

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.analysis.core.impls;
import au.com.royalpay.payment.manage.analysis.core.DailyReport;
import au.com.royalpay.payment.manage.mappers.cashback.CashbackRecordsMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDCommissionConfigMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.DailyReportMapper;
@ -22,7 +23,6 @@ import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -54,6 +54,8 @@ public class DailyReportImp implements DailyReport {
private MpWechatApiProvider mpWechatApiProvider;
@Resource
private FinancialBDPrizeLogMapper financialBDPrizeLogMapper;
@Resource
private FinancialBDCommissionConfigMapper financialBDCommissionConfigMapper;
private Logger logger = LoggerFactory.getLogger(getClass());
@ -98,9 +100,9 @@ public class DailyReportImp implements DailyReport {
private JSONObject getKPI(Date dt){
JSONObject report = new JSONObject();
List<JSONObject> kpiList =new ArrayList<>();
List<JSONObject> prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH));
List<JSONObject> prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-2), Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-2), Calendar.MONTH));
List<JSONObject> clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE));
List<JSONObject> prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH));
List<JSONObject> prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH));
List<JSONObject> clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH));
//BD团队总KPI
BigDecimal total_kpi_amount = BigDecimal.ZERO;
//BD团队当月总销售额
@ -114,7 +116,8 @@ public class DailyReportImp implements DailyReport {
kpi.put("total_amount",p.getBigDecimal("total_amount"));
//当月数据
kpi.put("month_amount",p.getBigDecimal("month_amount"));
kpi.put("kpi_amount",p.getBigDecimal("kpi_amount"));
BigDecimal kpi_amount = financialBDCommissionConfigMapper.findCurrentCommissionMaxAmount(DateFormatUtils.format(DateUtils.truncate(dt,Calendar.MONTH),"yyyy-MM"), p.getIntValue("bd_type"));
kpi.put("kpi_amount",kpi_amount);
for(JSONObject prize : prizeAmountAndBdTypeListYesterDay){
if(prize.getString("bd_group").equals(kpi.getString("bd_group"))){
BigDecimal compare = kpi.getBigDecimal("total_amount").subtract(prize.getBigDecimal("total_amount"));
@ -122,20 +125,23 @@ public class DailyReportImp implements DailyReport {
kpi.put("compare_value",Math.abs(compare.doubleValue()));
}
}
kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(p.getBigDecimal("kpi_amount"),4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%");
kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%");
for(JSONObject clientAmount :clientsAmount ){
if(clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))){
kpi.put("clients_history",clientAmount.getIntValue("clients_history"));
kpi.put("clients_month",clientAmount.getIntValue("clients_month"));
kpi.put("clients_yesterday",clientAmount.getIntValue("clients_yesterday"));
}
}
total_kpi_amount = total_kpi_amount.add(p.getBigDecimal("kpi_amount"));
total_kpi_amount = total_kpi_amount.add(kpi_amount);
total_month_amount = total_month_amount.add(p.getBigDecimal("month_amount"));
kpiList.add(kpi);
}
report.put("kpiList",kpiList);
report.put("kpi_percent_total",total_month_amount.divide(total_kpi_amount,4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%");
report.put("total_month_amount",total_month_amount);
Calendar calendar = Calendar.getInstance();
calendar.setTime(dt);
report.put("time_percent",BigDecimal.valueOf(calendar.get(Calendar.DAY_OF_MONTH)).divide(BigDecimal.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH)),4,BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0,5)+"%");
return report;
}

@ -22,6 +22,9 @@ public interface ClearingDistributedSurchargeMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject transactions);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> findByClearingId(@Param("client_id") int clientId, @Param("clearing_detail_id") String clearingDetailId);
List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto);
List<JSONObject> findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId);

@ -119,5 +119,5 @@ public interface ClientMapper {
@Select("select client_id from sys_clients where parent_client_id=#{parent_client_id}")
List<Integer> childClientId(@Param("parent_client_id") int parent_client_id);
List<JSONObject> createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date);
List<JSONObject> createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date,@Param("start_date_month") Date start_date_month);
}

@ -323,9 +323,9 @@ public interface ClientManager {
String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager);
void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager);
void registerAlipayGms(String clientMoniker, JSONObject manager);
void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager);
void registerAlipayOnlineGms(String clientMoniker, JSONObject manager);
String queryAlipayGmsStatus(String clientMoniker, JSONObject manager);

@ -3979,7 +3979,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void registerAlipayGms(String clientMoniker, JSONObject representative_id, JSONObject manager) {
public void registerAlipayGms(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -4002,13 +4002,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException("Alipay Industry can't be null");
}
if (!"Company".equals(client.getString("business_structure"))) {
if (StringUtils.isBlank(representative_id.getString("representative_id"))) {
throw new BadRequestException("ID or passport number can't be null");
}
client.put("representative_id", representative_id.getString("representative_id"));
}
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
@ -4117,7 +4110,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void registerAlipayOnlineGms(String clientMoniker, JSONObject representative_id, JSONObject manager) {
public void registerAlipayOnlineGms(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -4140,11 +4133,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client.put("bank_id", client_bank.getString("account_no"));
if (StringUtils.isBlank(representative_id.getString("representative_id"))) {
throw new BadRequestException("ID or passport number can't be null");
}
client.put("representative_id", representative_id.getString("representative_id"));
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant();
Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {

@ -628,8 +628,8 @@ public class PartnerManageController {
}
@ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void registerAlipayGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayGms(clientMoniker, representative_id, manager);
public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayGms(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
@ -638,8 +638,8 @@ public class PartnerManageController {
}
@ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@RequestBody JSONObject representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayOnlineGms(clientMoniker, representative_id, manager);
public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayOnlineGms(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.surchargeAccount.core;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
public interface SurchargeAccountService {
@ -12,4 +13,5 @@ public interface SurchargeAccountService {
void fillMothsSurcharge(JSONObject manager, String detailId);
void exportInvoicePDF(int clientId, String clearingDetailIdJSONObject,JSONObject manager, HttpServletResponse httpResponse);
}

@ -1,6 +1,9 @@
package au.com.royalpay.payment.manage.surchargeAccount.core.impl;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientsSurchargeAccountsMapper;
import au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper;
import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService;
@ -10,7 +13,9 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PdfUtils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -18,11 +23,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
@Service
@ -33,6 +41,10 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
@Resource
private FinancialSurchargeAccountDetailMapper financialSurchargeAccountDetailMapper;
@Resource
private ClientMapper clientMapper;
@Resource
private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper;
@Resource
private Locker locker;
@Resource
private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper;
@ -129,4 +141,75 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill");
}
}
@Override
public void exportInvoicePDF(int clientId, String clearingDetailId,JSONObject manager, HttpServletResponse httpResponse) {
JSONObject client = clientMapper.findClient(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> distributedDetail = clearingDistributedSurchargeMapper.findByClearingId(clientId, clearingDetailId);
if (distributedDetail.size() > 1) {
throw new BadRequestException("此次清算扣款已回滚");
}
JSONObject detial = distributedDetail.get(0);
String date = DateFormatUtils.format(detial.getDate("settle_date"), "dd MMM yyyy", Locale.US);
httpResponse.setContentType("application/pdf");
httpResponse.setHeader("content-disposition", "attachment;filename="+ client.getString("client_moniker") + "_Invoice_" + date + ".pdf");
ServletOutputStream sos = null;
JSONObject pdfInfo = new JSONObject();
try {
sos = httpResponse.getOutputStream();
List<JSONObject> clearingAnalysis = clearingDetailAnalysisMapper.listReportChannels(clearingDetailId);
invoiceChannelAmount(clearingAnalysis, pdfInfo);
httpResponse.getOutputStream();
pdfInfo.put("date", date);
pdfInfo.put("company_name", client.getString("company_name"));
pdfInfo.put("address", client.getString("address"));
pdfInfo.put("suburb", client.getString("suburb") +" " + client.getString("state") +" " +client.getString("postcode"));
pdfInfo.put("country", client.getString("country"));
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath("https://file.royalpay.com.au/open/2019/05/21/1558428021205_9pyF7U1rEloxVOXx2k7bTeRxzJaXi0.pdf");
pdu.setPdfTemplate(pdfInfo);
File file = new File(client.getString("client_moniker") + "_Invoice_"+ date + ".pdf");
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
sos.write(bos.toByteArray());
sos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
private void invoiceChannelAmount(List<JSONObject> analysis,JSONObject pdfInfo) {
BigDecimal wechatSurcharge = BigDecimal.ZERO;
BigDecimal wechatTaxAmount = BigDecimal.ZERO;
BigDecimal wechatAmount = BigDecimal.ZERO;
BigDecimal alipaySurcharge = BigDecimal.ZERO;
BigDecimal alipayTaxAmount = BigDecimal.ZERO;
BigDecimal alipayAmount = BigDecimal.ZERO;
for (JSONObject detail : analysis) {
switch (detail.getString("channel")) {
case "Wechat":
wechatSurcharge = detail.getBigDecimal("total_charge");
wechatTaxAmount = detail.getBigDecimal("tax_amount");
wechatAmount = detail.getBigDecimal("distributed_surcharge");
break;
case "Alipay":
alipaySurcharge = detail.getBigDecimal("total_charge");
alipayTaxAmount = detail.getBigDecimal("tax_amount");
alipayAmount = detail.getBigDecimal("distributed_surcharge");
break;
default:
break;
}
}
pdfInfo.put("surcharge_wechat", wechatSurcharge);
pdfInfo.put("amount_wechat", wechatSurcharge);
pdfInfo.put("surcharge_alipay", alipaySurcharge);
pdfInfo.put("amount_alipay", alipaySurcharge);
pdfInfo.put("amount", wechatSurcharge.add(alipaySurcharge));
pdfInfo.put("gst", wechatTaxAmount.add(alipayTaxAmount));
pdfInfo.put("total_amount", (wechatAmount.add(alipayAmount)).setScale(2, RoundingMode.DOWN));
}
}

@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@RequestMapping("/sys/surcharge_account")
@ -26,4 +27,10 @@ public class SurchargeAccountController {
public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) {
surchargeAccountService.fillMothsSurcharge(manager, detailId);
}
@ManagerMapping(value = "/{clientId}/settlement_logs/{clearingDetailId}/export", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.GET)
public void exportInvoicePDF(@PathVariable int clientId, @PathVariable String clearingDetailId,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
surchargeAccountService.exportInvoicePDF(clientId, clearingDetailId, manager, httpResponse);
}
}

@ -553,7 +553,7 @@
fbc.bd_name,
fbc.bd_group,
fbc.bd_type,
count( * ) clients_history
count( * ) clients_month
FROM
sys_clients sc
INNER JOIN sys_client_bd d ON sc.client_id = d.client_id
@ -561,7 +561,7 @@
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE
sc.org_id = 1
AND sc.create_time &lt; #{start_date}
AND sc.create_time &gt;= #{start_date_month}
AND d.is_valid = 1
AND c.bd_group IS NOT NULL
AND d.start_date &lt;= now( ) AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date &gt; now( )

@ -145,6 +145,11 @@
<div class="weui-cell__ft weui-flex__item"
th:text="${report.kpi.kpi_percent_total}"></div>
</div>
<div class="weui-cell weui-flex">
<div class="weui-cell__hd weui-flex__item">时间进度</div>
<div class="weui-cell__ft weui-flex__item"
th:text="${report.kpi.time_percent}"></div>
</div>
<div class="weui-cell weui-flex"
th:each=" kpi : ${report.kpi.kpiList}">
<div class="weui-cell__hd weui-flex__item"
@ -183,7 +188,7 @@
</div>
<div class="weui-panel">
<div class="weui-panel__hd">昨日开户数(历史开户数)</div>
<div class="weui-panel__hd">昨日开户数(当月开户数)</div>
<div class="weui-panel__ft">
<div class="weui-media-box weui-media-box_small-appmsg">
<div class="weui-cells">
@ -192,7 +197,7 @@
<div class="weui-cell__hd weui-flex__item"
th:text="${kpi.group_name}"></div>
<div class="weui-cell__ft weui-flex__item"
th:text="${kpi.clients_yesterday}+'('+${kpi.clients_history}+')'"></div>
th:text="${kpi.clients_yesterday}+'('+${kpi.clients_month}+')'"></div>
</div>
</div>
</div>

@ -1592,22 +1592,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: '是否使用该商户的现有信息进件?',
json: $scope.alipay_gms_json
}).then(function () {
if ($scope.partner.business_structure === "Company") {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () {
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'});
})
} else {
commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: text}).then(function () {
commonDialog.alert({title: 'Success', content: '提示Alipay进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'});
})
});
}
})
})
};
$scope.queryAlipayGms = function () {
@ -1625,14 +1615,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: '是否使用该商户的现有信息进件?',
json:$scope.alipayOnline_gms_json
}).then(function () {
commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms', {representative_id: text}).then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () {
commonDialog.alert({title: 'Success', content: '提示AlipayOnline进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: "进件失败:" + resp.data.message, type: 'error'});
})
});
})
});
};
@ -2404,13 +2391,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}]);
app.controller('surchargeAccountDetailCtrl', ['$scope', '$http', 'balance', 'partner', 'transactions', 'commonDialog', function ($scope, $http, balance, partner, transactions, commonDialog) {
$scope.surcharge = angular.copy(balance);
$scope.transactions = angular.copy(transactions.data);
$scope.surchargeDetailData = angular.copy(transactions.data);
$scope.partner = angular.copy(partner);
$scope.canAddDetail = false;
$scope.params = {};
$scope.getBalance = function () {
if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data;
@ -2421,7 +2407,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.getTransactions = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/account/transactions').then(function (resp) {
$scope.transactions = resp.data;
$scope.surchargeDetailData = resp.data;
});
}

@ -315,7 +315,7 @@
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Counrty</label>
<label class="control-label col-sm-4">Country</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.country"></p>

@ -708,7 +708,7 @@
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Counrty</label>
<label class="control-label col-sm-4">Country</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.country"></p>

@ -49,7 +49,7 @@
<td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td>
{{surcharge.remark}}
<a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
<a ng-href="/sys/surcharge_account/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>

@ -51,7 +51,7 @@
<td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td ng-bind="surcharge.remark"></td>
<td>
<a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
<a ng-href="/sys/surcharge_account/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i>
</a>

Loading…
Cancel
Save