Merge branch 'devlop-T1125-R-Rervice' into develop

master
luoyang 5 years ago
commit 36c6d99d84

@ -24,6 +24,7 @@
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-core</artifactId>
<version>1.1.6</version>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>

@ -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<JSONObject> 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 -> {

@ -30,10 +30,14 @@ public interface OrderMapper {
PageList<JSONObject> listOrders(JSONObject params, PageBounds pagination);
PageList<JSONObject> listIncrementalOrders(JSONObject params, PageBounds pagination);
List<JSONObject> listOrdersNoPage(JSONObject params);
PageList<JSONObject> listOrdersByClients(JSONObject params, PageBounds pagination);
PageList<JSONObject> listIncrementalOrdersByClients(JSONObject params, PageBounds pagination);
JSONObject analysisOrders(JSONObject params);
JSONObject getOrderDetail(@Param("order_id") String orderId);

@ -0,0 +1,25 @@
package au.com.royalpay.payment.manage.mappers.payment;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* Created by liuxinxin on 2019-11-12.
*/
@AutoMapper(tablename = "sys_client_incremental", pkName = "incremental_id")
public interface SysClientIncrementalMapper {
@Select("SELECT incremental_rate_value FROM sys_client_incremental WHERE channel = #{channel} AND client_id = #{client_id} ")
String findByChannelAndClientId(@Param("client_id") String clientId,@Param("channel") String channel);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> find(@Param("client_id") String clientId);
}

@ -0,0 +1,37 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Author DuLingLing
* @create 2019/11/13 0013 14:49
*/
@AutoMapper(tablename = "sys_client_incremental", pkName = "incremental_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClientIncrementalMapper {
/**
*
* @param clientId
* @return
*/
@AutoSql(type = SqlType.SELECT)
List<JSONObject> findAllByclientMoniker(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findByClinetIdAndChannel(@Param("client_id")int clinet_id, @Param("channel")String channel);
@AutoSql(type = SqlType.INSERT)
void save(JSONObject saveIncrementalService);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject saveIncrementalService);
}

@ -477,4 +477,33 @@ public interface ClientManager {
JSONObject getClientInfoByAggree(JSONObject account);
JSONObject getComplianceFilesForBD(JSONObject account);
/**
*
*
* @param clientMoniker
* @return
*/
JSONObject partnerIncrementalService(String clientMoniker);
/**
* /
* @param clientMoniker
* @param incrementalService
*/
void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService,JSONObject manager);
/**
* /
* @param clientMoniker
* @param incrementalService
*/
void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService,JSONObject manager);
/**
*
* @param clientMoniker
* @return
*/
JSONObject partnerIncrementalServiceInfo(String clientMoniker, String incrementalId);
}

@ -17,6 +17,7 @@ import au.com.royalpay.payment.core.PaymentChannelApi;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.tools.defines.IncrementalChannel;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -122,11 +123,12 @@ import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.security.*;
import java.security.InvalidParameterException;
import java.security.KeyPair;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.List;
import java.util.*;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
@ -162,6 +164,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private StringRedisTemplate stringRedisTemplate;
@Resource
private ClientComplianceApply clientComplianceApply;
@Resource
private ClientIncrementalMapper clientIncrementalMapper;
@Value("${app.redis.prefix}")
private String redisPrefix;
@ -267,8 +271,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientConfigMapper clientConfigMapper;
@Resource
private PermissionPartnerModuleMapper permissionPartnerModuleMapper;
@Resource
private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
@Resource
private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper;
@ -356,7 +358,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (manager != null) {
checkClientOrg(manager, client);
}
String same_phone = clientMapper.findSamePhone(client.getString("contact_phone")).getString("a");
if (same_phone != null && client.getString("contact_phone") != null && same_phone.contains(" ")) {
same_phone = same_phone.replace(client.getString("client_moniker"), "");
@ -1580,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private void checkPhoneAndWechatExist(NewAccountBean account) {
List<JSONObject> accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code());
if ( accounts != null && accounts.size()>0) {
if (accounts != null && accounts.size() > 0) {
throw new BadRequestException("Mobile phone number has been bound to other accounts");
}
}
@ -1653,13 +1654,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (account == null) {
throw new BadRequestException("account not exists");
}
if(user.getString("openid")!=null && !"".equals(user.getString("openid"))) {
if (user.getString("openid") != null && !"".equals(user.getString("openid"))) {
if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) {
throw new BadRequestException("The WeChat has been linked to other accounts");
}
}
if(user.getString("unioinid")!=null && !"".equals(user.getString("unioinid"))){
if(clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0 ){
if (user.getString("unioinid") != null && !"".equals(user.getString("unioinid"))) {
if (clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size() > 0) {
throw new BadRequestException("The WeChat has been linked to other accounts");
}
}
@ -5899,4 +5900,93 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return key;
}
@Override
public JSONObject partnerIncrementalService(String clientMoniker) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> service = clientIncrementalMapper.findAllByclientMoniker(client.getInteger("client_id"));
List<String> incrementalChannels = new ArrayList<>();
for (IncrementalChannel e : IncrementalChannel.values()) {
boolean exist = false;
for (JSONObject s : service) {
exist = e.getChannel().equals(s.getString("channel"));
if (exist) {
break;
}
}
if (!exist) {
incrementalChannels.add(e.getChannel());
}
}
incrementalChannels.remove("system");
return new JSONObject() {{
put("all_service", service);
put("incremental_channel", incrementalChannels);
}};
}
@Override
public JSONObject partnerIncrementalServiceInfo(String clientMoniker,String channel){
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject incrementalInfo = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), channel);
if(incrementalInfo==null){
throw new BadRequestException("Merchant service not opened");
}
return incrementalInfo;
}
@Override
public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
JSONObject saveIncrementalService = new JSONObject();
if (existIncrementalService == null) {
saveIncrementalService.put("incremental_id", UUID.randomUUID().toString());
saveIncrementalService.put("channel", incrementalService.getString("channel"));
saveIncrementalService.put("create_time", new Date());
saveIncrementalService.put("update_time", new Date());
saveIncrementalService.put("is_valid", 1);
} else {
saveIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
saveIncrementalService.put("update_time", new Date());
}
saveIncrementalService.put("client_id", client.getInteger("client_id"));
saveIncrementalService.put("operator", manager.getString("display_name"));
saveIncrementalService.put("incremental_mode", incrementalService.getInteger("incremental_mode"));
saveIncrementalService.put("incremental_rate_value", incrementalService.getInteger("incremental_mode") == 1 ? incrementalService.getString("incremental_rate_value") : 0);
saveIncrementalService.put("total_incremental_amount", incrementalService.getInteger("incremental_mode") != 1 ? incrementalService.getString("total_incremental_amount") : 0);
if (existIncrementalService == null) {
clientIncrementalMapper.save(saveIncrementalService);
} else {
clientIncrementalMapper.update(saveIncrementalService);
}
}
@Override
public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
if (existIncrementalService == null) {
throw new BadRequestException("Incremental service is not exist");
}
existIncrementalService.put("update_time", new Date());
existIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
existIncrementalService.put("is_valid", incrementalService.getInteger("is_valid"));
existIncrementalService.put("operator", manager.getString("display_name"));
clientIncrementalMapper.update(existIncrementalService);
}
}

@ -809,4 +809,34 @@ public class PartnerManageController {
public void switchPartnerCBChannelConfig(@PathVariable String clientMoniker, @PathVariable String channelKey, @RequestBody JSONObject channel) {
clientManager.partnerCBChannelConfig(clientMoniker, channelKey, channel.getString("channel_id"));
}
/**
*
* @param clientMoniker
* @return
*/
@ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public JSONObject getClientIncrementalService(@PathVariable String clientMoniker){
return clientManager.partnerIncrementalService(clientMoniker);
}
/**
* /
* @param clientMoniker
* @param incrementalService
*/
@ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
clientManager.changePartnerIncrementalService(clientMoniker,incrementalService,manager);
}
/**
* /
* @param clientMoniker
* @param incrementalService
*/
@ManagerMapping(value = "/{clientMoniker}/incremental_service/status", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
clientManager.changeSwitchIncrementalService(clientMoniker,incrementalService,manager);
}
}

