master
wangning 7 years ago
commit 6931dcd1de

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

@ -2324,6 +2324,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(clientId);
}
@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();

@ -198,6 +198,11 @@ public class PartnerManageController {
clientManager.setClientTaxInSurcharge(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);
}
}

@ -49,7 +49,7 @@ public class ClientContractServiceImpl implements ClientContractService {
try {
clientManager.getNewAggregateAgreeFile(client.getString("client_moniker"), null, true);
} catch (Exception e) {
logger.info("App generate PDF failed");
logger.error("App generate PDF failed");
// throw new ServerErrorException("System error");
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,98 @@
/**
* 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.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) {
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,252 @@
<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>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs()">
<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>

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

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

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