|
|
@ -16,6 +16,34 @@ define(['angular','decimal'], function (angular,decimal) {
|
|
|
|
$scope.today = new Date();
|
|
|
|
$scope.today = new Date();
|
|
|
|
$scope.pagination = {};
|
|
|
|
$scope.pagination = {};
|
|
|
|
$scope.today = new Date();
|
|
|
|
$scope.today = new Date();
|
|
|
|
|
|
|
|
$scope.isAll = true;
|
|
|
|
|
|
|
|
$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.clientIds = [];
|
|
|
|
|
|
|
|
$scope.clients.forEach(function (client) {
|
|
|
|
|
|
|
|
$scope.clientIds.push(client.client_id);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.chooseClient = function (clientId) {
|
|
|
|
|
|
|
|
if (clientId == 'all') {
|
|
|
|
|
|
|
|
$scope.params.client_ids = angular.copy($scope.clientIds);
|
|
|
|
|
|
|
|
$scope.isAll = true;
|
|
|
|
|
|
|
|
$scope.chooseClientId = '';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$scope.chooseClientId = clientId;
|
|
|
|
|
|
|
|
$scope.params.client_ids = [clientId];
|
|
|
|
|
|
|
|
$scope.isAll = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
|
|
|
|
|
};
|
|
|
|
$scope.chooseToday = function () {
|
|
|
|
$scope.chooseToday = function () {
|
|
|
|
$scope.params.datefrom = $scope.params.dateto = new Date();
|
|
|
|
$scope.params.datefrom = $scope.params.dateto = new Date();
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
|
$scope.loadTradeLogs(1);
|
|
|
@ -62,7 +90,9 @@ define(['angular','decimal'], function (angular,decimal) {
|
|
|
|
$http.get('/partner/invoice/trans_flow', {params: params}).then(function (resp) {
|
|
|
|
$http.get('/partner/invoice/trans_flow', {params: params}).then(function (resp) {
|
|
|
|
$scope.tradeLogs = resp.data.data;
|
|
|
|
$scope.tradeLogs = resp.data.data;
|
|
|
|
$scope.tradeLogs.forEach(function (log) {
|
|
|
|
$scope.tradeLogs.forEach(function (log) {
|
|
|
|
|
|
|
|
if(log.total_surcharge){
|
|
|
|
log.total_surcharge = decimal.add(log.total_surcharge,log.tax_amount).toFixed(2);
|
|
|
|
log.total_surcharge = decimal.add(log.total_surcharge,log.tax_amount).toFixed(2);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
$scope.analysis = resp.data.analysis;
|
|
|
|
$scope.analysis = resp.data.analysis;
|
|
|
|