@ -301,6 +301,12 @@ public class PartnerViewController {
return tradeLogService.listPartnerTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone"));
}
@PartnerMapping(value = "/incremental_trade_logs", method = RequestMethod.GET)
@ResponseBody
public JSONObject listIncrementalTradeLogs(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, TradeLogQuery query) throws Exception {
return tradeLogService.listPartnerIncrementalTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone"));
}
@PartnerMapping(value = "/trade_logs/{orderId}", method = RequestMethod.GET)
@ResponseBody
public JSONObject getOrderDetail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String orderId) {
@ -602,4 +608,28 @@ public class PartnerViewController {
public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.deleteAuthFiles(fileId);
}
/**
*
* @param clientMoniker
* @return
*/
@PartnerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getClientIncrementalService(@PathVariable String clientMoniker){
return clientManager.partnerIncrementalService(clientMoniker);
}
/**
*
* @param clientMoniker
* @param channel
* @return
*/
@PartnerMapping(value = "/{clientMoniker}/incremental_service/{channel}/info", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getClientIncrementalServiceInfo(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("channel") String channel){
return clientManager.partnerIncrementalServiceInfo(clientMoniker,channel);
}
}

@ -60,7 +60,6 @@ public class SignInController {
private ManagerTodoNoticeProvider[] managerTodoNoticeProviders;
@Resource
private ClientManager clientManager;
@Resource
private ManagerAccountsService managerAccountsService;
@ -191,6 +190,7 @@ public class SignInController {
@PartnerMapping(value = "/current_partner", method = RequestMethod.GET)
public JSONObject partnerLoginStatus(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
partner.put("has_incremental_setvice",clientManager.partnerIncrementalService(partner.getString("client_moniker")).getJSONArray("all_service").size()>0);
return partner;
}

@ -28,6 +28,7 @@ public class TradeLogQuery {
private String datefrom;
private String dateto;
private int[] gateway;
private String source = "ALL" ;
private OrderStatus status = OrderStatus.PAID;
private PayChannel channel = PayChannel.ALL;
private String[] client_ids;
@ -84,6 +85,8 @@ public class TradeLogQuery {
if (client_ids != null) {
params.put("client_ids", client_ids);
}
params.put("source", source);
params.put("status", status.getStatus());
params.put("channel", channel.getChannels());
@ -242,4 +245,12 @@ public class TradeLogQuery {
public void setorg_id2(String org_id2) {
this.org_id2 = org_id2;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}

@ -14,8 +14,12 @@ import java.util.List;
public interface TradeLogService {
JSONObject listPartnerTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception;
JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception;
JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager);
JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager);
List<JSONObject> listOrderRefunds(String orderId, String timezone);
void getOrderDetail(Model model, String clientMoniker, String orderId, String openid);

@ -112,6 +112,8 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper;
@Resource
private SysClientIncrementalMapper sysClientIncrementalMapper;
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Resource
private ClearingLogMapper clearingLogMapper;
@ -171,6 +173,42 @@ public class TradeLogServiceImpl implements TradeLogService {
return result;
}
@Override
public JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String shortId, TradeLogQuery query, String timezone) throws Exception {
JSONObject client = clientManager.getClientInfoByMoniker(shortId);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
JSONObject params = query.toParams(timezone);
clientManager.validateClients(client.getIntValue("client_id"), params);
params.put("client_id", client.getIntValue("client_id"));
if (manager != null && manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));
}
if(query.getGatewayChild()!=null){
params.put("trade_type",new ArrayList<Integer>(){{add(query.getGatewayChild());}});
}
PageList<JSONObject> logs = orderMapper.listIncrementalOrdersByClients(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
if (timezone != null) {
TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time");
}
if (account != null) {
PartnerRole role = PartnerRole.getRole(account.getIntValue("role"));
if (role == PartnerRole.MANAGER || role == PartnerRole.ADMIN) {
for (JSONObject log : logs) {
log.put("audition", !refundAuditionMapper.listAuditingRefundsOfOrder(log.getString("order_id")).isEmpty());
}
}
}
JSONObject result = PageListUtils.buildPageListResult(logs);
JSONObject analysis = orderMapper.analysisOrders(params);
result.put("analysis", analysis);
return result;
}
@Override
public JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager) {
JSONObject params = query.toParams(null);
@ -195,6 +233,33 @@ public class TradeLogServiceImpl implements TradeLogService {
return result;
}
@Override
public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager) {
JSONObject params = query.toParams(null);
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", manager.getString("manager_id"));
}
if (query.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) {
params.remove("bd_user");
params.put("bd_group", manager.getString("manager_id"));
if (query.getGroup_bd() > 0) {
params.put("bd_group_bd", query.getGroup_bd());
}
}
orgManager.checkOrgIds(manager, params);
if(query.getGatewayChild()!=null){
params.put("trade_type",new ArrayList<Integer>(){{add(query.getGatewayChild());}});
}
PageList<JSONObject> logs = orderMapper.listIncrementalOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
for (JSONObject log : logs) {
log.put("rate_value",sysClientIncrementalMapper.findByChannelAndClientId(log.getString("client_id"),log.getString("source")));
}
JSONObject result = PageListUtils.buildPageListResult(logs);
JSONObject analysis = orderMapper.analysisOrders(params);
result.put("analysis", analysis);
return result;
}
@Override
public List<JSONObject> listOrderRefunds(String orderId, String timezone) {
@ -727,14 +792,16 @@ public class TradeLogServiceImpl implements TradeLogService {
row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_amount"));
row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(data.getString("settle_amount"));
row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(data.getString("total_surcharge"));
row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(data.getString("tax_amount"));
row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_time"));
row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type").equals("clearing") ? "-" : data.getBigDecimal("exchange_rate").toString());
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type"));
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clear_status"));
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(13, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(data.getString("incremental_surcharge"),"0.0000"));
row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(data.getString("tax_amount"));
row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_time"));
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type").equals("clearing") ? "-" : data.getBigDecimal("exchange_rate").toString());
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type"));
row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clear_status"));
row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway"));
row.createCell(20, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_detail"));
row.createCell(21, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id"));
}
@Override
@ -1383,7 +1450,7 @@ public class TradeLogServiceImpl implements TradeLogService {
Row row = sheet.createRow(rowNum);
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",
"Settle Amount", "Surcharge", "Incremental Surcharge", "GST", "Settle Date", "Exchange Rate",
"Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"};
for (int j = 0; j < title.length; j++) {
row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]);

@ -34,6 +34,13 @@ public class ManageTradelogController {
return tradeLogService.listAllTradeLogs(query, manager);
}
@RequestMapping(value = "/incremental",method = RequestMethod.GET)
@ReadOnlyConnection
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return tradeLogService.listAllIncrementalTradeLogs(query, manager);
}
@ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR})
@ReadOnlyConnection
@RequirePartner

@ -1,6 +1,16 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_local
spring.datasource.host=192.168.0.50:3306
spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
#多数据源配置
spring.datasource.type = com.zaxxer.hikari.HikariDataSource
#数据源master
spring.datasource.master.schema-name=royalpay_production
spring.datasource.master.host=192.168.1.52:3306
spring.datasource.master.jdbc-url=jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.master.username=taylor
spring.datasource.master.password=taylor
#数据源salve
spring.datasource.slave.schema-name=royalpay_production
spring.datasource.slave.host=192.168.1.52:3306
spring.datasource.slave.jdbc-url=jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.slave.username=taylor
spring.datasource.slave.password=taylor

@ -19,8 +19,8 @@
<select id="getCashbackRecores" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.*,p.client_moniker,p.short_name FROM cashback_records c
INNER JOIN sys_clients p on c.client_id=p.client_id
SELECT c.*,p.client_moniker,p.short_name,o.source FROM cashback_records c
INNER JOIN sys_clients p on c.client_id=p.client_id INNER JOIN pmt_orders o on c.order_id = o.order_id
<where>
<if test="client_ids!=null">
AND c.client_id IN

@ -23,6 +23,7 @@
p.short_name,
o.refund_amount refund_fee,
o.customer_id,
o.source,
sum(t.clearing_amount) clearing_amount,
t.refund_id,
t.transaction_time,
@ -30,7 +31,11 @@
t.transaction_id,
t.exchange_rate,
t.clearing_status,
t.settle_amount
t.settle_amount,
t.incremental_surcharge,
t.total_surcharge,
t.tax_amount,
t.surcharge_rate
</sql>
<sql id="gateway_keys">
SELECT
@ -42,6 +47,7 @@
o.create_time,
o.confirm_time pay_time,
o.pre_authorization,
o.source,
CASE o.status
WHEN 0
THEN 'SUBMITTING'
@ -149,7 +155,148 @@
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id,oo.source
from pmt_orders oo
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'remark'">
AND oo.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND oo.channel = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND oo.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND oo.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND oo.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="from != null">
AND oo.create_time &gt;= #{from}
</if>
<if test="to != null">
AND oo.create_time &lt; #{to}
</if>
<if test="date != null">
AND oo.transaction_date = DATE(#{date})
</if>
<if test="dev_id != null">
AND oo.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
oo.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
oo.channel = #{chan}
</foreach>
</if>
<if test="source != 'ALL'">
AND
oo.source = #{source}
</if>
</where>
) o
INNER JOIN sys_clients p
ON p.client_id = o.client_id
AND p.is_valid = 1
<if test="client_ids != null">
AND p.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids == null and client_id != null">
AND p.client_id = #{client_id}
</if>
LEFT JOIN pmt_transactions t
ON t.order_id = o.order_id
AND t.refund_id IS NULL
AND t.transaction_type = 'Credit'
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'all'">
AND (
p.client_moniker = #{search_text}
OR p.short_name LIKE #{name_pattern}
OR o.order_detail LIKE #{name_pattern}
OR t.system_transaction_id = #{search_text}
OR o.channel = #{search_text}
OR o.order_id = #{search_text}
)
</if>
<if test="text_type == 'client_moniker'">
AND p.client_moniker = #{search_text}
</if>
<if test="text_type == 'client_name'">
AND p.short_name LIKE #{name_pattern}
</if>
<if test="text_type == 'sys_trans_id'">
AND t.system_transaction_id = #{search_text}
</if>
</if>
<if test="org_id != null and org_ids == null">
AND p.org_id = #{org_id}
</if>
<if test="org_ids != null">
AND p.org_id IN
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">
#{org_id}
</foreach>
</if>
<if test="bd_group != null">
AND p.client_id IN(
SELECT distinct b.client_id
FROM sys_client_bd b
INNER JOIN financial_bd_config c
ON c.manager_id = b.bd_id
WHERE b.is_valid = 1
AND b.start_date &lt;= now()
AND (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group = #{bd_group} or c.manager_id = #{bd_group})
<if test="bd_group_bd">
AND c.manager_id = #{bd_group_bd}
</if>
)
</if>
<if test="bd_user != null">
AND p.client_id in(select distinct d.client_id
from sys_client_bd d
where d.bd_id = #{bd_user}
AND d.is_valid = 1
AND DATE(d.start_date) &lt;= curdate()
AND (d.end_date IS NULL OR DATE(d.end_date) &gt;= curdate()))
</if>
</where>
GROUP BY o.order_id
</select>
<select id="listIncrementalOrders" resultType="com.alibaba.fastjson.JSONObject">
<if test="gateway">
<include refid="gateway_keys"/>
</if>
<if test="!gateway">
<include refid="tradelog_list_keys"/>
</if>
FROM (
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id,oo.source
from pmt_orders oo
<where>
<if test="search_text != null">
@ -197,6 +344,8 @@
oo.channel = #{chan}
</foreach>
</if>
AND
oo.source != 'system'
</where>
) o
INNER JOIN sys_clients p
@ -379,6 +528,48 @@
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if>
<if test="source != 'ALL'">
AND
o.source = #{source}
</if>
</where>
GROUP BY o.order_id
</select>
<select id="listIncrementalOrdersByClients" resultType="com.alibaba.fastjson.JSONObject">
<include refid="tradelog_list_keys"/>
,i.incremental_rate as rate_value
FROM pmt_orders o
INNER JOIN sys_clients p ON p.client_id=o.client_id and p.is_valid=1
<if test="client_ids!=null">
AND p.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id !=null">
and p.client_id=#{client_id}
</if>
LEFT JOIN pmt_transactions t on t.order_id=o.order_id and t.refund_id is null and t.transaction_type='Credit'
LEFT JOIN pmt_incremental_detail i on i.transaction_id = t.transaction_id
<where>
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="status!=null">
and
<foreach collection="status" item="std" open="(" close=")" separator=" or ">o.status=#{std}</foreach>
</if>
<if test="channel!=null">
and
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if>
<if test="source != 'ALL'">
AND
o.source = #{source}
</if>
</where>
GROUP BY o.order_id
</select>
@ -396,6 +587,12 @@
count(DISTINCT l.client_id) clients,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.display_amount,0)),0)
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)
@ -475,6 +672,10 @@
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">o.channel=#{chan}
</foreach>
</if>
<if test="source !='ALL'">
and
o.source=#{source}
</if>
<if test="bd_group!=null">and p.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id

