|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/**
|
|
|
|
|
* Created by yixian on 2017-05-03.
|
|
|
|
|
*/
|
|
|
|
|
define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (angular,Decimal) {
|
|
|
|
|
define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) {
|
|
|
|
|
'use strict';
|
|
|
|
|
var app = angular.module('settleReportApp', ['ui.router']);
|
|
|
|
|
app.config(['$stateProvider', function ($stateProvider) {
|
|
|
|
@ -13,6 +13,7 @@ define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (a
|
|
|
|
|
}]);
|
|
|
|
|
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.months = [];
|
|
|
|
|
for (var i = 1; i < 13; i++) {
|
|
|
|
@ -38,16 +39,16 @@ define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (a
|
|
|
|
|
settlements: resp.data
|
|
|
|
|
};
|
|
|
|
|
$scope.analysis = {
|
|
|
|
|
gross_amount:0,
|
|
|
|
|
wechat_settlement:0,
|
|
|
|
|
net_amount:0,
|
|
|
|
|
royalpay_charge:0
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|