diff --git a/pom.xml b/pom.xml
index 93b305e3d..2d7a0d240 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
4.0.0
manage
- 2.3.76-SNAPSHOT
+ 2.3.77-SNAPSHOT
UTF-8
2.4.0
diff --git a/src/main/ui/static/analysis/settle_report.js b/src/main/ui/static/analysis/settle_report.js
index b7f907541..5b823ff3c 100644
--- a/src/main/ui/static/analysis/settle_report.js
+++ b/src/main/ui/static/analysis/settle_report.js
@@ -2,57 +2,63 @@
* Created by yixian on 2017-05-03.
*/
define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) {
- 'use strict';
- var app = angular.module('settleReportApp', ['ui.router']);
- app.config(['$stateProvider', function ($stateProvider) {
- $stateProvider.state('analysis_report.settle_report', {
- url: '/settle_report',
- templateUrl: '/static/analysis/templates/settle_report.html',
- controller: 'settleFinancialReportCtrl'
+ 'use strict'
+ var app = angular.module('settleReportApp', ['ui.router'])
+ app.config([
+ '$stateProvider',
+ function ($stateProvider) {
+ $stateProvider.state('analysis_report.settle_report', {
+ url: '/settle_report',
+ templateUrl: '/static/analysis/templates/settle_report.html',
+ controller: 'settleFinancialReportCtrl',
+ })
+ },
+ ])
+ app.controller('settleFinancialReportCtrl', [
+ '$scope',
+ '$http',
+ '$filter',
+ function ($scope, $http, $filter) {
+ $scope.params = { year: new Date() }
+ $scope.initMonth = function () {
+ const year = $scope.params.year.getFullYear()
+ $scope.months = []
+ for (var i = 1; i < 13; i++) {
+ var mon = '00' + i
+ mon = mon.substr(mon.length - 2, 2)
+ $scope.months.push(year + '-' + mon)
+ }
+ }
+ $scope.initMonth()
+ $scope.hasReport = function (mon) {
+ var end = $filter('date')(new Date(), 'yyyy-MM')
+ return end >= mon
+ }
+ $scope.loadReport = function (mon) {
+ var monItems = mon.split('-')
+ var year = monItems[0]
+ var month = monItems[1]
+ var monStr = year + month
+ $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) {
+ $scope.report = {
+ month: monStr,
+ settlements: resp.data,
+ }
+ $scope.analysis = {
+ gross_amount: 0,
+ wechat_settlement: 0,
+ net_amount: 0,
+ royalpay_charge: 0,
+ }
+ angular.forEach($scope.report.settlements, function (settle) {
+ $scope.analysis.gross_amount = Decimal.add(settle.gross_amount, $scope.analysis.gross_amount).toFixed(2)
+ $scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement, $scope.analysis.wechat_settlement).toFixed(2)
+ $scope.analysis.net_amount = Decimal.add(settle.net_amount, $scope.analysis.net_amount).toFixed(2)
+ $scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge, $scope.analysis.royalpay_charge).toFixed(2)
+ })
})
- }]);
- app.controller('settleFinancialReportCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
- $scope.params = {year: new Date().getFullYear()};
- $scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()];
- $scope.initMonth = function (year) {
- $scope.params.year = year;
- $scope.months = [];
- for (var i = 1; i < 13; i++) {
- var mon = '00' + i;
- mon = mon.substr(mon.length - 2, 2);
- $scope.months.push(year + '-' + mon);
- }
- };
- $scope.initMonth(new Date().getFullYear());
- $scope.hasReport = function (mon) {
- var start = '2017-02';//todo modify in different country
- var end = $filter('date')(new Date(), 'yyyy-MM');
- return start <= mon && end >= mon
- };
- $scope.loadReport = function (mon) {
- var monItems = mon.split('-');
- var year = monItems[0];
- var month = monItems[1];
- var monStr = year + month;
- $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) {
- $scope.report = {
- month: monStr,
- settlements: resp.data
- };
- $scope.analysis = {
- gross_amount: 0,
- wechat_settlement: 0,
- net_amount: 0,
- royalpay_charge: 0
- };
- angular.forEach($scope.report.settlements, function (settle) {
- $scope.analysis.gross_amount = Decimal.add(settle.gross_amount, $scope.analysis.gross_amount).toFixed(2);
- $scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement, $scope.analysis.wechat_settlement).toFixed(2);
- $scope.analysis.net_amount = Decimal.add(settle.net_amount, $scope.analysis.net_amount).toFixed(2);
- $scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge, $scope.analysis.royalpay_charge).toFixed(2);
- });
- })
- };
- }]);
- return app;
-});
\ No newline at end of file
+ }
+ },
+ ])
+ return app
+})
diff --git a/src/main/ui/static/analysis/templates/settle_report.html b/src/main/ui/static/analysis/templates/settle_report.html
index b335ae010..c91528f4d 100644
--- a/src/main/ui/static/analysis/templates/settle_report.html
+++ b/src/main/ui/static/analysis/templates/settle_report.html
@@ -10,20 +10,23 @@