@ -96,7 +96,7 @@
<select id="listTransFlow" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*,
o.status,
o.status,o.source,
c.client_moniker,
c.short_name,
o.dev_id order_dev_id,
@ -949,13 +949,15 @@
<select id="listTransactionsOfClearingOrder" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT t.*,
IFNULL(t.incremental_surcharge, 0.00) incremental_surcharge_settle,
o.display_amount,
o.client_order_id,
o.gateway,
r.out_refund_id,
r.client_refund_id,
o.order_detail,
o.dev_id
o.dev_id,
o.source
FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id

@ -874,6 +874,11 @@ margin-bottom: 10%;"/>
<!--<i class="fa fa-list-alt"></i> -->Orders
</a>
</li>
<!--<li>
<a ui-sref="incremental_trade">
&lt;!&ndash;<i class="fa fa-list-alt"></i> &ndash;&gt;Incremental Orders
</a>
</li>-->
<li>
<a ui-sref="settlementlogs">
<!--<i class="fa fa-calendar"></i> -->Settlement
@ -1035,6 +1040,10 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="has-submenu" ui-sref-active="active">
<a ui-sref="partnerIncrementalService"><i class="fa fa-plus-square-o"></i>R Services</a>
</li>
</ul>
<!-- End navigation menu -->
</div> <!-- end #navigation -->

@ -343,6 +343,11 @@ margin-bottom: 10%;"/>
<i class="fa fa-list-alt"></i> <span>交易流水|Trades Logs</span>
</a>
</li>
<li ui-sref-active="active" ng-if="'tradelog'|withModule">
<a ui-sref="incremental_trade" ui-sref-opts="{reload:true}">
<i class="fa fa-list-alt"></i> <span>增值服务交易流水|Incremental Trades Logs</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('transAnalysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_transanalysis" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>交易数据|Transaction Data</span>

@ -78,7 +78,8 @@ var modules = [
{path: 'static/payment/surchargeaccount/partner-surcharge-account', module: 'surchargeAccountApp', roles: [1,2,3]},
{path: 'static/integralmall/coupon_cancellation', module: 'couponCancellation', roles: [1,2]},
{path: 'static/invoice/invoice_assistant', module: 'partnerInvoice', roles: [1]},
{path: 'static/payment/billqrcode/bill-qrcode-manage', module: 'billQrCodeManagement', roles: [1,2,3]}
{path: 'static/payment/billqrcode/bill-qrcode-manage', module: 'billQrCodeManagement', roles: [1,2,3]},
{path: 'static/incrementalService/partner-incremental-service', module: 'partnerIncrementalService', roles: [1,2,3]}
];
require(['angular', 'jquery'], function (angular, $) {

@ -80,7 +80,13 @@
<tbody>
<tr ng-repeat="record in records">
<td ng-bind="record.short_name"></td>
<td ng-bind="record.order_id"></td>
<td>
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="record.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="record.source=='R跨境商城'"/>
{{record.order_id}}
</td>
<td ng-bind="record.cashback_amount|currency:'AUD '"></td>
<td ng-bind="record.create_time"></td>
<td>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

@ -0,0 +1,271 @@
define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
'use strict';
var app = angular.module('partnerIncrementalService', ['ui.bootstrap', 'ui.router']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('partnerIncrementalService', {
url: '/partner_incremental_service',
templateUrl: '/static/incrementalService/templates/partner_incremental_service.html',
controller: 'partnerIncrementalServiceCtrl',
resolve:{
partner:['$http',function($http){
return $http.get('/client/partner_info');
}]
}
}).state('partnerIncrementalServiceInfo', {
url: '/partner_incremental_service_info?:channel',
templateUrl: '/static/incrementalService/templates/partner_incremental_service_info.html',
controller: 'partnerIncrementalServiceInfoCtrl',
resolve:{
partner:['$http',function($http){
return $http.get('/client/partner_info');
}]
}
});
}]);
app.controller('partnerIncrementalServiceCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.serviceAll = [];
$scope.channelOptions = [];
$scope.windowHeight = document.body.clientWidth;
$scope.clientInfo = partner.data
$scope.initDate = function(){
$http.get("/client/partner_info/"+$scope.clientInfo.client_moniker+"/incremental_service").then(function (res) {
$scope.serviceAll = res.data.all_service;
$scope.serviceAll.forEach(function(service){
service.logo_url = '/static/images/'+service.channel+'.jpg'
})
res.data.incremental_channel.forEach(function(channel){
$scope.channelOptions.push({name:channel,logo_url:'/static/images/'+channel+'.jpg'})
})
})
}
$scope.initDate();
}]);
app.controller('partnerIncrementalServiceInfoCtrl',['$scope', '$http', '$state','$stateParams','$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog','partner',
function($scope,$http,$state,$stateParams,$filter, $timeout, partnerRefunder, orderService, commonDialog,partner){
$scope.serviceInfo = {}
$scope.initDate = function () {
$http.get("/client/partner_info/"+partner.data.client_moniker+"/incremental_service/"+$stateParams.channel+"/info").then(function(res){
$scope.serviceInfo =res.data
$scope.serviceInfo.logo_url = '/static/images/'+$scope.serviceInfo.channel+'.jpg'
})
}
$scope.initDate();
$scope.params = {source: $scope.serviceInfo.channel,status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
$scope.pagination = {};
$scope.today = new Date();
$scope.isAll = true;
$scope.isLevel3All = true;
$scope.device_isAll = true;
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.clients = [$scope.currentUser.client];
$scope.showLevel3Clients = false;
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
$scope.loadTradeLogs(1);
};
$scope.chooseYesterday = function () {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
$scope.params.datefrom = $scope.params.dateto = yesterday;
$scope.loadTradeLogs(1);
};
$scope.chooseLast7Days = function () {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.loadTradeLogs(1);
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
var monthBegin = new Date();
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.lastMonth = function () {
var monthFinish = new Date();
monthFinish.setDate(0);
$scope.params.dateto = monthFinish;
var monthBegin = new Date();
monthBegin.setDate(0);
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.loadTradeLogs = function (page) {
$scope.params.source = $scope.serviceInfo.channel;
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
params.page = page || $scope.pagination.page || 1;
$http.get('/client/partner_info/incremental_trade_logs', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.gatewaySelected = function (arr) {
return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) {
return arr.indexOf(gateway) >= 0
}).length > 0
};
$scope.showTradeDetail = function (order) {
orderService.clientOrderDetail(order)
};
$scope.showPRefundLog = function (orderId) {
partnerRefunder.prefunded(orderId);
};
$scope.newPRefund = function (orderId) {
partnerRefunder.prefund(orderId).then(function () {
$scope.loadTradeLogs();
});
};
$scope.releasePreAuth = function (orderId) {
commonDialog.confirm({
title: 'Pre Authorization Completion',
content: 'This bill will be taken into settlement, or you will be able to make a refund order. Are you sure?'
}).then(function () {
$http.put('/client/partner_info/trade_logs/' + orderId + '/release_preauth').then(function (resp) {
$scope.loadTradeLogs();
}, function (resp) {
commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'})
})
})
};
$scope.alerts = [];
$scope.$on('pe_order_paid', function (evt, order) {
$scope.alerts.push(order);
$timeout(function () {
$scope.alerts.splice(0, 1);
}, 10000);
$scope.loadTradeLogs();
});
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.clientIds);
$scope.showLevel3Clients = false;
$scope.listDevices();
} else if (client.level3Clients) {
$scope.chooseClientId = client.client_id;
$scope.showLevel3Clients = true;
$scope.level3Clients = client.level3Clients;
$scope.isAll = false;
$scope.level3ClientIds = [];
$scope.level3ClientIds.push(client.client_id);
client.level3Clients.forEach(function (client) {
$scope.level3ClientIds.push(client.client_id);
});
$scope.chooseLevel3Client("all");
return;
} else {
$scope.chooseClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isAll = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.showLevel3Clients = false;
$scope.listDevices();
}
$scope.loadTradeLogs();
};
$scope.chooseLevel3Client = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.level3ClientIds);
$scope.isLevel3All = true;
$scope.chooseLevel3ClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.level3ClientIds);
$scope.listDevices();
} else {
$scope.chooseLevel3ClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isLevel3All = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.listDevices();
}
$scope.loadTradeLogs();
};
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
$scope.params.dev_id = null;
$scope.device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.loadTradeLogs(1);
//console.log($rootScope.currentUser.client.clientList);
})
}else{
$scope.loadTradeLogs(1);
}
$scope.fullReleasePreAuth = function (){
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
commonDialog.confirm({
title: 'All Pre Authorization Completion',
content: 'These pre authorization orders will be taken into settlement, or you will be able to make a refund order. Are you sure?'
}).then(function(){
$http.put('/client/partner_info/trade_logs/full_release_preauth',params).then(function (resp){
$scope.loadTradeLogs(1);
alert("Success");
},function (resp) {
commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'})
})
});
}
}]);
return app;
});

