merge conflict

master
wangning 7 years ago
commit 48e5624cb2

@ -167,7 +167,7 @@
*/
/**
* @api {PUT} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order
* @apiName NewJSAPI
* @apiGroup JSApi
* @apiVersion 1.1.0

@ -4,6 +4,8 @@ import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.notice.beans.NoticeInfo;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSONObject;
@ -118,4 +120,9 @@ public interface RetailAppService {
void changeManualSettle(JSONObject device,boolean manual_settle);
JSONObject getTradeCommonDateNew(JSONObject device, AppQueryBean appQueryBean);
JSONObject getQrcode(JSONObject device, QRCodeConfig config,int client_id);
void changeSurchargeEnable(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO);
}

@ -42,9 +42,12 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.QRCodeUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSON;
@ -232,6 +235,26 @@ public class RetailAppServiceImp implements RetailAppService {
return res;
}
@Override
public JSONObject getQrcode(JSONObject device, QRCodeConfig config,int client_id) {
JSONObject client = merchantInfoProvider.getClientInfo(client_id);
String url = PlatformEnvironment.getEnv().concatUrl("/api/payment/v1.0/partners/" + client.getString("client_moniker"));
if (config.isCNY()) {
url += "_CNY";
}
url += config.extension();
JSONObject res = new JSONObject();
res.put("url", url);
res.put("qrcode", QRCodeUtils.qrcodeImageCode(url, 250, false));
res.put("qrcode_board", merchantInfoProvider.getQrCodeBoard(client, config));
return res;
}
@Override
public void changeSurchargeEnable(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
merchantInfoProvider.changeSurchargeEnable(device,updateSurchargeDTO);
}
@Override
public void updateClient(JSONObject device, AppClientBean appClientBean) {
String clientType = device.getString("client_type");

@ -20,6 +20,8 @@ import au.com.royalpay.payment.tools.device.advise.AppClientController;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -44,6 +46,8 @@ import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import static au.com.royalpay.payment.tools.CommonConsts.RETAIL_DEVICE;
/**
* Created by yishuqian on 28/03/2017.
*/
@ -433,4 +437,17 @@ public class RetailAppController {
retailAppService.changeManualSettle(device,data.getBoolean("manual_settle"));
}
@RequestMapping(value = "/qrcode", method = RequestMethod.GET)
public JSONObject getQrcode(@ModelAttribute(RETAIL_DEVICE) JSONObject device,@RequestParam(required = false,defaultValue = "0") int client_id, QRCodeConfig config) {
if(client_id==0){
client_id = device.getIntValue("client_id");
}
return retailAppService.getQrcode(device,config,client_id);
}
@RequestMapping(value = "/surcharge", method = RequestMethod.PUT)
@ResponseBody
public void changeQRCodePaySurCharge(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody UpdateSurchargeDTO updateSurchargeDTO) {
retailAppService.changeSurchargeEnable(device, updateSurchargeDTO);
}
}

