(function () { "use strict"; angular .module('codeAPLEBOX.client.user.customer.detailstatus.returnstatus') .controller('returnstatusController', returnstatusController); function returnstatusController($state, $scope, appConfig, $log, $cookies, WEB_API_CUSTOMER) { var vm = this; // ======================================================================= // 초기데이터 // ======================================================================= vm.customerInfo = $cookies.getObject("customerInfo"); $scope.$on('checkReturnStatus', 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.detailofreturnstatus',{ checkDetailViewReturnstatus: index.toString(), receiptId: receiptId }) } // ======================================================================= // Common API // ======================================================================= function iniData(){ getReceipt(); } function getReceipt(){ WEB_API_CUSTOMER.getReceipt({ customerId: vm.customerInfo.id, detailStatusYearMonth: vm.detailStatusYearMonth }).then(function (result) { vm.receiptList = result.data.getReceipt; vm.totalReceiptCount = result.data.totalReceiptCount; vm.totalAddFee = result.data.totalAddFee; vm.totalReturnDeposit = result.data.totalReturnDeposit; }).catch(function (err) { $log.error(err); }); } } })();