@ -0,0 +1,161 @@
<style>
*{margin: 0;padding: 0;}
@keyframes rotate_90 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(90deg);
}
}
@-webkit-keyframes rotate_90 /* Safari and Chrome */
{
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(90deg);
}
}
.popover-content button {
display: inline-block;
}
.position_re .position_ab {
position: absolute;
top: 90%;
left: 90%;
}
.img_auto_height_width {
height: 60px;
margin: 30px 0px;
}
.label-left{
float: left;
}
.border-show{
margin: 4px 0px;
font-size: 16px;
border-bottom: 1px solid ;
border-bottom-color: #ffb38c;
width: 90%;
text-align: left;
margin-left: 5%;
}
.service-background{
padding-top: 10px;
border: 2px solid #F06101;
margin: 21px 2%;
border-radius:10px;
text-align: center;
}
.service-info-button{
cursor:pointer;
height: 35px;
line-height: 35px;
width: 100% ;
text-align: center;
color: white;
}
</style>
<section class="content-header">
<h1>R Services</h1>
<ol class="breadcrumb">
<li class="active">R Services</li>
</ol>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning" ng-style="{'height':windowHeight}">
<div class="box-header" style="margin-top: 10px">
<!-- 已开通服务展示 -->
<div class="col-md-3 col-sm-3 col-xs-12" ng-repeat=" service in serviceAll">
<div class="service-background">
<img class="row img_auto_height_width" ng-src="{{service.logo_url}}">
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-left">Name</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6 label-left">
{{service.channel}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-left ">Mode</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6 label-left">
{{service.incremental_mode==1?'固定手续费':'固定金额扣款'}}
</div>
</div>
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-left ">{{service.incremental_mode==1?'Rate':'Amount'}}</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6 label-left">
{{service.incremental_mode==1?service.incremental_rate_value+'%':service.total_incremental_amount}}
</div>
</div>
<div class="row border-show" style="margin-bottom: 35px">
<div class="col-md-4 col-sm-4 col-xs-6 label-left">
<label class="label-left ">Status</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6">
<span ng-style="{'color':service.is_valid?'#00A65A':'#DD4B39'}">{{service.is_valid?'已启用':'未启用' }}</span>
</div>
</div>
<div class="row border-show" style="background-color: #F06101;margin: -5px 0px -1px 0px; border-radius: 2px 1px 8px 8px; width: 100%;margin-left: 0px" >
<a class="col-md-12 col-sm-12 col-xs-12 service-info-button"
title="点击查看交易详情" ui-sref="partnerIncrementalServiceInfo({channel:service.channel})">
查看详情
</a>
</div>
</div>
</div>
<!-- 未开通服务展示 -->
<div class="col-md-3 col-sm-3 col-xs-12" ng-repeat=" channel in channelOptions">
<div class="service-background">
<img class="row img_auto_height_width" ng-src="{{channel.logo_url}}">
<div class="row border-show">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-left">Name</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6 label-left">
{{channel.name}}
</div>
</div>
<div class="row border-show" style="margin-bottom: 20px">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="label-left ">Status</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6 label-left">
<span style="color:#DD4B39">未启用</span>
</div>
</div>
<div class="row border-show" style="height: 68px;margin: -10px 0px 20px 5%;padding-top: -10px" >
<div class="col-md-4 col-sm-4 col-xs-6 label-left">
<label class="label-left">Description</label>
</div>
<div class="col-md-8 col-sm-8 col-xs-6" style="font-size: 10px;line-height: 17px">
<span >一站式跨境进口电商SaaS平台帮您快速构建自己的品牌自营商城系统直达10亿+中国消费者,快速实现获客和交易变现。</span>
</div>
</div>
<div class="row border-show" style="background-color: #F06101;margin: -5px 0px -1px 0px; border-radius: 2px 1px 8px 8px; width: 100%;margin-left: 0px" >
<a target="_blank" class="col-md-12 col-sm-12 col-xs-12 service-info-button"
title="申请开通" ng-href="https://mch.royalpay.com.au/">
申请开通
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,426 @@
<style>
.cursor {
cursor: pointer;
}
.div-display {
display: none;
}
.i-rotate_90 {
animation: rotate_90 1s forwards;
-webkit-animation: rotate_90 1s forwards; /* Safari and Chrome */
}
@keyframes rotate_90 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(90deg);
}
}
@-webkit-keyframes rotate_90 /* Safari and Chrome */
{
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(90deg);
}
}
.popover-color {
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
color: black;
}
.popover-content button {
display: inline-block;
}
.position_re {
position: relative;
}
.position_re .position_ab {
position: absolute;
top: 90%;
left: 90%;
}
.box-icon_small {
width: 70px;
height: 70px;
font-size: 30px;
line-height: 70px
}
.info_box_bottom {
min-height: 70px;
margin-bottom: 0px
}
.box-content_left {
margin-left: 70px
}
.box-number_font {
font-size: 14px;
}
.line_height {
line-height: 14px
}
.line_height_ {
line-height: 22px;
}
</style>
<section class="content-header">
<h1>
<img height="40px" ng-src="{{serviceInfo.logo_url}}">
<span style="color:#F06101">{{serviceInfo.channel}}</span>
Service Info</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-comments-o"></i> Service List
</li>
<li class="active">{{serviceInfo.channel}} Service Info</li>
</ol>
</section>
<div class="content">
<div class="row" style="font-size: 18px">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-3">
<label>Mode:</label>
<span>{{serviceInfo.incremental_mode==1?'固定手续费':'固定金额扣款' }}</span>
</div>
<div class="col-sm-3">
<label>{{serviceInfo.incremental_mode==1?'Rate':'Amount'}}:</label>
<span>{{serviceInfo.incremental_mode==1?serviceInfo.incremental_rate_value+'%':serviceInfo.total_incremental_amount}}</span>
</div>
<div class="col-sm-3">
<label>Create Time:</label>
<span>{{serviceInfo.create_time }}</span>
</div>
<div class="col-sm-3">
<label>Status:</label>
<span ng-style="{'color':serviceInfo.is_valid?'#00A65A':'#DD4B39'}">{{serviceInfo.is_valid?'已启用':'未启用' }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="box box-warning">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<!--<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Source</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.source=='ALL'}"
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
</p>
</div>
</div>-->
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
ng-click="params.status='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
ng-click="params.status='PAID';loadTradeLogs(1)">Payment Success</a> |
<a role="button" ng-class="{'bg-primary':params.status=='ALL_REFUNDED'}"
ng-click="params.status='ALL_REFUNDED';loadTradeLogs(1)">All Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PARTIAL_REFUNDED'}"
ng-click="params.status='PARTIAL_REFUNDED';loadTradeLogs(1)">Partial Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='FULL_REFUNDED'}"
ng-click="params.status='FULL_REFUNDED';loadTradeLogs(1)">Full Refund</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Channel</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="params.channel='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='WECHAT'}"
ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAY'}"
ng-click="params.channel='ALIPAY';loadTradeLogs(1)">Alipay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAYONLINE'}"
ng-click="params.channel='ALIPAYONLINE';loadTradeLogs(1)">AlipayOnline</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='BESTPAY'}"
ng-click="params.channel='BESTPAY';loadTradeLogs(1)">BestPay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay+</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='YEEPAY'}"
ng-click="params.channel='YEEPAY';loadTradeLogs(1)">Yeepay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='LAKALAPAY'}"
ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">
<div class="form-control-static form-inline">
<div style="display: inline-block">
<input class="form-control" id="date-from-input"
ng-model="params.datefrom"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.dateto||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input"
ng-model="params.dateto"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.datefrom,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">Last 7 Days</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisMonth()">This Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">Last Month</a>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="currentUser.client.has_children">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isAll}" ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
|&nbsp;
<a role="button" ng-class="{'bg-primary':sub.client_id==chooseClientId}" ng-click="chooseClient(sub)">{{sub.short_name}}</a>
&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="level3Clients && showLevel3Clients">
<label class="control-label col-xs-4 col-sm-2">Sub-Partner of sub-partners</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isLevel3All}" ng-click="chooseLevel3Client('all')">All</a>
<label ng-repeat="sub in level3Clients">
|&nbsp;
<a role="button" ng-class="{'bg-primary':sub.client_id==chooseLevel3ClientId}" ng-click="chooseLevel3Client(sub)">{{sub.short_name}}</a>
&nbsp;
</label>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Transaction Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.paid_fee|currency:'AUD '"></span>
<span class="small">( {{analysis.order_count}} Orders )</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="!analysis.cny_display_amount">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Input Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span class="small"> ( {{analysis.pre_display_amount | currency:'pre authorization '}} )</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="analysis.cny_display_amount">
<div class="info-box info_box_bottom" ng-class="{'line_height':analysis.pre_display_amount||analysis.pre_cny_display_amount}">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text" >Input Amount</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;" ng-class="{line_height_:!analysis.pre_display_amount}"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span style="font-size: 10px;line-height: 10px" ng-if="analysis.pre_display_amount">
( {{analysis.pre_display_amount | currency:'pre authorization '}} )
</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;"
ng-if="analysis.cny_display_amount"
ng-bind="analysis.cny_display_amount|currency:'CNY '"></span>
<span style="font-size: 10px;line-height: 10px" ng-if="analysis.pre_cny_display_amount">
( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} )
</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-red box-icon_small"><i class="ion ion-android-warning"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Refund Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.refund_fee|currency:'AUD '"></span>
<span class=small" ng-if="analysis.pre_refund_fee">
({{analysis.pre_refund_fee|currency:'pre authorization '}})
</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-yellow box-icon_small"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Incremental Surcharge</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.incremental_surcharge|currency:'AUD '">
</span>
<span style="color: red" ng-if="analysis.refund_incremental_surcharge">({{analysis.all_incremental_surcharge}} - {{analysis.refund_incremental_surcharge}} = {{analysis.incremental_surcharge}}) </span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title" style="display: inherit">Orders</h3>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Client Order ID</th>
<th>Order ID</th>
<th>Amount</th>
<th>Input Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>Incremental Rate</th>
<th>Incremental Profit</th>
<th>Status</th>
<th>Create Time</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="trade in tradeLogs" ng-class="{warning:trade.clearing_status==2}">
<td ng-bind="trade.client_order_id||'NOT PROVIDED'"></td>
<td>
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="Alipay" alt="Alipay" ng-if="trade.channel=='Alipay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" alt="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png" uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
<img src="/static/images/yeepay_sign.png" uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png" uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id}}
</td>
<td>
{{trade.total_amount|currency:trade.currency+' '}}
<a ng-if="trade.refund_fee" class="text-danger" role="button">(-{{trade.refund_fee}})</a>
</td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td>{{(trade.surcharge_rate * 100 - trade.rate_value)| number : 2}}<span ng-if="trade.surcharge_rate">%</span></td>
<td>{{(trade.total_surcharge-trade.incremental_surcharge) | number : 2 | currency:trade.currency}}</td>
<td><span ng-if="trade.rate_value">{{trade.source}}:{{(trade.rate_value) | number : 2}}%</span></td>
<td>{{trade.source}}:<span ng-if="trade.incremental_surcharge">{{trade.incremental_surcharge | currency:trade.currency}}</span><span ng-if="!trade.incremental_surcharge">{{0.00 | currency:trade.currency}}</span></td>
<td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td>
<td>
<a role="button" class="text-bold" ng-click="showTradeDetail(trade)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="box-footer" ng-if="tradeLogs.length">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadTradeLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -11,7 +11,7 @@ define(['angular','decimal'], function (angular,decimal) {
controller: 'partnerInvoiceApp'
})
}]);
app.controller('partnerInvoiceApp', ['$scope', '$http','$filter', 'commonDialog', function ($scope, $http,$filter, commonDialog) {
app.controller('partnerInvoiceApp', ['$scope', '$http','$filter', 'commonDialog','$sce',function ($scope, $http,$filter, commonDialog, $sce) {
$scope.params = {channel:'ALL',clearing_status:-1,client_ids:[$scope.currentUser.client.client_id]};
$scope.today = new Date();
$scope.pagination = {};
@ -90,6 +90,7 @@ define(['angular','decimal'], function (angular,decimal) {
params.page = page || $scope.pagination.page || 1;
$http.get('/partner/invoice/trans_flow', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.htmlToolst();
$scope.tradeLogs.forEach(function (log) {
if(log.total_surcharge){
log.total_surcharge = decimal.add(log.total_surcharge,log.tax_amount).toFixed(2);
@ -136,6 +137,28 @@ define(['angular','decimal'], function (angular,decimal) {
return url;
}
$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
var tax_amount = $scope.tradeLogs[i].tax_amount;
var total_surcharge= $scope.tradeLogs[i].total_surcharge;
var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge;
var channel_surcharge = $scope.tradeLogs[i].channel_surcharge;
var royal_surcharge = $scope.tradeLogs[i].royal_surcharge;
var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2);
var channel = $scope.tradeLogs[i].source;
var tip = '<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>'+channel+':'+ incremental_surcharge +'</p>';
var a = royal_surcharge+incremental_surcharge+channel_surcharge+tax_amount;
if(total_surcharge <= (royal_surcharge+incremental_surcharge+channel_surcharge+tax_amount)){
tip = tip +'<p>tax amount:'+ tax_amount +'</p>';
}
tip = tip + '</div>';
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip);
}
};
}]);
return app;
});
});

@ -194,6 +194,10 @@
<tr ng-repeat="trade in tradeLogs" ng-class="{'tr_refund':trade.trans_type=='refund','tr_clearing':trade.trans_type=='clearing'}">
<td ng-bind="trade.transaction_time||'NOT PROVIDED'"></td>
<td>
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png"
@ -208,7 +212,7 @@
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id2}}
{{trade.order_id2}}<span ng-if="trade.source!='system'"><i class="fa fa-question-circle-o" uib-tooltip-html="trade.htmlTooltip"></i></span>
</td>
<td ng-bind="trade.currency"></td>
<td ng-bind="trade.display_amount"></td>
@ -265,4 +269,4 @@
</div>
</div>
</div>
</div>
</div>

