commit
48e5624cb2
@ -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);
|
||||
}
|
||||
}
|
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">
|
||||
| <a role="button"
|
||||
ng-class="{'bg-primary':sub.client_id==chooseClientId}"
|
||||
ng-click="chooseClient(sub.client_id)">{{sub.short_name}}</a>
|
||||
</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="‹"
|
||||
next-text="›"
|
||||
first-text="«"
|
||||
last-text="»"></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>
|
Loading…
Reference in new issue