(function () { "use strict"; angular .module('codeAPLEBOX.client.user.customer.detailstatus.overstoredstatus') .controller('overstoredstatusController', overstoredstatusController); /* @ngInject */ function overstoredstatusController($state, $scope, $cookies, appConfig, $log, WEB_API_CUSTOMER) { var vm = this; // ======================================================================= // 초기데이터 // ======================================================================= vm.customerInfo = $cookies.getObject("customerInfo"); $scope.$on('checkOverstoredstatusStatus', function( event, data ){ vm.detailStatusYearMonth = $cookies.getObject('detailStatusYearMonth'); iniData(); }); vm.detailStatusYearMonth = $cookies.getObject('detailStatusYearMonth'); iniData(); // ======================================================================= // Angularjs Function // ======================================================================= vm.goDetailView = function(index, receiptId){ // 0: 일반, 1: 점포, 2: 비회원 $state.go('customer.detailofoverstoredstatus',{ checkDetailViewOverstoredstatus: index.toString(), receiptId: receiptId }) } // ======================================================================= // Common API // ======================================================================= function iniData(){ getReceipt(); } function getReceipt(){ WEB_API_CUSTOMER.getReceipt({ customerId: vm.customerInfo.id, detailStatusYearMonth: vm.detailStatusYearMonth, checkOverReceipt: true, }).then(function (result) { vm.receiptList = result.data.getReceipt; vm.totalOverReceiptCount = result.data.totalOverReceiptCount; }).catch(function (err) { $log.error(err); }); } } })();