@ -197,6 +197,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
url: '/permission_client',
templateUrl: 'static/payment/partner/templates/partner_permission.html',
controller: 'permissionClientCtrl'
}).state('partners.detail.incremental_service', {
url: '/incremental_service',
templateUrl: 'static/payment/partner/templates/incremental_service.html',
controller: 'incrementalServiceCtrl'
});
}]);
app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
@ -5186,6 +5190,123 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
}]);
app.controller('incrementalServiceCtrl',['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog',function($scope, $http, $uibModal, $state, $filter, commonDialog){
$scope.serviceAll = {};
$scope.channelOptions=[];
$scope.initData = function(){
$http.get('/sys/partners/' + $scope.partner.client_moniker+'/incremental_service').then(function(res){
$scope.serviceAll = res.data.all_service;
$scope.serviceAll.forEach(function(service){
service.logo_url = '/static/images/'+service.channel+'.jpg'
})
$scope.channelOptions=res.data.incremental_channel;
})
}
$scope.initData();
$scope.newServiceChannelDialog = function (){
$uibModal.open({
templateUrl: '/static/payment/partner/templates/incremental_service_dialog.html',
controller: 'incrementalServiceDialogCtrl',
resolve: {
params: function(){
return {
isCreate:true,
clientMoniker:$scope.partner.client_moniker,
channelOptions:$scope.channelOptions,
serviceChannel:null
}
}
}
}).result.then(function () {
$scope.initData();
});
}
$scope.editServiceChannelDialog = function (serviceChannel){
$uibModal.open({
templateUrl: '/static/payment/partner/templates/incremental_service_dialog.html',
controller: 'incrementalServiceDialogCtrl',
resolve: {
params: function(){
return {
isCreate:false,
clientMoniker:$scope.partner.client_moniker,
channelOptions:$scope.channelOptions,
serviceChannel:serviceChannel
}
}
}
}).result.then(function () {
$scope.initData();
});
}
$scope.updateStatus = function(service){
commonDialog.confirm({
title: 'Update '+service.channel+ ' Incremental Service Status',
content: 'Are you sure update ' + service.channel + ' status',
choises: [
{label: 'Submit', className: 'btn-success', key: 1},
{label: 'Cancel', className: 'btn-warning', key: 0, dismiss: true}
]
}).then(function (choice) {
if (choice == 1) {
service.is_valid = !service.is_valid;
$http.put('/sys/partners/'+$scope.partner.client_moniker+'/incremental_service/status',service).then(function(res){
commonDialog.alert({
title: 'Success',
content: 'Update Service Successful!',
type: 'success'
});
$scope.initData();
},function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
$scope.initData();
})
}
})
}
}]);
app.controller('incrementalServiceDialogCtrl',['$scope','$http','params','commonDialog',function($scope ,$http,params,commonDialog){
$scope.model ={};
$scope.ctrl = {sending: false};
$scope.isCreate = true;
$scope.initData =function(){
$scope.isCreate = angular.copy(params.isCreate);
if($scope.isCreate ){
$scope.model.incremental_mode = "1"
$scope.model.channel= angular.copy(params.channelOptions[0])
$scope.model.channelOptions= angular.copy(params.channelOptions)
}else{
$scope.model = angular.copy(params.serviceChannel);
$scope.model.incremental_mode = $scope.model.incremental_mode.toString()
}
}
$scope.initData();
$scope.save = function(form){
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$scope.ctrl.sending = true;
$http.post('/sys/partners/'+params.clientMoniker+'/incremental_service',$scope.model).then(function(res){
commonDialog.alert({
title: 'Success',
content: $scope.isCreate?'Create Service Successful!':'Update Service Successful!',
type: 'success'
});
$scope.ctrl.sending = false;
$scope.$close();
},function (resp) {
$scope.ctrl.sending = false;
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
}])
app.filter('bdOrg', function () {

@ -0,0 +1,38 @@
<div class="row">
<div class="col-sm-12">
<div class="table-responsive col-sm-12">
<button class="btn btn-success" role="button" ng-if="channelOptions.length>0" ng-click="newServiceChannelDialog()" style="margin: 5px">新增增值服务</button>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Logo</th>
<th>Channel</th>
<th>Mode</th>
<th>Rate Value</th>
<th>Amount</th>
<th>Operator</th>
<th>Create Time</th>
<th>Update Time</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="service in serviceAll">
<td style="max-width: 160px;line-height: 90px"><img style=" height:80px; max-width: 180px;"ng-src="{{service.logo_url}}"/></td>
<td style="line-height: 90px">{{service.channel}}</td>
<td style="line-height: 90px">{{service.incremental_mode==1?'固定手续费':'固定金额扣款' }}</td>
<td style="line-height: 90px">{{service.incremental_rate_value!=null?service.incremental_rate_value+'%':'-'}}</td>
<td style="line-height: 90px">{{service.total_incremental_amount}}</td>
<td style="line-height: 90px">{{service.operator}}</td>
<td style="line-height: 90px">{{service.create_time}}</td>
<td style="line-height: 90px">{{service.update_time}}</td>
<td style="line-height: 90px">
<a role="button" ng-click="editServiceChannelDialog(service)" ng-if="'011'|withRole"><i class="fa fa-edit"></i></a> |
<a role="button" ng-click="updateStatus(service)">{{service.is_valid?'禁用':'启用'}}</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

@ -0,0 +1,72 @@
<div class="modal-header">
<h4>{{isCreate?"New":"Edit"}} Service</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="row">
<div class="col-sm-12">
<form novalidate name="service_form" class="form-horizontal">
<div class="form-group has-feedback" ng-if="isCreate"
ng-class="{'has-error':service_form.channel.$invalid && service_form.channel.$dirty}">
<label class="control-label col-sm-4">Service Channel:</label>
<div class="col-sm-6">
<select class="form-control" name="channel" id="channel-input" required
ng-model="model.channel"
ng-options="channel for channel in model.channelOptions">
</select>
<span ng-messages="service_form.channel.$error" ng-if="service_form.channel.$dirty" ng-message="required">Required Field</span>
</div>
</div>
<div class="form-group has-feedback"
ng-class="{'has-error':service_form.incremental_mode.$invalid && service_form.incremental_mode.$dirty}">
<label class="control-label col-sm-4">Mode:</label>
<div class="col-sm-6">
<select class="form-control" name="incrementalMode" id="incrementalMode-input" required
ng-model="model.incremental_mode">
<option value="1">固定手续费</option>
<option value="2">固定金额扣款</option>
</select>
<span ng-messages="service_form.incremental_mode.$error" ng-if="service_form.incremental_mode.$dirty" ng-message="required">Required Field</span>
</div>
</div>
<div class="form-group has-feedback" ng-if="model.incremental_mode==1" ng-class="{'has-error':service_form.incremental_rate_value.$invalid && service_form.incremental_rate_value.$dirty}">
<label class="control-label col-sm-4" style="text-align: right">Rate Value:</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="incremental_rate_value" stringToNumber2 class="form-control" ng-model="model.incremental_rate_value" max="100" min="0" step="0" id="incremental_rate_value" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="service_form.incremental_rate_value.$error" ng-if="service_form.incremental_rate_value.$dirty">
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0%
</div>
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No less than 100%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group has-feedback" ng-if="model.incremental_mode==2" ng-class="{'has-error':service_form.total_incremental_amount.$invalid && service_form.total_incremental_amount.$dirty}">
<label class="control-label col-sm-4" style="text-align: right">Amount:</label>
<div class="col-sm-6">
<input type="number" name="total_incremental_amount" stringToNumber2 class="form-control" ng-model="model.total_incremental_amount"
min="0" maxlength="20" id="total_incremental_amount" required>
<div ng-messages="service_form.total_incremental_amount.$error" ng-if="service_form.total_incremental_amount.$dirty">
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="save(service_form)" ng-disabled="ctrl.sending">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>

@ -295,6 +295,9 @@
<li ui-sref-active="active" ng-if="partner.is_valid==1">
<a ui-sref=".permission_client">Permissions</a>
</li>
<li ui-sref-active="active" ng-if="partner.is_valid==1">
<a ui-sref=".incremental_service">R Services</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">

@ -311,6 +311,10 @@
<tr ng-repeat="trade in tradeLogs" ng-class="{'tr_refund':trade.trans_type=='refund','tr_clearing':trade.trans_type=='clearing',warning:trade.clearing_status==2}">
<td ng-bind="trade.transaction_time||'NOT PROVIDED'"></td>
<td>
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png"
@ -331,7 +335,7 @@
uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png"
uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id2}}
{{trade.order_id2}}<span ng-if="trade.source!='system'"><i class="fa fa-question-circle-o" uib-tooltip-html="trade.htmlTooltip"></i></span>
</td>
<td ng-bind="trade.currency"></td>
<td ng-bind="trade.display_amount"></td>

@ -0,0 +1,436 @@
<style>
.box-icon_small {
width: 70px;
height: 70px;
font-size: 30px;
line-height: 70px
}
.info_box_bottom {
min-height: 70px;
margin-bottom: 0px
}
.box-content_left {
margin-left: 70px
}
.box-number_font {
font-size: 14px
}
.line_height {
line-height: 14px
}
.line_height_ {
line-height: 22px;
}
.col-xs-1-5,
.col-sm-1-5,
.col-md-1-5,
.col-lg-1-5 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-1-5 {
width: 20%;
float: left;
}
@media (min-width: 768px) {
.col-sm-1-5 {
width: 20%;
float: left;
}
}
@media (min-width: 992px) {
.col-md-1-5 {
width: 20%;
float: left;
}
}
@media (min-width: 1200px) {
.col-lg-1-5 {
width: 20%;
float: left;
}
}
</style>
<section class="content-header">
<h1>Trade Logs</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-list-alt"></i> Transaction
</li>
<li class="active">Trade Logs</li>
</ol>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
<label class="col-xs-4 col-sm-2">
<select class="form-control" ng-model="params.textType">
<option value="all">ALL</option>
<option value="client_moniker">Partner Code</option>
<option value="client_name">Partner Name</option>
<option value="sys_trans_id">Platform Transaction ID</option>
<option value="channel">Channel</option>
<option value="order_id">Order ID</option>
<option value="remark">Remark</option>
</select>
</label>
<div class="col-sm-4 col-xs-8">
<input class="form-control" placeholder="Keyword"
ng-enter="loadTradeLogs(1)"
ng-model="params.searchText">
</div>
<div class="col-sm-6 col-xs-8">
<div ng-if="orgs" class="col-sm-6">
<select id="org-clild" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.type for org in orgs"
ng-change="params.org_id2 = '';loadOrgs();loadTradeLogs(1)">
<option value="">ALL Organizations</option>
</select>
</div>
<div ng-if="((orgs_child.length > 1) && ('1000011'|withRole))&&params.org_id || ((orgs_child.length > 0) && ('1000000000000'|withRole))"
class="col-sm-6">
<select id="org-select" class="form-control" ng-model="params.org_id2"
ng-options="org.org_id as org.name group by org.org_type for org in orgs_child"
ng-change="loadTradeLogs(1)">
<option value="">{{org2}}</option>
</select>
</div>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
ng-click="params.status='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
ng-click="params.status='PAID';loadTradeLogs(1)">Payment Success</a>
|
<a role="button" ng-class="{'bg-primary':params.status=='ALL_REFUNDED'}"
ng-click="params.status='ALL_REFUNDED';loadTradeLogs(1)">All
Refund</a> |
<a role="button"
ng-class="{'bg-primary':params.status=='PARTIAL_REFUNDED'}"
ng-click="params.status='PARTIAL_REFUNDED';loadTradeLogs(1)">Partial
Refund</a> |
<a role="button"
ng-class="{'bg-primary':params.status=='FULL_REFUNDED'}"
ng-click="params.status='FULL_REFUNDED';loadTradeLogs(1)">Full
Refund</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Channel</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="params.channel='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='WECHAT'}"
ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAY'}"
ng-click="params.channel='ALIPAY';loadTradeLogs(1)">Alipay</a> |
<a role="button"
ng-class="{'bg-primary':params.channel=='ALIPAYONLINE'}"
ng-click="params.channel='ALIPAYONLINE';loadTradeLogs(1)">AlipayOnline</a>
|
<a role="button" ng-class="{'bg-primary':params.channel=='BESTPAY'}"
ng-click="params.channel='BESTPAY';loadTradeLogs(1)">BestPay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay +</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='YEEPAY'}"
ng-click="params.channel='YEEPAY';loadTradeLogs(1)">Yeepay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='LAKALAPAY'}"
ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">
<div class="form-control-static form-inline">
<div style="display: inline-block">
<input class="form-control" id="date-from-input"
ng-model="params.datefrom"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.dateto||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input"
ng-model="params.dateto"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.datefrom,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">Last 7 Days</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisMonth()">This Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">Last Month</a>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="'1000000000'|withRole">
<label class="control-label col-xs-4 col-sm-2">My Group</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isAll}"
ng-click="chooseBD('all')">All</a>
<label ng-repeat="sub in bd_group_bds">
|&nbsp;<a role="button"
ng-class="{'bg-primary':sub.manager_id==chooseBDId}"
ng-click="chooseBD(sub.manager_id)">{{sub.bd_name}}</a>&nbsp;
</label>
</p>
</div>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<div class="row">
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i
class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Transaction Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.paid_fee|currency:'AUD'"></span>
<span class="small">( {{analysis.order_count}} Orders )</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12" ng-if="!analysis.cny_display_amount">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i
class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Input Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span class="small"> ( {{analysis.pre_display_amount | currency:'pre authorization '}} )</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12" ng-if="analysis.cny_display_amount">
<div class="info-box info_box_bottom"
ng-class="{'line_height':analysis.pre_display_amount||analysis.pre_cny_display_amount}">
<span class="info-box-icon bg-aqua box-icon_small"><i
class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Input Amount</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;"
ng-class="{line_height_:!analysis.pre_display_amount}"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span style="font-size: 8px;line-height: 8px"
ng-if="analysis.pre_display_amount">
( {{analysis.pre_display_amount | currency:'pre authorization '}} )
</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;"
ng-if="analysis.cny_display_amount"
ng-bind="analysis.cny_display_amount|currency:'CNY '"></span>
<span style="font-size: 8px;line-height: 8px"
ng-if="analysis.pre_cny_display_amount">
( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} )
</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-red box-icon_small"><i
class="ion ion-android-warning"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Refund Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.refund_fee|currency:'AUD '"></span>
<span class=small" ng-if="analysis.pre_refund_fee">
({{analysis.pre_refund_fee|currency:'pre authorization '}})
</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-yellow box-icon_small"><i
class="ion ion-ios-people"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Merchants</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.clients"></span>
</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-yellow box-icon_small"><i
class="ion ion-ios-people"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Incremental Surcharge</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.incremental_surcharge|currency:'AUD '"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title" style="display: inherit">Trade Orders
<span style="float: right;font-size: 14px;">Pre Authorization:<i class="fa fa-stop"
aria-hidden="true"
style="color: #fff2a5"></i></span>
</h3>
<a hidden class="pull-right text-bold" ng-if="'manual_refund_check'|withFunc" role="button"
ng-click="confirmOrders()">Manual Confirm Orders</a>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Partner</th>
<th>Order ID</th>
<th>Amount</th>
<th>Input Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>R跨境商城 Rate</th>
<th>R跨境商城 Profit</th>
<th>Status</th>
<th>Create Time</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="trade in tradeLogs" ng-class="{warning:trade.clearing_status==2}">
<td>
<a role="button" ui-sref="partners.detail({clientMoniker:trade.client_moniker})">
{{trade.short_name}}({{trade.client_moniker}})
</a>
</td>
<td>
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="WechatPay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/bestpay_sign.png"
uib-tooltip="BestPay" ng-if="trade.channel=='Bestpay'"/>
<img src="/static/images/alipay_sign.png"
uib-tooltip="Alipay" ng-if="trade.channel=='Alipay'"/>
<img src="/static/images/alipay_sign.png"
uib-tooltip="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png"
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="Royal Pay" ng-if="trade.channel=='Rpay'"/>
<img src="/static/images/yeepay_sign.png"
uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png"
uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id}}
</td>
<td>
{{trade.total_amount|currency:trade.currency}}
<a ng-if="trade.refund_fee" class="text-danger" role="button"
ng-click="showRefundLog(trade.order_id)">(-{{trade.refund_fee}})</a>
</td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td><span ng-if="trade.surcharge_rate">{{(trade.surcharge_rate * 100 - trade.rate_value)| number : 2}}%</span></td>
<td>{{(trade.total_surcharge-trade.incremental_surcharge) | number : 2 | currency:trade.currency}}</td>
<td><span ng-if="trade.rate_value">{{trade.source}}:{{(trade.rate_value) | number : 2}}%</span></td>
<td><span ng-if="trade.incremental_surcharge">{{trade.source}}:{{trade.incremental_surcharge | currency:trade.currency}}</span></td>
<td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td>
<td>
<a role="button" class="text-bold" ng-click="showTradeDetail(trade)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body" ng-if="tradeLogs.length">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadTradeLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
Pages:{{pagination.totalPages}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,388 @@
<style>
.cursor {
cursor: pointer;
}
.div-display {
display: none;
}
.i-rotate_90 {
animation: rotate_90 1s forwards;
-webkit-animation: rotate_90 1s forwards; /* Safari and Chrome */
}
@keyframes rotate_90 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(90deg);
}
}
@-webkit-keyframes rotate_90 /* Safari and Chrome */
{
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(90deg);
}
}
.popover-color{
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
color: black;
}
.popover-content button{
display: inline-block;
}
.position_re{
position: relative;
}
.position_re .position_ab{
position: absolute;
top: 90%;
left: 90%;
}
.box-icon_small{
width: 70px;
height: 70px;
font-size: 30px;
line-height: 70px
}
.info_box_bottom{
min-height:70px;
margin-bottom:0px
}
.box-content_left{
margin-left:70px
}
.box-number_font{
font-size:14px;
}
.line_height{
line-height: 14px
}
.line_height_{
line-height: 22px;
}
</style>
<section class="content-header">
<h1>Incremental Orders</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-comments-o"></i> Payment
</li>
<li class="active">Incremental Orders</li>
</ol>
</section>
<div class="content">
<div class="callout callout-info" ng-repeat="order in alerts">
<h4><span style="font-size: 22px">{{order.display_amount|currency:order.currency+' '}}</span> Paid
Success!</h4>
<p>Pay Time:{{order.pay_time_local}}</p>
</div>
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<!--<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Source</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.source=='ALL'}"
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
</p>
</div>
</div>-->
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
ng-click="params.status='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
ng-click="params.status='PAID';loadTradeLogs(1)">Payment Success</a> |
<a role="button" ng-class="{'bg-primary':params.status=='ALL_REFUNDED'}"
ng-click="params.status='ALL_REFUNDED';loadTradeLogs(1)">All Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PARTIAL_REFUNDED'}"
ng-click="params.status='PARTIAL_REFUNDED';loadTradeLogs(1)">Partial Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='FULL_REFUNDED'}"
ng-click="params.status='FULL_REFUNDED';loadTradeLogs(1)">Full Refund</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Channel</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="params.channel='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='WECHAT'}"
ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAY'}"
ng-click="params.channel='ALIPAY';loadTradeLogs(1)">Alipay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAYONLINE'}"
ng-click="params.channel='ALIPAYONLINE';loadTradeLogs(1)">AlipayOnline</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='BESTPAY'}"
ng-click="params.channel='BESTPAY';loadTradeLogs(1)">BestPay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay+</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='YEEPAY'}"
ng-click="params.channel='YEEPAY';loadTradeLogs(1)">Yeepay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='LAKALAPAY'}"
ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">
<div class="form-control-static form-inline">
<div style="display: inline-block">
<input class="form-control" id="date-from-input"
ng-model="params.datefrom"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.dateto||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input"
ng-model="params.dateto"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.datefrom,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">Last 7 Days</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisMonth()">This Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">Last Month</a>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="currentUser.client.has_children">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isAll}" ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
|&nbsp;
<a role="button" ng-class="{'bg-primary':sub.client_id==chooseClientId}" ng-click="chooseClient(sub)">{{sub.short_name}}</a>
&nbsp;
</label>
</p>
</div>
</div>
<div class="form-group col-xs-12" ng-if="level3Clients && showLevel3Clients">
<label class="control-label col-xs-4 col-sm-2">Sub-Partner of sub-partners</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isLevel3All}" ng-click="chooseLevel3Client('all')">All</a>
<label ng-repeat="sub in level3Clients">
|&nbsp;
<a role="button" ng-class="{'bg-primary':sub.client_id==chooseLevel3ClientId}" ng-click="chooseLevel3Client(sub)">{{sub.short_name}}</a>
&nbsp;
</label>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Transaction Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.paid_fee|currency:'AUD '"></span>
<span class="small">( {{analysis.order_count}} Orders )</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="!analysis.cny_display_amount">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Input Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span class="small"> ( {{analysis.pre_display_amount | currency:'pre authorization '}} )</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="analysis.cny_display_amount">
<div class="info-box info_box_bottom" ng-class="{'line_height':analysis.pre_display_amount||analysis.pre_cny_display_amount}">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text" >Input Amount</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;" ng-class="{line_height_:!analysis.pre_display_amount}"
ng-bind="analysis.display_amount|currency:'AUD '"></span>
<span style="font-size: 10px;line-height: 10px" ng-if="analysis.pre_display_amount">
( {{analysis.pre_display_amount | currency:'pre authorization '}} )
</span>
<span class="info-box-number box-number_font" style="margin-bottom: -3px;"
ng-if="analysis.cny_display_amount"
ng-bind="analysis.cny_display_amount|currency:'CNY '"></span>
<span style="font-size: 10px;line-height: 10px" ng-if="analysis.pre_cny_display_amount">
( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} )
</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-red box-icon_small"><i class="ion ion-android-warning"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Refund Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.refund_fee|currency:'AUD '"></span>
<span class=small" ng-if="analysis.pre_refund_fee">
({{analysis.pre_refund_fee|currency:'pre authorization '}})
</span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-yellow box-icon_small"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Incremental Surcharge</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.incremental_surcharge|currency:'AUD '">
</span>
<span style="color: red" ng-if="analysis.refund_incremental_surcharge">({{analysis.all_incremental_surcharge}} - {{analysis.refund_incremental_surcharge}} = {{analysis.incremental_surcharge}}) </span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title" style="display: inherit">Orders</h3>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Client Order ID</th>
<th>Order ID</th>
<th>Amount</th>
<th>Input Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>Incremental Rate</th>
<th>Incremental Profit</th>
<th>Status</th>
<th>Create Time</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="trade in tradeLogs" ng-class="{warning:trade.clearing_status==2}">
<td ng-bind="trade.client_order_id||'NOT PROVIDED'"></td>
<td>
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="Alipay" alt="Alipay" ng-if="trade.channel=='Alipay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" alt="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png" uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
<img src="/static/images/yeepay_sign.png" uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png" uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id}}
</td>
<td>
{{trade.total_amount|currency:trade.currency+' '}}
<a ng-if="trade.refund_fee" class="text-danger" role="button">(-{{trade.refund_fee}})</a>
</td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td>{{(trade.surcharge_rate * 100 - trade.rate_value)| number : 2}}<span ng-if="trade.surcharge_rate">%</span></td>
<td>{{(trade.total_surcharge-trade.incremental_surcharge) | number : 2 | currency:trade.currency}}</td>
<td><span ng-if="trade.rate_value">{{trade.source}}:{{(trade.rate_value) | number : 2}}%</span></td>
<td>{{trade.source}}:<span ng-if="trade.incremental_surcharge">{{trade.incremental_surcharge | currency:trade.currency}}</span><span ng-if="!trade.incremental_surcharge">{{0.00 | currency:trade.currency}}</span></td>
<td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td>
<td>
<a role="button" class="text-bold" ng-click="showTradeDetail(trade)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="box-footer" ng-if="tradeLogs.length">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadTradeLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -205,8 +205,12 @@
<th>Currency</th>
<th>Input Amount</th>
<th>Total Amount</th>
<th>Surcharge Rate</th>
<!--<th>Surcharge Rate</th>-->
<th>Surcharge Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>Incremental Rate</th>
<th>Incremental Profit</th>
<th>Tax Amount</th>
<th ng-if="report.report[0].settle_amount!=null">Settle Amount</th>
<th>Remark</th>
@ -215,14 +219,20 @@
<tbody>
<tr ng-repeat="tr in report.report|propsFilter:{transaction_type:'Credit',channel:ctrl.channel,transaction_time:ctrl.day}:true">
<td>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="tr.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="tr.source=='R跨境商城'"/>
<img class="channel-icon" ng-src="{{tr.channel|channel_image}}">{{tr.order_id}}
</td>
<td ng-bind="tr.transaction_time"></td>
<td ng-bind="tr.transaction_currency"></td>
<td ng-bind="tr.display_amount"></td>
<td ng-bind="tr.transaction_amount"></td>
<td ng-bind="tr.surcharge_rate?(tr.surcharge_rate|percentage:1):report.channels[tr.channel].rate+'%'"></td>
<!--<td ng-bind="tr.surcharge_rate?(tr.surcharge_rate|percentage:1):report.channels[tr.channel].rate+'%'"></td>-->
<td ng-bind="tr.total_surcharge?tr.total_surcharge:0"></td>
<td>{{(tr.surcharge_rate * 100 - tr.rate_value)| number : 2}}<span ng-if="tr.surcharge_rate">%</span></td>
<td>{{(tr.total_surcharge-tr.incremental_surcharge) | number : 2 | currency:tr.currency}}</td>
<td><span ng-if="tr.rate_value">{{tr.source}}:{{(tr.rate_value) | number : 2}}%</span></td>
<td>{{tr.source}}:<span ng-if="tr.incremental_surcharge">{{tr.incremental_surcharge | currency:tr.currency}}</span><span ng-if="!tr.incremental_surcharge">{{0.00 | currency:tr.currency}}</span></td>
<td ng-bind="tr.tax_amount"></td>
<td ng-if="tr.settle_amount!=null" ng-bind="tr.settle_amount|currency:''"></td>
<td ng-bind="tr.remark"></td>

