1'use strict'; 2 3appCore.state['app.v2_0_restricted.admin.invoicingServices'] = 4 { 5 url: '/services', 6 parent: 'app.v2_0_restricted.admin', 7 views: 8 { 9 '[email protected]_0_restricted': 10 { 11 templateUrl: 'v2_0.restricted.admin.invoice.invoicingServices' 12 } 13 } 14 }; 15 16 17(function () { 18 angular.module('app.admin2').controller('app.admin.invoicingServicesController2', 19 [ 20 '$log', '$scope', '$location', 'notifications', '$rootScope', '$state', 'ddService', 'invoiceService', 21 function ($log, $scope, $location, notifications, $rootScope, $state, ddService, invoiceService) { 22 23 //$log.info("invoicing services controller"); 24 25 $scope.keepHidden = true; 26 $scope.hideTable = true; 27 $scope.calculationDisabled = true; 28 $scope.isAccordionOpen = false; 29 $scope.idUser = $rootScope.auth.userId; 30 $scope.selectedCenter = null; 31 $scope.centers = []; 32 $scope.services = []; 33 $scope.fromDate = new Date(2016, 6, 1); 34 $scope.untilDate = Date.now(); 35 $scope.showErrorMessage = false; 36 37 38 /// setup for the searchbox 39 $scope.setSelectBox = function () { 40 $scope.selectBox = { 41 inputFieldCenterName: { 42 dataSource: $scope.centers, 43 readOnly: false, 44 displayExpr: 'Name', 45 valueExpr: 'ID', 46 searchEnabled: true, 47 bindingOptions: { 48 selectedItem: "selectedCenter" 49 }, 50 onValueChanged: function (e) { 51 $scope.setRegNr(); 52 $scope.calculationDisabled = false; 53 } 54 }, 55 } 56 }; 57 58 /// setup for the regnr textbox 59 $scope.setRegNr = function () { 60 $scope.textBox = { 61 inputFieldCenterRegNr: { 62 value: $scope.selectedCenter.Code, 63 readOnly: true, 64 hoverStateEnabled: false 65 } 66 } 67 }; 68 69 /// set up for dateboxes 70 $scope.setDateBoxes = function () { 71 $scope.dateBox = { 72 fromDate: { 73 type: "date", 74 displayFormat: "dd.MM.yyyy", 75 min: new Date(2016, 6, 1), 76 bindingOptions: { 77 value: 'fromDate', 78 } 79 }, 80 untilDate: { 81 type: "date", 82 displayFormat: "dd.MM.yyyy", 83 bindingOptions: { 84 value: 'untilDate', 85 min: 'fromDate', 86 }, 87 onValueChanged: function () { 88 if ($scope.untilDate < $scope.fromDate) { 89 $scope.showErrorMessage = true; 90 } 91 else if ($scope.untilDate === $scope.fromDate) { 92 $scope.showErrorMessage = false; 93 } 94 else { 95 $scope.showErrorMessage = false; 96 } 97 } 98 } 99 }; 100 }; 101 102 $scope.buttonOptions = { 103 bindingOptions: 104 { 105 disabled: 'calculationDisabled' 106 } 107 }; 108 109 110 $scope.untilDateValidationRules = { 111 validationRules: [ 112 { 113 type: "range", 114 max: $scope.maxValue, 115 message: 'The until date must be bigger than the from date' 116 }] 117 }; 118 119 $scope.centerSelectValidationRules = { 120 validationRules: [ 121 { 122 type: "required", 123 //max: $scope.maxValue, 124 message: 'Required' 125 }] 126 }; 127 128 //when the page loads get all the centers for dropdown picker 129 ddService.getCenters() 130 .success(function (data) { 131 $scope.centers = data; 132 $scope.setSelectBox(); 133 $scope.setDateBoxes(); 134 $scope.keepHidden = false; 135 }) 136 .error(function () { 137 $log.error("Error getting centers list"); 138 }); 139 140 141 142 $scope.calculateServices = function () { 143 console.log("selected center:", $scope.selectedCenter); 144 145 if ($scope.selectedCenter == null) return; 146 147 //JavaScript counts months from 0 to 11. January is 0. December is 11. 148 var defaultData = new Date(2016, 6, 1); 149 150 if ($scope.fromDate == null) { 151 $scope.fromDate = defaultData; 152 } 153 //console.log("date:", $scope.fromDate, $scope.untilDate); 154 155 invoiceService.getCalculation($scope.selectedCenter.ID, $scope.fromDate, $scope.untilDate) 156 .success(function (data) { 157 $scope.services = data; 158 console.log("services:", data); 159 $scope.hideTable = false; 160 setTimeout(function () { 161 angular.element('#restrictedContent').animate({ 162 scrollTop: angular.element('#invoiceTable').position().top - 20 163 }) 164 }, 50); 165 }) 166 .error(function () { 167 $log.error("Error getting the invoice services calculation") 168 });
169 }; 170 171 $scope.getTotal = function () { 172 var total = 0; 173 for (var i = 0; i < $scope.services.length; i++) { 174 total += $scope.services[i].Price * $scope.services[i].Quantity; 175 } 176 return total; 177 }; 178 179 $scope.onTextClick = function ($event) { 180 $event.target.select(); 181 }; 182 183 //used to disable input field for Pauschale Patientenbefragung(monatlich) 184 $scope.isDisabled = function (index, item) { 185 if (index === 0) { 186 return true; 187 } 188 }; 189 190 } 191 ] 192 ); 193})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.