【R】商户端&运营端订单source处理

master
liuxinxin 5 years ago
parent d6074bc055
commit fbf83fcb35

@ -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);
}

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

@ -29,6 +29,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;
@ -89,6 +90,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());
@ -247,4 +250,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,45 @@ 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());
}
}
}
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 JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager) {
JSONObject params = query.toParams(null);
@ -195,6 +236,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) {

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

@ -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,46 @@
<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"/>
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'
<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 != 'system'
</if>
</where>
GROUP BY o.order_id
</select>
@ -396,6 +585,8 @@
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='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 +666,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,

@ -874,6 +874,11 @@ margin-bottom: 10%;"/>
<!--<i class="fa fa-list-alt"></i> -->Orders
</a>
</li>
<li>
<a ui-sref="incremental_trade">
<!--<i class="fa fa-list-alt"></i> -->Incremental Orders
</a>
</li>
<li>
<a ui-sref="settlementlogs">
<!--<i class="fa fa-calendar"></i> -->Settlement

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

@ -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,29 @@ 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>';
debugger;
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/yangmatou_sign.png"
uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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>

@ -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/yangmatou_sign.png"
uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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>YangMaTou Rate</th>
<th>YangMaTou 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/yangmatou_sign.png"
uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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,387 @@
<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=='yangmatou'}"
ng-click="params.source='yangmatou';loadTradeLogs(1)">YangMaTou2</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>
</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/yangmatou_sign.png" uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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>

@ -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=='yangmatou'}"
ng-click="params.source='yangmatou';loadTradeLogs(1)">YangMaTou</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/yangmatou_sign.png" uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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=='yangmatou'}"
ng-click="params.source='yangmatou';loadTradeLogs(1)">YangMaTou</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/yangmatou_sign.png"
uib-tooltip="YangMaTou" ng-if="trade.source=='yangmatou'"/>
<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: 'yangmatou',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>yangmatou:'+ 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: 'yangmatou',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