@ -109,6 +109,19 @@
ng-model="params.searchText">
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Source</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.source=='ALL'}"
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
@ -406,6 +419,8 @@
<td>
<img src="/static/images/clearing-icon.png" uib-tooltip="clearing" ng-if="trade.clearing_status=='1'"/>
<i class="fa fa-check-circle-o text-danger" uib-tooltip="Refund Audition Required" ng-if="trade.audition"></i>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Wechat Pay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" alt="BestPay" ng-if="trade.channel=='Bestpay'"/>
@ -416,7 +431,7 @@
<img src="/static/images/rpayplus_sign.png" uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
<img src="/static/images/yeepay_sign.png" uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png" uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id}}
{{trade.order_id}}<span ng-if="trade.source!='system'"><i class="fa fa-question-circle-o" uib-tooltip-html="trade.htmlTooltip"></i></span>
</td>
<td>
{{trade.total_amount|currency:trade.currency+' '}}

@ -142,6 +142,19 @@
</div>
</div>-->
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Source</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.source=='ALL'}"
ng-click="params.source='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.source=='system'}"
ng-click="params.source='system';loadTradeLogs(1)">System</a> |
<a role="button" ng-class="{'bg-primary':params.source=='R跨境商城'}"
ng-click="params.source='R跨境商城';loadTradeLogs(1)">R跨境商城</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
@ -449,6 +462,10 @@
</a>
</td>
<td>
<img src="/static/images/royalpay_sign_s.png"
uib-tooltip="RoyalPay" ng-if="trade.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png"
uib-tooltip="R跨境商城" ng-if="trade.source=='R跨境商城'"/>
<img src="/static/images/wechatpay_sign.png"
uib-tooltip="WechatPay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/wechatpay_sign.png"
@ -469,7 +486,7 @@
uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
<img src="/static/images/lakalapay_sign.png"
uib-tooltip="LakalaPay" ng-if="trade.channel=='LakalaPay'"/>
{{trade.order_id}}
{{trade.order_id}}<span ng-if="trade.source!='system'"><i class="fa fa-question-circle-o" uib-tooltip-html="trade.htmlTooltip"></i></span>
</td>
<td>
{{trade.total_amount|currency:trade.currency}}