@ -49,6 +49,7 @@ public class PartnerQuery {
private boolean apply_to_back = false;
private boolean bd_upload_material = false;
private boolean is_valid = false;
private String merchant_id;
public String getClient_moniker() {
return StringUtils.isEmpty(client_moniker) ? null : client_moniker;
@ -208,6 +209,9 @@ public class PartnerQuery {
if (bd_upload_material){
param.put("bd_upload_material",true);
}
if (merchant_id != null){
param.put("merchant_id",merchant_id);
}
return param;
}
@ -448,4 +452,12 @@ public class PartnerQuery {
public void setBd(String bd) {
this.bd = bd;
}
public String getMerchant_id() {
return merchant_id;
}
public void setMerchant_id(String merchant_id) {
this.merchant_id = merchant_id;
}
}

@ -199,6 +199,8 @@ public interface ClientManager {
void setClientTaxInSurcharge(JSONObject account,String clientMoniker, boolean taxInSurcharge);
void setClientCustomerTaxFree(String clientMoniker, boolean customerTaxFree);
List<JSONObject> listClientsForSettlement();
List<JSONObject> listClientsDetailsForSettlement();

@ -2284,6 +2284,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void setClientCustomerTaxFree(String clientMoniker, boolean customerTaxFree) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject update = new JSONObject();
int clientId = client.getIntValue("client_id");
update.put("client_id", clientId);
update.put("customer_tax_free", customerTaxFree);
clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public List<JSONObject> listClientsForSettlement() {
return clientMapper.listClientsForSettlement();
@ -2704,9 +2718,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new InvalidShortIdException();
}
if (client.getIntValue("approve_result") < 3) {
throw new ForbiddenException();
}
int open_status = client.getIntValue("open_status");
AuditModify auditModify = new AuditModify(manager, clientMoniker, 5, manager.getString("manager_id"), new Date());
@ -2715,6 +2726,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} else {
auditModify.setOpen_status(-1);
}
if(client.getInteger("approve_result")==null || client.getIntValue("approve_result")==4){
client.put("approve_result", 5);
}
client.put("approver", manager.getString("manager_id"));
client.put("approve_time", new Date());
if (refuse_remark != null && !refuse_remark.isEmpty()) {
auditModify.setRefuse_remark(refuse_remark);
}

@ -195,6 +195,11 @@ public class PartnerManageController {
clientManager.setClientTaxInSurcharge(manager,clientMoniker, config.getBooleanValue("tax_in_surcharge"));
}
@ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void setClientCustomerTaxFree(@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setClientCustomerTaxFree(clientMoniker, config.getBooleanValue("customer_tax_free"));
}
@ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void updateCredentialCode(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.refreshClientCredentialCode(manager, clientMoniker);

@ -0,0 +1,33 @@
package au.com.royalpay.payment.manage.partnerinvoice.web;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yuan on 2018/4/17.
*/
@RestController
@RequestMapping("/partner/invoice")
public class PartnerInvoiceController {
@Resource
private TradeLogService tradeLogService;
@PartnerMapping(value = "/trans_flow",method = RequestMethod.GET,roles = PartnerRole.ADMIN)
public JSONObject listTransFlow(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) throws Exception {
return tradeLogService.listPartnerTransFlowPage(query,partner);
}
@PartnerMapping(value = "/trans_flow/pdf", method = RequestMethod.GET,roles = PartnerRole.ADMIN)
public void exportTransFlowPDF(TradeLogQuery query,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse httpResponse) throws Exception {
tradeLogService.exportTransFlow(query,partner,httpResponse);
}
}

@ -41,11 +41,12 @@ public class ABAFile {
StringWriter out = new StringWriter();
PrintWriter writer = new PrintWriter(out);
writer.println(generateTopLine());
writer.print(generateTopLine() + "\r\n");
for (SettleMerchantInfo info : settlements) {
writer.println(info.settleLine());
String line = info.settleLine();
writer.print(line + "\r\n");
}
writer.println(generateBalanceLine());
writer.print(generateBalanceLine() + "\r\n");
writer.print(generateFinalLine());
writer.flush();
return out.toString().getBytes();
@ -125,7 +126,7 @@ public class ABAFile {
lineBuilder.replace(62, 80, StringUtils.rightPad("RoyalPay" + DateFormatUtils.format(settleDate, "yyyyMMdd"), 18));
lineBuilder.replace(80, 87, bsbNo(selfBSB));
lineBuilder.replace(87, 96, StringUtils.leftPad(selfAccountNo, 9));
lineBuilder.replace(96, 112, StringUtils.rightPad(company, 16));
lineBuilder.replace(96, 112, StringUtils.left(StringUtils.rightPad(company, 16), 16));
lineBuilder.replace(112, 120, StringUtils.leftPad("0", 8, "0"));
return lineBuilder.toString();
}

@ -7,7 +7,7 @@ import java.util.Date;
public interface ClientContractService {
JSONObject getOrGenerateSourceAgreement(int client_id, String channel);
void getOrGenerateSourceAgreement(int client_id, String channel);
void confirmSourceAgreement(int client_id, String account_id, String channel);

@ -8,7 +8,6 @@ import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
@ -45,7 +44,7 @@ public class ClientContractServiceImpl implements ClientContractService {
@Override
@Transactional
public JSONObject getOrGenerateSourceAgreement(int client_id, String channel) {
public void getOrGenerateSourceAgreement(int client_id, String channel) {
JSONObject client = clientManager.getClientInfo(client_id);
if (client == null) {
throw new NotFoundException("merchant not found");
@ -53,11 +52,9 @@ public class ClientContractServiceImpl implements ClientContractService {
try {
clientManager.getNewAggregateAgreeFile(client.getString("client_moniker"), null, true);
} catch (Exception e) {
logger.info("App generate PDF failed");
throw new ServerErrorException("System error");
logger.error("App generate PDF failed");
// throw new ServerErrorException("System error");
}
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
return files.get(0);
}
@ -131,21 +128,23 @@ public class ClientContractServiceImpl implements ClientContractService {
if (sysconfig != null && !sysconfig.getBoolean("sys_new_contract_on")) {
return result;
}
JSONObject contract = clientsContractMapper.findByClientId(client_id);
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
if (!CollectionUtils.isEmpty(files)) {
JSONObject file = files.get(0);
if (sysconfig.getDate("sys_new_contract_time").compareTo(file.getDate("last_update_date")) > 0) {
JSONObject contract = clientsContractMapper.findByClientId(client_id);
if (contract == null) {
saveContract(client_id, new Date(), channel);
}
}
}else {
JSONObject contract = clientsContractMapper.findByClientId(client_id);
if (contract == null) {
saveContract(client_id, new Date(), channel);
}
}
if (contract != null && contract.getBoolean("has_sign")) {
return result;
}
JSONObject clientConfig = clientConfigService.find(client_id);
if (clientConfig.getBooleanValue("tax_in_surcharge")) {
result.put("alert", true);

@ -17,4 +17,4 @@ app.wechatpay.merchants.1487387142.mp-id=globalpay
app.wechatpay.merchants.1487387142.merchant-id=1487387142
app.wechatpay.merchants.1487387142.mch-key=OuvLIL93STqFhTngNaBGT8751ZJn4FKL
app.wechatpay.merchants.1487387142.key-file=classpath:napclient_cert.p12
app.wechatpay.merchants.1487387142.example-sub-merchant-id=117551742
app.wechatpay.merchants.1487387142.example-sub-merchant-id=203312199

@ -102,6 +102,9 @@
<if test="state!=null">
and c.state=#{state}
</if>
<if test="merchant_id!=null">
and c.merchant_id=#{merchant_id}
</if>
<if test="temp_mch_id!=null">
and locate(c.sub_merchant_id,#{temp_mch_id})&gt;0 and cc.skip_clearing=0 and
locate(c.client_moniker,#{temp_mch_id_source})&lt;=0

@ -899,6 +899,15 @@ margin-bottom: 10%;"/>
</li>
</ul>
</li>
<li ng-if="([1]|withRole)">
<ul>
<li>
<a ui-sref="partner_invoice">
<!--<i class="fa fa-users" aria-hidden="true"></i> -->Invoice Assistant
</a>
</li>
</ul>
</li>
</ul>
@ -938,7 +947,7 @@ margin-bottom: 10%;"/>
<li class="has-submenu" ng-if="currentUser.client.client_moniker=='PINE'"
ng-class="{'open' : integral.active}" ui-sref-active="active">
<a ng-click="integral.active = !integral.active"><i class="fa fa-shopping-cart"></i>Integral Mall</a>
<a ng-click="integral.active = !integral.active"><i class="fa fa-shopping-cart"></i>Promotion</a>
<ul class="submenu" ng-class="{'open' : integral.active}">
<li>
<a ui-sref="couponcancellation">

@ -374,8 +374,9 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
return function (channel) {
switch (channel) {
case 'Alipay':
case 'AlipayOnline':
return '/static/images/alipay_sign_lg.png';
case 'AlipayOnline':
return '/static/images/alipay_online.png';
case 'System':
return '/static/images/royalpay_sign.png';
case 'Bestpay':

@ -30,7 +30,7 @@
</li>
<li ng-class="{active:ctrl.channel=='AlipayOnline'}" ng-if="report.channels.AlipayOnline">
<a role="button" ng-click="ctrl.channel='AlipayOnline'" title="AlipayOnline">
<img src="/static/images/alipay_sign_lg.png" class="channel-icon-lg">
<img src="/static/images/alipay_online.png" class="channel-icon-lg">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Bestpay'}" ng-if="report.channels.Bestpay">

@ -74,7 +74,8 @@ var modules = [
{path: 'static/payment/cashiers/cashier-manage', module: 'cashierManagement', roles: [1, 2, 3]},
{path: 'static/application/clientAuthentication', module: 'clientAuthentication', roles: [1]},
{path: 'static/cashback/partner-cashback', module: 'cashbackApp', roles: [1,2,3]},
{path: 'static/integralmall/coupon_cancellation', module: 'couponCancellation', roles: [1,2]}
{path: 'static/integralmall/coupon_cancellation', module: 'couponCancellation', roles: [1,2]},
{path: 'static/invoice/invoice_assistant', module: 'partnerInvoice', roles: [1]}
];
require(['angular', 'jquery'], function (angular, $) {

@ -1,7 +1,7 @@
/**
* Created by davep on 2016-08-15.
*/
define(['../app'], function (app) {
define(['../app','decimal'], function (app,Decimal) {
'use strict';
app.factory('clearingDetailService', ['$uibModal', function ($uibModal) {
function openDetail(url, is_partner) {
@ -28,14 +28,16 @@ define(['../app'], function (app) {
app.controller('clearingDetailCtrl', ['$scope', 'detail', 'is_partner', function ($scope, detail, is_partner) {
$scope.ctrl = {channel: null};
$scope.report = detail.data;
$scope.report.total_charge = Decimal.add($scope.report.total_charge,$scope.report.tax_amount).toFixed(2);
$scope.is_partner = is_partner;
}]);
app.filter('channel_image', function () {
return function (channel) {
switch (channel) {
case 'Alipay':
case 'AlipayOnline':
return '/static/images/alipay_sign_lg.png';
case 'AlipayOnline':
return '/static/images/alipay_online.png';
case 'System':
return '/static/images/royalpay_sign.png';
case 'Bestpay':

@ -317,8 +317,9 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
return function (channel) {
switch (channel) {
case 'Alipay':
case 'AlipayOnline':
return '/static/images/alipay_sign_lg.png';
case 'AlipayOnline':
return '/static/images/alipay_online.png';
case 'System':
return '/static/images/royalpay_sign.png';
case 'Bestpay':

@ -24,9 +24,9 @@
<div class="form-group">
<label class="control-label">Merchant ID</label>
<select ng-model="params.merchant" id="merchant-select" class="form-control">
<option value="1307485301">1307485301</option>
<option value="1431999902">1431999902</option>
<option value="1487387142">1487387142</option>
<option value="1307485301">1307485301(Tunnel Show 1)</option>
<option value="1431999902">1431999902(Tunnel Show 2)</option>
<option value="1487387142">1487387142(NAP)</option>
</select>
</div>
<button class="btn btn-primary" ng-click="loadSettlements()">

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,115 @@
/**
* Created by yixian on 2017-02-05.
*/
define(['angular','decimal'], function (angular,decimal) {
'use strict';
var app = angular.module('partnerInvoice', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('partner_invoice', {
url: '/partner/invoice',
templateUrl: '/static/invoice/templates/invoice_assistant.html',
controller: 'partnerInvoiceApp'
})
}]);
app.controller('partnerInvoiceApp', ['$scope', '$http','$filter', 'commonDialog', function ($scope, $http,$filter, commonDialog) {
$scope.params = {channel:'ALL',clearing_status:-1};
$scope.today = new Date();
$scope.pagination = {};
$scope.today = new Date();
$scope.clients = [$scope.currentUser.client];
if ($scope.currentUser.client.has_children) {
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
})
};
$scope.chooseClient = function (clientId) {
$scope.chooseClientId = clientId;
$scope.params.client_ids = [clientId];
$scope.loadTradeLogs(1);
};
$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('/partner/invoice/trans_flow', {params: params}).then(function (resp) {
$scope.tradeLogs = resp.data.data;
$scope.tradeLogs.forEach(function (log) {
if(log.total_surcharge){
log.total_surcharge = decimal.add(log.total_surcharge,log.tax_amount).toFixed(2);
}
});
$scope.pagination = resp.data.pagination;
$scope.analysis = resp.data.analysis;
$scope.total_surcharge = decimal.add($scope.analysis.total_surcharge,$scope.analysis.tax_amount).toFixed(2);
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
}, function (resp) {
commonDialog.alert({title: 'Search failed', content: resp.data.message, type: 'error'});
});
};
$scope.export = function (type,page) {
var url='/partner/invoice/trans_flow/pdf';
var connectSymbol = '?';
var params = angular.copy($scope.params);
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
url += connectSymbol + 'datefrom=' + params.datefrom;
connectSymbol = '&';
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto;
connectSymbol = '&';
}
params.page = page || $scope.pagination.page || 1;
url += connectSymbol + 'page=' + params.page;
url+="&channel=ALL&clearing_status=-1";
return url;
}
}]);
return app;
});

@ -0,0 +1,264 @@
<style>
.tr_refund {
color: red;
}
.tr_clearing {
color: green;
}
.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>Invoice Assistant</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-comments-o"></i> Payment
</li>
<li class="active">Invoice Assistant</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="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="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">
<label ng-repeat="sub in clients">
|&nbsp;<a role="button"
ng-class="{'bg-primary':sub.client_id==chooseClientId}"
ng-click="chooseClient(sub.client_id)">{{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>
<!--<a ng-if="pagination.totalCount>0" class="btn btn-success" style="float: right"-->
<!--target="_blank" ng-href="{{export()}}">Export</a>-->
<div class="btn-group" uib-dropdown ng-if="pagination.totalCount>0" style="float: right;right: 20px;">
<a ng-href="{{export('pdf')}}" target="_blank" class="btn btn-primary" href="{{export('Export Invoice')}}">
<i class="fa fa-download"></i> PDF
</a>
</div>
</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.transaction_amount}}</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-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">Total Settle Amount</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.total_settle_amount|currency:'AUD '"></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-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">Total Surcharge</span>
<span class="info-box-number box-number_font"
ng-bind="total_surcharge|currency:'AUD '"></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-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">GST</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.tax_amount|currency:'AUD'"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title">Transaction Flowing
</h3>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Date/Time</th>
<th>Description</th>
<th>Currency</th>
<th>Input Amount</th>
<th>Amount</th>
<th style="min-width: 90px">Settle Amount <i class="fa fa-info-circle" uib-tooltip="It will show after the settlement." aria-hidden="true"></i></th>
<th>Total Surcharge</th>
<th>GST</th>
<th>Debit</th>
<th>Credit</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<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/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" ng-if="trade.channel=='Bestpay'"/>
<img src="/static/images/alipay_sign.png"
uib-tooltip=Alipay" ng-if="trade.channel=='Alipay'"/>
<img src="/static/images/jd_sign.png"
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
{{trade.order_id2}}
</td>
<td ng-bind="trade.currency"></td>
<td ng-bind="trade.display_amount"></td>
<td ng-bind="trade.transaction_amount"></td>
<td ng-bind="trade.settle_amount"></td>
<td ng-bind="trade.total_surcharge"></td>
<td ng-bind="trade.tax_amount">
<!--<p ng-if="trade.trans_type=='clearing'">
-
</p>
<p ng-if="trade.trans_type !='clearing'">
{{trade.exchange_rate}}
</p>-->
</td>
<td>
<p ng-if="trade.transaction_type =='Credit'">
-
</p>
<p ng-if="trade.transaction_type =='Debit'">
{{trade.clearing_amount}}
</p>
</td>
<td>
<p ng-if="trade.transaction_type =='Credit'">
{{trade.clearing_amount}}
</p>
<p ng-if="trade.transaction_type =='Debit'">
-
</p>
</td>
<td ng-bind="trade.order_detail||trade.remark"></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>

@ -141,7 +141,7 @@
<div class="info-box-content box-content_left">
<span class="info-box-text">Total Surcharge</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.total_surcharge|currency:'AUD '"></span>
ng-bind="analysis.total_fee|currency:'AUD '"></span>
</div>
</div>
</div>

@ -1359,6 +1359,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.customerTaxFree = function (customerTaxFree) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/customer_tax_free', {customer_tax_free: customerTaxFree}).then(function (resp) {
})
};
$scope.settleHours = [{value: undefined, label: 'Default(24:00, GMT+10)'}];
for (var h = 24; h > 0; h--) {
$scope.settleHours.push({value: h, label: ('00' + h).substr(-2) + ':00, ' + $scope.partner.timezone});
@ -2485,6 +2490,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
app.controller('managerClearingDetailCtrl', ['$scope', 'detail', function ($scope, detail) {
$scope.ctrl = {channel: null};
$scope.report = detail.data;
$scope.report.total_charge = Decimal.add($scope.report.total_charge,$scope.report.tax_amount).toFixed(2);
}]);
app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'industryMap', function ($scope, $http, $uibModal, commonDialog, $state, Upload, industryMap) {
@ -2772,6 +2778,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
});
app.filter('choose_merchant_id', function () {
return function (value) {
switch (value + '') {
case '1307485301':
return '1307485301(Tunnel Show1)';
case '1431999902':
return '1431999902(Tunnel Show2)';
case '1487387142':
return '1487387142(NAP)';
case '':
return ''
}
}
});
app.filter('cut', function () {
return function (value, wordwise, max, tail) {
if (!value) return '';

@ -20,6 +20,13 @@
switch-change="taxInSurcharge(partner.tax_in_surcharge)">
</div>
</div>
<div class="form-group" ng-if="('10'|withRole)">
<label class="col-sm-4">Merchant Pay GST &ensp;<small><em>(消费者承担手续费时生效)</em></small></label>
<div class="col-sm-6">
<input type="checkbox" ng-model="partner.customer_tax_free" bs-switch
switch-change="customerTaxFree(partner.customer_tax_free)">
</div>
</div>
<div class="form-group" ng-if="'modify_skip_clear'|withFunc">
<label class="col-sm-4">Skip Clearing</label>
<div class="col-sm-6">

@ -11,6 +11,7 @@
{{paymentInfo.sub_merchant_id||'Not Configure'}}
<a role="button" ng-click="ctrl.editSubMerchant=true" ng-if="'011'|withRole"><i class="fa fa-edit"></i></a>
<i class="fa fa-clock-o text-danger" title="Using temp Sub Merchant ID" ng-if="paymentInfo.temp_sub_merchant"></i>
&nbsp;&nbsp;<span class="small" ng-if="('10'|withRole) &&paymentInfo.sub_merchant_id&&paymentInfo.merchant_id"><b>Merchant ID</b>:{{paymentInfo.merchant_id | choose_merchant_id}}</span>
</p>
<div class="input-group" ng-if="ctrl.editSubMerchant">
<input type="text" class="form-control" ng-model="paymentInfo.sub_merchant_id"

@ -113,6 +113,18 @@
ng-model="params.sub_merchant_id">
</div>
</div>
<div class="form-group col-sm-6" ng-if="('10'|withRole)">
<label class="control-label col-xs-4 col-sm-4">Merchant ID</label>
<div class="col-xs-6">
<select ng-model="params.merchant_id" id="merchant-select" class="form-control">
<option value="">All</option>
<option value="1307485301">1307485301(Tunnel Show1)</option>
<option value="1431999902">1431999902(Tunnel Show2)</option>
<option value="1487387142">1487387142(NAP)</option>
</select>
</div>
</div>
<!--BD City-->
<div class="form-group col-sm-6">
<label class="control-label col-xs-4 col-sm-4"

@ -22,7 +22,7 @@
</li>
<li ng-class="{active:ctrl.channel=='AlipayOnline'}" ng-if="report.channels.AlipayOnline">
<a role="button" ng-click="ctrl.channel='AlipayOnline'" title="AlipayOnline">
<img src="/static/images/alipay_sign_lg.png" class="channel-icon-lg">
<img src="/static/images/alipay_online.png" class="channel-icon-lg">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Bestpay'}" ng-if="report.channels.Bestpay">

Loading…
Cancel
Save