@ -13,11 +13,15 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url: '/refundReview',
templateUrl: '/static/payment/tradelog/templates/refund_review.html',
controller: 'refundReviewCtrl'
}).state('incremental_trade', {
url: '/incrementalTrade',
templateUrl: '/static/payment/tradelog/templates/incremental_trade_logs.html',
controller: 'globalIncrementalTradeLogCtrl'
})
}]);
app.controller('globalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService',
function ($scope, $http, $filter, commonDialog, refunder, orderService) {
$scope.params = {status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'};
app.controller('globalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService','$sce',
function ($scope, $http, $filter, commonDialog, refunder, orderService,$sce) {
$scope.params = {source: 'ALL',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'};
$scope.pagination = {};
$scope.today = new Date();
@ -127,6 +131,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
$http.get('/sys/trade_logs', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.htmlToolst();
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
@ -167,6 +172,30 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.$on('order_refunded', function () {
$scope.loadTradeLogs();
});
$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
var tax_amount = $scope.tradeLogs[i].tax_amount;
var total_surcharge= $scope.tradeLogs[i].total_surcharge;
var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge;
var total_amount = $scope.tradeLogs[i].total_amount;
var display_amount = $scope.tradeLogs[i].display_amount;
var source = $scope.tradeLogs[i].source;
var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2);
var tip = '<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>'+ source +':'+incremental_surcharge +'</p>';
if(total_surcharge < (total_amount-display_amount).toFixed(2)){
tip = tip +'<p>tax amount:'+ tax_amount +'</p>';
}
tip = tip + '</div>';
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip);
}
}
}
]);
app.controller('refundReviewCtrl', ['$rootScope', '$scope', '$http', '$state', '$filter', '$uibModal', 'commonDialog', 'orderService',
@ -295,6 +324,134 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
});
};
}]);
app.controller('globalIncrementalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService','$sce',
function ($scope, $http, $filter, commonDialog, refunder, orderService,$sce) {
$scope.params = {source: 'R跨境商城',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'};
$scope.pagination = {};
$scope.today = new Date();
if (($scope.currentUser.role & parseInt('1000000000', 2)) > 0 && $scope.currentUser.org_id) {
$http.get('/sys/manager_accounts/group/group_bds').then(function (resp) {
$scope.bd_group_bds = resp.data;
$scope.chooseBD('all');
});
}
$scope.chooseBD = function (groupBD) {
$scope.params.onlyGroup=true;
if (groupBD == 'all') {
$scope.isAll = true;
$scope.chooseBDId='';
delete $scope.params.group_bd;
} else {
$scope.chooseBDId=groupBD;
$scope.params.group_bd = groupBD;
$scope.isAll = false;
}
$scope.loadTradeLogs();
};
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
$scope.loadTradeLogs(1);
};
$scope.chooseYesterday = function () {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
$scope.params.datefrom = $scope.params.dateto = yesterday;
$scope.loadTradeLogs(1);
};
$scope.chooseLast7Days = function () {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.loadTradeLogs(1);
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
var monthBegin = new Date();
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.lastMonth = function () {
var monthFinish = new Date();
monthFinish.setDate(0);
$scope.params.dateto = monthFinish;
var monthBegin = new Date();
monthBegin.setDate(0);
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) {
$scope.org2 = "ALL"
$http.get('/sys/orgs', {params: {}}).then(function (resp) {
$scope.orgs = resp.data;
});
}
$scope.loadOrgs = function () {
var params = angular.copy($scope.params);
$http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) {
$scope.orgs_child = resp.data;
})
};
if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && ($scope.currentUser.org_id != null)){
$scope.org2 = "ALL Organizations"
$scope.loadOrgs();
}
$scope.loadTradeLogs = function (page) {
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
params.page = page || $scope.pagination.page || 1;
if(params.gateway){
if((params.gateway.sort().toString()!=[0,1].toString()) && (params.gateway.sort().toString()!=[5,6].toString())){
delete params.gatewayChilds;
delete params.gatewayChild;
}
if(params.gatewayChilds){
var exist = false
params.gatewayChilds.forEach(function (child) {
if(child==params.gatewayChild){
exist = true
}
})
if(!exist){
params.gatewayChild = null
}
}else{
delete params.gatewayChild;
}
}else{
delete params.gatewayChilds;
delete params.gatewayChild;
}
$http.get('/sys/trade_logs/incremental', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.showTradeDetail = function (order) {
orderService.managerOrderDetail(order)
};
$scope.loadTradeLogs(1);
$scope.$on('order_refunded', function () {
$scope.loadTradeLogs();
});
}
]);
return app;
});

@ -10,11 +10,15 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
url: '/trade',
templateUrl: '/static/payment/tradelog/templates/partner_trade_logs.html',
controller: 'tradeLogCtrl'
}).state('incremental_trade', {
url: '/IncrementalTrade',
templateUrl: '/static/payment/tradelog/templates/partner_incremental_trade_logs.html',
controller: 'IncrementalTradeLogCtrl'
})
}]);
app.controller('tradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog',
function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog) {
$scope.params = {status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
app.controller('tradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog','$sce',
function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog,$sce) {
$scope.params = {source: 'ALL',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
$scope.pagination = {};
$scope.today = new Date();
$scope.isAll = true;
@ -92,12 +96,49 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
$http.get('/client/partner_info/trade_logs', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.htmlToolst();
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
/*$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
var tax_amount = $scope.tradeLogs[i].tax_amount;
var total_surcharge= $scope.tradeLogs[i].total_surcharge;
var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge;
var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2);
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml('<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>R跨境商城:'+ incremental_surcharge +'</p>' +
'<p>tax amount:'+ tax_amount +'</p>' +
'</div>');
}
};*/
$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
var tax_amount = $scope.tradeLogs[i].tax_amount;
var total_surcharge= $scope.tradeLogs[i].total_surcharge;
var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge;
var total_amount = $scope.tradeLogs[i].total_amount;
var display_amount = $scope.tradeLogs[i].display_amount;
var source = $scope.tradeLogs[i].source;
var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2);
var tip = '<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>'+ source +':'+incremental_surcharge +'</p>';
if(total_surcharge < (total_amount-display_amount).toFixed(2)){
tip = tip +'<p>tax amount:'+ tax_amount +'</p>';
}
tip = tip + '</div>';
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip);
}
}
$scope.gatewaySelected = function (arr) {
return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) {
return arr.indexOf(gateway) >= 0
@ -254,5 +295,221 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}
}]);
app.controller('IncrementalTradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog',
function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog) {
$scope.params = {source: 'R跨境商城',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
$scope.pagination = {};
$scope.today = new Date();
$scope.isAll = true;
$scope.isLevel3All = true;
$scope.device_isAll = true;
$scope.dev_params = {client_type:'sunmi',limit:100};
$scope.clients = [$scope.currentUser.client];
$scope.showLevel3Clients = false;
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
$scope.loadTradeLogs(1);
};
$scope.chooseYesterday = function () {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
$scope.params.datefrom = $scope.params.dateto = yesterday;
$scope.loadTradeLogs(1);
};
$scope.chooseLast7Days = function () {
$scope.params.dateto = new Date();
var day = new Date();
day.setDate(day.getDate() - 7);
$scope.params.datefrom = day;
$scope.loadTradeLogs(1);
};
$scope.thisMonth = function () {
$scope.params.dateto = new Date();
var monthBegin = new Date();
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.lastMonth = function () {
var monthFinish = new Date();
monthFinish.setDate(0);
$scope.params.dateto = monthFinish;
var monthBegin = new Date();
monthBegin.setDate(0);
monthBegin.setDate(1);
$scope.params.datefrom = monthBegin;
$scope.loadTradeLogs(1);
};
$scope.loadTradeLogs = function (page) {
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
params.page = page || $scope.pagination.page || 1;
$http.get('/client/partner_info/incremental_trade_logs', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.gatewaySelected = function (arr) {
return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) {
return arr.indexOf(gateway) >= 0
}).length > 0
};
$scope.showTradeDetail = function (order) {
orderService.clientOrderDetail(order)
};
$scope.showPRefundLog = function (orderId) {
partnerRefunder.prefunded(orderId);
};
$scope.newPRefund = function (orderId) {
partnerRefunder.prefund(orderId).then(function () {
$scope.loadTradeLogs();
});
};
$scope.releasePreAuth = function (orderId) {
commonDialog.confirm({
title: 'Pre Authorization Completion',
content: 'This bill will be taken into settlement, or you will be able to make a refund order. Are you sure?'
}).then(function () {
$http.put('/client/partner_info/trade_logs/' + orderId + '/release_preauth').then(function (resp) {
$scope.loadTradeLogs();
}, function (resp) {
commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'})
})
})
};
$scope.alerts = [];
$scope.$on('pe_order_paid', function (evt, order) {
$scope.alerts.push(order);
$timeout(function () {
$scope.alerts.splice(0, 1);
}, 10000);
$scope.loadTradeLogs();
});
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.isAll = true;
$scope.chooseClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.clientIds);
$scope.showLevel3Clients = false;
$scope.listDevices();
} else if (client.level3Clients) {
$scope.chooseClientId = client.client_id;
$scope.showLevel3Clients = true;
$scope.level3Clients = client.level3Clients;
$scope.isAll = false;
$scope.level3ClientIds = [];
$scope.level3ClientIds.push(client.client_id);
client.level3Clients.forEach(function (client) {
$scope.level3ClientIds.push(client.client_id);
});
$scope.chooseLevel3Client("all");
return;
} else {
$scope.chooseClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isAll = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.showLevel3Clients = false;
$scope.listDevices();
}
$scope.loadTradeLogs();
};
$scope.chooseLevel3Client = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.level3ClientIds);
$scope.isLevel3All = true;
$scope.chooseLevel3ClientId = '';
$scope.dev_params.client_ids = angular.copy($scope.level3ClientIds);
$scope.listDevices();
} else {
$scope.chooseLevel3ClientId = client.client_id;
$scope.params.client_ids = [client.client_id];
$scope.isLevel3All = false;
$scope.dev_params.client_ids = [client.client_id];
$scope.listDevices();
}
$scope.loadTradeLogs();
};
$scope.listDevices = function () {
var params = angular.copy($scope.dev_params)
$http.get('/client/partner_info/devices', {params: params}).then(function (resp) {
$scope.devices = resp.data.data;
})
};
$scope.chooseDevices = function (dev_id) {
if(dev_id == 'all'){
$scope.chooseDevice_id = '';
$scope.params.dev_id = null;
$scope.device_isAll = true;
$scope.loadTradeLogs(1);
}else {
$scope.chooseDevice_id = dev_id;
$scope.params.dev_id = dev_id;
$scope.device_isAll = false;
$scope.loadTradeLogs(1);
}
};
$scope.listDevices();
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.loadTradeLogs(1);
//console.log($rootScope.currentUser.client.clientList);
})
}else{
$scope.loadTradeLogs(1);
}
$scope.fullReleasePreAuth = function (){
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
}
commonDialog.confirm({
title: 'All Pre Authorization Completion',
content: 'These pre authorization orders will be taken into settlement, or you will be able to make a refund order. Are you sure?'
}).then(function(){
$http.put('/client/partner_info/trade_logs/full_release_preauth',params).then(function (resp){
$scope.loadTradeLogs(1);
alert("Success");
},function (resp) {
commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'})
})
});
}
}]);
return app;
});
});

@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
controller: 'balanceListCtrl'
})
}]);
app.controller('balanceListCtrl', ['$scope', '$http', '$filter', '$timeout', 'refunder', 'orderService', function ($scope, $http, $filter, $timeout, refunder) {
app.controller('balanceListCtrl', ['$scope', '$http', '$filter', '$timeout', 'refunder', 'orderService','$sce', function ($scope, $http, $filter, $timeout, refunder,orderService,$sce) {
$scope.params = {};
$scope.pagination = {};
$scope.params.clearing_status = -1;
@ -91,6 +91,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
params.page = page || $scope.pagination.page || 1;
$http.get('/client/trans_flow', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.htmlToolst();
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
@ -214,7 +215,29 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}else {
$scope.chooseLast7Days();
}
$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
var tax_amount = $scope.tradeLogs[i].tax_amount;
var total_surcharge= $scope.tradeLogs[i].total_surcharge;
var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge;
var channel_surcharge = $scope.tradeLogs[i].channel_surcharge;
var royal_surcharge = $scope.tradeLogs[i].royal_surcharge;
var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2);
var channel = $scope.tradeLogs[i].source;
var tip = '<div style="width: 180px">' +
'<h5>手续费组成</h5>'+'<div style="background-color: #EFEFF5;height: 1px;margin-bottom: 10px;"></div>'+
'<p>system:'+ system_surcharge +'</p>' +
'<p>'+channel+':'+ incremental_surcharge +'</p>';
if(total_surcharge <= (royal_surcharge+incremental_surcharge+channel_surcharge+tax_amount)){
tip = tip +'<p>tax amount:'+ tax_amount +'</p>';
}
tip = tip + '</div>';
$scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip);
}
};
}]);
return app;
});
});

Loading…
Cancel
Save